Cancel continue-as-new workflow

Hi,

I encountered unusual behavior when canceling a “Continue as New” workflow. When the parent workflow is canceled, the child workflow is also canceled if it hasn’t been started as a “Continue as New” workflow. However, if the child has already restarted as a “Continue as New” workflow, the cancellation doesn’t occur.

  1. Could you explain why this happens?
  2. How can I handle the cancellation of child workflows in this case?

I cannot reproduce the problem. Look at the parent workflow history for ExternalWorkflowExecutionCancelRequested. And for WorkflowExecutionCancelRequested in the child workflow history.

My guess is that the child doesn’t handle the cancellation request properly.