Reinitiate Child Workflow Stuck After Cancellation

Hi Temporal Community,

I’m encountering an issue where a child workflow gets stuck at the StartChildWorkflowExecutionInitiated event when I try to reinitiate it with the same workflow ID after it has been canceled. Here are the details of my setup:

  1. Parent Workflow:
  • Initiates the child workflow with a specific workflow ID.
  • Cancels the child workflow under certain conditions.
  1. Child Workflow:
  • Uses WORKFLOW_ID_REUSE_POLICY_TERMINATE_IF_RUNNING to handle workflow ID reuse.
  • Has proper cancellation handling using workflow.WithCancel.
  • Logs and responds to cancellation signals correctly.
  1. Issue:
  • After canceling the child workflow, attempting to reinitiate it with the same workflow ID results in the workflow being stuck at the StartChildWorkflowExecutionInitiated event.
  • The new child workflow does not start execution.

first child workflow initiation and second child workflow initiation is using the same function

any idea what could be the cause ?

Thanks

I believe you found a bug. WORKFLOW_ID_REUSE_POLICY_TERMINATE_IF_RUNNING was added later and not implemented in the SDK for child workflows. Please file a GitHub issue to get this addressed.

turns out after test using different temporal version, the current temporal i use is v1.13 where i got this issue

when i tried it using temporal v1.22.2 it works fine, so i think its not sdk bug, but more to temporal needs to be upgraded ?

Anyway, Thank you so much @maxim