diff --git a/docs/develop/dotnet/workflows/child-workflows.mdx b/docs/develop/dotnet/workflows/child-workflows.mdx index 4e49349f65..b59864d00a 100644 --- a/docs/develop/dotnet/workflows/child-workflows.mdx +++ b/docs/develop/dotnet/workflows/child-workflows.mdx @@ -38,10 +38,9 @@ This page shows how to do the following: 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. -Always block progress until the [ChildWorkflowExecutionStarted](/references/events#childworkflowexecutionstarted) Event is logged to the Event History to ensure the Child Workflow Execution has started. -After that, Child Workflow Executions may be abandoned using the _Abandon_ [Parent Close Policy](/parent-close-policy) set in the Child Workflow Options. +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 .NET, you can make sure your Child Workflow started by awaiting `StartChildWorkflowAsync`. To spawn a Child Workflow Execution in .NET, use the `ExecuteChildWorkflowAsync()` method which starts the Child Workflow and waits for completion or use the `StartChildWorkflowAsync()` method to start a Child Workflow and return its handle. diff --git a/docs/develop/go/workflows/child-workflows.mdx b/docs/develop/go/workflows/child-workflows.mdx index 253cf728ce..692fd0cd06 100644 --- a/docs/develop/go/workflows/child-workflows.mdx +++ b/docs/develop/go/workflows/child-workflows.mdx @@ -70,10 +70,10 @@ func YourOtherWorkflowDefinition(ctx workflow.Context, params ChildParams) (Chil To asynchronously spawn a Child Workflow Execution, the Child Workflow must have an "Abandon" Parent Close Policy set in the Child Workflow Options. Additionally, the Parent Workflow Execution must wait for the `ChildWorkflowExecutionStarted` Event to appear in its Event History before it completes. -If the Parent makes the `ExecuteChildWorkflow` call and then immediately completes, the Child Workflow Execution does not spawn. +You have to wait for the Child Workflow to start before completing the Parent to ensure the Child Workflow started. If the Parent makes the `ExecuteChildWorkflow` call and then immediately completes, the Child Workflow Execution doesn't spawn. -To be sure that the Child Workflow Execution has started, first call the `GetChildWorkflowExecution` method on the instance of the `ChildWorkflowFuture`, which will return a different Future. -Then call the `Get()` method on that Future, which is what will wait until the Child Workflow Execution has spawned. +To check if the Child Workflow started, first call the `GetChildWorkflowExecution` method on the instance of the `ChildWorkflowFuture`, which will return a different Future. +Then call the `Get()` method on that Future, which is what will wait until the Child Workflow Execution has spawned before the Parent completes. ```go import ( diff --git a/docs/develop/java/workflows/child-workflows.mdx b/docs/develop/java/workflows/child-workflows.mdx index f8629f51fe..7ad1eeda20 100644 --- a/docs/develop/java/workflows/child-workflows.mdx +++ b/docs/develop/java/workflows/child-workflows.mdx @@ -22,14 +22,11 @@ This page shows how to do the following: 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. -Always block progress until the [ChildWorkflowExecutionStarted](/references/events#childworkflowexecutionstarted) Event is logged to the Event History to ensure the Child Workflow Execution has started. -After that, Child Workflow Executions may be abandoned using the _Abandon_ [Parent Close Policy](/parent-close-policy) set in the Child Workflow Options. +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. -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. +To check if the Child Workflow started, first create a child handle with the `newChildWorkflowStub` method, which will return a Promise. Then call the `.get` method on that Promise, which is what will wait until the Child Workflow Execution has started before the Parent completes. See the examples below for more details. ### Async Child Workflows diff --git a/docs/develop/php/workflows/child-workflows.mdx b/docs/develop/php/workflows/child-workflows.mdx index 604bf57d49..0c70bff712 100644 --- a/docs/develop/php/workflows/child-workflows.mdx +++ b/docs/develop/php/workflows/child-workflows.mdx @@ -3,7 +3,7 @@ id: child-workflows title: Child Workflows - PHP SDK sidebar_label: Child Workflows slug: /develop/php/workflows/child-workflows -toc_max_heading_level: 2 +toc_max_heading_level: 3 keywords: - child-workflows tags: @@ -16,18 +16,12 @@ description: Start a Child Workflow Execution within a parent Workflow using Tem ## How to start a Child Workflow Execution {#child-workflows} -A [Child Workflow Execution](/child-workflows) is a Workflow Execution that is scheduled from within another Workflow using a Child Workflow API. +Besides Activities, a Workflow can also start other Workflows. 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. -Always block progress until the [ChildWorkflowExecutionStarted](/references/events#childworkflowexecutionstarted) Event is logged to the Event History to ensure the Child Workflow Execution has started. -After that, Child Workflow Executions may be abandoned using the _Abandon_ [Parent Close Policy](/parent-close-policy) set in the Child Workflow Options. +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 PHP, you can make sure your Child Workflow started by yielding `start`. -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. - -Besides Activities, a Workflow can also start other Workflows. `Workflow::executeChildWorkflow` and `Workflow::newChildWorkflowStub` enables the scheduling of other Workflows from within a Workflow's implementation. The parent Workflow has the ability to monitor and impact the lifecycle of the Child Workflow, similar to the way it does for an Activity that it invoked. diff --git a/docs/develop/python/workflows/child-workflows.mdx b/docs/develop/python/workflows/child-workflows.mdx index 939bd273c0..6d647a75a3 100644 --- a/docs/develop/python/workflows/child-workflows.mdx +++ b/docs/develop/python/workflows/child-workflows.mdx @@ -3,7 +3,7 @@ id: child-workflows title: Child Workflows - Python SDK sidebar_label: Child Workflows description: Start a Child Workflow Execution and set a Parent Close Policy using the Temporal Python SDK. Ensure proper progress logging and specify Parent Workflow behavior upon closure. -toc_max_heading_level: 2 +toc_max_heading_level: 3 keywords: - child workflow execution - spawn child workflow @@ -30,14 +30,9 @@ This page shows how to do the following: 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. -Always block progress until the [ChildWorkflowExecutionStarted](/references/events#childworkflowexecutionstarted) Event is logged to the Event History to ensure the Child Workflow Execution has started. -After that, Child Workflow Executions may be abandoned using the _Abandon_ [Parent Close Policy](/parent-close-policy) set in the Child Workflow Options. - -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 `start_child_workflow`. To spawn a Child Workflow Execution in Python, use the [`execute_child_workflow()`](https://python.temporal.io/temporalio.workflow.html#execute_child_workflow) function which starts the Child Workflow and waits for completion or use the [`start_child_workflow()`](https://python.temporal.io/temporalio.workflow.html#start_child_workflow) function to start a Child Workflow and return its handle. diff --git a/docs/develop/ruby/workflows/child-workflows.mdx b/docs/develop/ruby/workflows/child-workflows.mdx index 46ca1cc4a4..0006d1508b 100644 --- a/docs/develop/ruby/workflows/child-workflows.mdx +++ b/docs/develop/ruby/workflows/child-workflows.mdx @@ -27,10 +27,9 @@ This page shows how to do the following: 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. -Always block progress until the [ChildWorkflowExecutionStarted](/references/events#childworkflowexecutionstarted) Event is logged to the Event History to ensure the Child Workflow Execution has started. -After that, Child Workflow Executions may be abandoned using the _Abandon_ [Parent Close Policy](/parent-close-policy) set in the Child Workflow Options. +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 Ruby, you can make sure your Child Workflow started by awaiting `start_child_workflow`. To spawn a Child Workflow Execution in Ruby, use the `execute_child_workflow` method which starts the Child Workflow and waits for completion or use the `start_child_workflow` method to start a Child Workflow and return its handle. diff --git a/docs/develop/rust/workflows/child-workflows.mdx b/docs/develop/rust/workflows/child-workflows.mdx index 5426089401..24fb25fc2d 100644 --- a/docs/develop/rust/workflows/child-workflows.mdx +++ b/docs/develop/rust/workflows/child-workflows.mdx @@ -22,9 +22,9 @@ This page shows how to do the following: 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 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. -Always wait until the Child Workflow Execution has started before moving on. Using [`PendingChildWorkflow`](https://docs.rs/temporalio-sdk/0.2.0/temporalio_sdk/struct.PendingChildWorkflow.html) ensures this. +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 Rust, you can make sure your Child Workflow started by awaiting `child_workflow`. To start a Child Workflow in Rust, use `ctx.child_workflow()`: diff --git a/docs/develop/typescript/workflows/child-workflows.mdx b/docs/develop/typescript/workflows/child-workflows.mdx index 3492d19441..942210d105 100644 --- a/docs/develop/typescript/workflows/child-workflows.mdx +++ b/docs/develop/typescript/workflows/child-workflows.mdx @@ -18,14 +18,9 @@ description: Start and manage Child Workflow Executions using Temporal's Child W 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 (such as [StartChildWorkflowExecutionInitiated](/references/events#startchildworkflowexecutioninitiated), [ChildWorkflowExecutionStarted](/references/events#childworkflowexecutionstarted), and [ChildWorkflowExecutionCompleted](/references/events#childworkflowexecutioncompleted)) are logged in the Event History of the Child Workflow Execution. +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. -Always block progress until the [ChildWorkflowExecutionStarted](/references/events#childworkflowexecutionstarted) Event is logged to the Event History to ensure the Child Workflow Execution has started. -After that, Child Workflow Executions can be abandoned by using the `Abandon` [Parent Close Policy](/parent-close-policy) set in the Child Workflow Options. - -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 TypeScript, you can make sure your Child Workflow started by awaiting [`executeChild`](https://typescript.temporal.io/api/namespaces/workflow#startchild). To start a Child Workflow Execution and return a [handle](https://typescript.temporal.io/api/interfaces/workflow.ChildWorkflowHandle/) to it, use [startChild](https://typescript.temporal.io/api/namespaces/workflow/#startchild).