Getting child workflow start information is blocking indefinitely

Hi!

I am using the go-sdk.

I have a parent workflow that will create multiple child workflows. I want the child workflows to run async. So I set the parent policy of each of the child workflow values to be PARENT_CLOSE_POLICY_ABANDON. Then I call GetChildWorkflowExecution().Get(ctx, nil) on each of the child workflows to ensure they are started before finishing the parent workflow, as specified here.

The parent workflow will run on a cron interval to start the child workflows. I only want 1 instance of each child workflow to be running at a time, so I use the workflow ID reuse policy value WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE when starting the workflows.

The problem I am running into is when the parent workflow begins and there is already a child workflow running. I will try to execute a new child workflow using the same workflow ID of a child workflow that is already running. When I call GetChildWorkflowExecution().Get(ctx, nil) on the ChildWorkflowFuture it will just block indefinitely.

In the temporal UI I can see in the history of the parent workflow it says START_CHILD_WORKFLOW_EXECUTION_FAILED_CAUSE_WORKFLOW_ALREADY_EXISTS.

How would I go about actually determining if the workflow execution fails? I do not want to call Get() on the ChildWorkflowFuture as I do not want to block until each the child workflows are finished, I only want to block until it is started.

This sounds like a bug in the Go SDK. Would you file an issue to get this looked at?

Looks like this issue has already been filed and fixed! I was using v1.6.0 the problem has been fixed in v1.7.0

go-sdk issue: ChildWorkflowExecution Future doesn't return error on WORKFLOW_ALREADY_EXISTS · Issue #411 · temporalio/sdk-go · GitHub

1 Like