Dynamically inject Activity TaskQueue name

Is there any way to dynamically inject/pass the activity task queue name into the workflow? from what i read (correct me if i am wrong) it looks like you can not do dependency injection on the workflow class and also the activity stubs (where you define the task queue name) have to be created inside the workflow class.

Here is my use case: I have a integration test that spins up a service and runs tests on it. Each time it spins up a service i want to make sure that it is using a unique task queue so that tests dont interfere with each other.

1 Like

Just to be clear, you want an external way to control the task queue that workflow invokes an activity with? I could be misreading this but if so here is an example:

To make this work for you, just add another parameter to the workflow for the task queue.

Thanks @ryland. Since we cannot directly inject into the workflow, the 2 ways to do this seem to be 1) get it as a param to the workflow or 2) create a new dummy activity who is responsible for returning the actual activity config. I like option 2 better and will go that route.