Parent workflow is closed before child workflow even if WaitForCancellation is set to true

I have the following child wf options set when creating child workflows.

childWfOpts := workflow.ChildWorkflowOptions{

WaitForCancellation: true,
ParentClosePolicy: enums.PARENT_CLOSE_POLICY_REQUEST_CANCEL,
}

I cancelled the parent workflow and expected that the parent workflow doesn’t get ‘Cancelled’ till all the child workflows are ‘Cancelled’. Am I wrong in assuming this?

I’m attaching a screenshot which shows that the child workflows are still running even if the parent workflow closed.

You must explicitly wait for the child workflow completion before completing the parent.

Was able to figure that out just today. Thanks!

1 Like