When kicking off a child workflow, we got an error saying the workflow already exists Failure MessageWorkflow execution already started
Upon further inspection, we found that the workflow was actually kicked off, and completed, but for some reason, was not associated with the parent!
This behavior seems random so far. Some workflows can execute children just fine and the association is preserved. But sometimes it fails in this way.
Code to kick off child workflow is called from the parent workflow context (i.e. not in an Activity):
await workflow.executeChild(myChildWorkflow, {
args: [
{
someParams
},
],
workflowId: uniqueId,
workflowIdReusePolicy:
WorkflowIdReusePolicy.WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE,
taskQueue,
cancellationType:
workflow.ChildWorkflowCancellationType.WAIT_CANCELLATION_COMPLETED,
parentClosePolicy: ParentClosePolicy.PARENT_CLOSE_POLICY_REQUEST_CANCEL,
});
Thank you!