Same workflow interface multiple implementations (using Java SDK)

Hey Team!

Is it recommended to have the same workflow interface implemented differently in 2 or more implementation classes, and register these implementations to different workers/queues?

One use case I am dealing with is to execute the same task in different cloud providers… For code organization representing these tasks as the same type of workflow would be preferable. I think this means I need to start a new queue/worker for each cloud provider to make sure the right implementation is picked up…

Using different task queues would work in this case.

Another option is two define two different activity types extending the same common interface. Then the workflow would instantiate a different type depending on the cloud provider. But the calling code wouldn’t be aware of the specific type as it would be using the super interface.

Here is the sample of the polymorphic activity.