How to start an entity (i.e., long running, non-child) workflow from another workflow in golang?

SignalWithStartWorkflow is only available on the client.

We could setup a client in the workflow that will create the entity workflow but that makes unit testing harder.

Might be able to use workflow.ExecuteChildWorkflow with a PARENT_CLOSE_POLICY_ABANDON but that doesn’t seem ideal and is also proving difficult to unit test. Testing is “difficult” because I don’t have ready access to the entity workflow’s workflow function. This also has the downside of the limitation on the number of “child” workflows per parent as I understand it.

Hi @kminder

Currently, to create an external workflow you have to do it from an activity. You can inject the workflowClient into the activity when you register the activity implementation

This also has the downside of the limitation on the number of “child” workflows per parent as I understand it.

The limit is per workflowRun, you can use continue-as-new as a workaround. If you need to notify the parent you can signal back the parent workflow from the child workflow before it completes

Antonio

@antonio.perez, Just to double check, this implies that workflow.GetInfo(ctx).GetContinueAsNewSuggested() also checks the number of child workflows?