Skip to content

chore(child workflows): updated all sdk docs to clarify how to ensure a child started before a parent completes#4538

Open
flippedcoder wants to merge 2 commits intomainfrom
mm/async-child-workflow
Open

chore(child workflows): updated all sdk docs to clarify how to ensure a child started before a parent completes#4538
flippedcoder wants to merge 2 commits intomainfrom
mm/async-child-workflow

Conversation

@flippedcoder
Copy link
Copy Markdown
Contributor

@flippedcoder flippedcoder commented May 7, 2026

What does this PR do?

Some of the explanations in Go for how to ensure a Child Workflow started before a Parent completes were copy-pasted across all the SDKs. Except for Java, which is similar to Go, simply awaiting a Child Workflow method means it's started. This updates all the SDKs to clarify the differences.

Notes to reviewers

┆Attachments: EDU-6321 chore(child workflows): updated all sdk docs to clarify how to ensure a child started before a parent completes

@flippedcoder flippedcoder requested a review from a team as a code owner May 7, 2026 20:13
@vercel
Copy link
Copy Markdown

vercel Bot commented May 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
temporal-documentation Ready Ready Preview, Comment May 7, 2026 8:33pm

Request Review

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

📖 Docs PR preview links

A [Child Workflow Execution](/child-workflows) is a Workflow Execution that is scheduled from within another Workflow using a Child Workflow API.

When using a Child Workflow API, Child Workflow related Events ([StartChildWorkflowExecutionInitiated](/references/events#startchildworkflowexecutioninitiated), [ChildWorkflowExecutionStarted](/references/events#childworkflowexecutionstarted), [ChildWorkflowExecutionCompleted](/references/events#childworkflowexecutioncompleted), etc...) are logged in the Workflow Execution Event History.
When using a Child Workflow API, Child Workflow related Events ([StartChildWorkflowExecutionInitiated](/references/events#startchildworkflowexecutioninitiated), [ChildWorkflowExecutionStarted](/references/events#childworkflowexecutionstarted), [ChildWorkflowExecutionCompleted](/references/events#childworkflowexecutioncompleted), etc...) are logged in the Workflow Execution Event History. The Child Workflow needs to have an _Abandon_ [Parent Close Policy](/parent-close-policy) set in the Child Workflow Options.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this line about parent close policy added?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I shuffled this line up from below and updated it a bit. Is the Parent Close Policy optional? I think I remember something about it defaulting to Abandon.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it is optional, I don't think this sentence makes sense here.

To be sure that the Child Workflow Execution has started, first call the Child Workflow Execution method on the instance of Child Workflow future, which returns a different future.

Then get the value of an object that acts as a proxy for a result that is initially unknown, which is what waits until the Child Workflow Execution has spawned.
You should block progress on the Parent Workflow until the [ChildWorkflowExecutionStarted](/references/events#childworkflowexecutionstarted) Event is logged to the Event History to ensure the Child Workflow Execution has started. If the Parent makes the `ExecuteChildWorkflow` call and then immediately completes, the Child Workflow Execution doesn't start. In Python, you can make sure your Child Workflow started by awaiting `execute_child_workflow`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Python, you can make sure your Child Workflow started by awaiting execute_child_workflow.

I realized my statement in slack was misleading, execute_child_workflow also waits for completion, not just starting. But start_child_workflow is what ensures the workflow has started. I believe this applies to all Core SDKs. Java should follow Go

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, ok. Thanks for helping me clear that up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants