Workflow name as environment variable

Hi,
Is there an option to set the workflow name based on (environment/dynamic) variables?
I didn’t find a solution is the docs, is it possible?
I saw that @WorkflowMethod(name= “”) - must be a constant…

Thanks,
Artur

What is the use case for this?

It requested by our PO, he wants a different workflow type/name for each environment,
from your answer, I’m assuming I can tell them this is not possible by SDK?

I’m not sure what value such feature provides given that each environment is expected to live in its own namespace

You can create your ReplayWorkflowFactory, which internally will delegate to POJOWorkflowImplementationFactory and perform name mapping. One caveat is that POJOWorkflowImplementationFactory is an internal implementation, so there is no guarantee about its API stability.

For me, also “This is currently not possible, due to API stability” is perfectly fine - Thanks Maxim!

Hi Maxim,

I have a use case that requires passing the workflow name since it’s not constant. We have a proto file with workflow name that we share across domains. This allows us decoupling between the domains. One domain can take the WF name from the proto file and registers the WF under that name, and the other uses the porto to know which WF it can call.

Can you suggest a way to work around it ?

Thanks.

Use DynamicWorkflow.