How to customize workflow type name?

Hi Folks

We’ve a use-case where we might create workflows from DDL. AFAIK, workflowTypes are named after the main method for that workflow. Given our DDL use-case, we would like to change the type to a customized name. Is it possible?
We would like to query workflows and thinking of using this customized type name for filtering, hence the need for customized name.

Thanks in advance for your support.

Use worker.RegisterWorkflowWithOptions:

                 <workflowFn>, workflow.RegisterOptions{Name: <name>})
1 Like

Any plans to do similar thing in Java SDK? I was curious about that too and it looks like that in Java it is only possible to set WF name by using ‘name’ attribute on @WorkflowMethod, so it is static.


What would be the semantic of calling such workflow in case of Java? Should we pass the workflow type name into Workflow.newChildWorkflowStub call as an option?

Not sure, just thinking in terms of parity among SDKs, and this seems to me as one of ways change propagation can happen - one is to register WF with different queues, another is to manipulate WF name, I have use case that seems to call for a dynamic WF that internally maintains an FSM (Final State Machine), there would be some variations of FSM-s at the time of workflow initiation, and manipulating name seems like a way to make that visible. Again, I might be wrong and there are better ways to do it. Just thoughts.

This is an interesting topic. Longer term we plan to provide direct support for workflows that implement DSL support. The basic idea would be that the workflow worker would be registered as a special DSL workflow and each DSL document instance would be treated as a separate workflow type automatically.