diff --git a/docs/cli/workflow.mdx b/docs/cli/workflow.mdx index d7f7cd8d99..577558ad34 100644 --- a/docs/cli/workflow.mdx +++ b/docs/cli/workflow.mdx @@ -821,7 +821,7 @@ Use the following options to change termination behavior. ## trace -The `temporal workflow trace` command tracks the progress of a [Workflow Execution](/workflows#workflow-execution) and any [Child Workflows](/encyclopedia/child-workflows) it generates. +The `temporal workflow trace` command tracks the progress of a [Workflow Execution](/workflows#workflow-execution) and any [Child Workflows](/child-workflows) it generates. Use the following options to change the command's behavior. diff --git a/docs/develop/dotnet/child-workflows.mdx b/docs/develop/dotnet/child-workflows.mdx index 0372db060e..feb6469f91 100644 --- a/docs/develop/dotnet/child-workflows.mdx +++ b/docs/develop/dotnet/child-workflows.mdx @@ -38,12 +38,12 @@ This page shows how to do the following: **How to start a Child Workflow Execution using the Temporal .NET SDK** -A [Child Workflow Execution](/encyclopedia/child-workflows) is a Workflow Execution that is scheduled from within another Workflow using a Child Workflow API. +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. 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](/encyclopedia/child-workflows#parent-close-policy) set in the Child Workflow Options. +After that, Child Workflow Executions may be abandoned using the _Abandon_ [Parent Close Policy](/parent-close-policy) set in the Child Workflow Options. 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. @@ -63,7 +63,7 @@ await Workflow.ExecuteChildWorkflowAsync((MyChildWorkflow wf) => wf.RunAsync()); **How to set a Parent Close Policy using the Temporal .NET SDK** -A [Parent Close Policy](/encyclopedia/child-workflows#parent-close-policy) determines what happens to a Child Workflow Execution if its Parent changes to a Closed status (Completed, Failed, or Timed Out). +A [Parent Close Policy](/parent-close-policy) determines what happens to a Child Workflow Execution if its Parent changes to a Closed status (Completed, Failed, or Timed Out). The default Parent Close Policy option is set to terminate the Child Workflow Execution. diff --git a/docs/develop/go/child-workflows.mdx b/docs/develop/go/child-workflows.mdx index ce4c824118..f6c4952d26 100644 --- a/docs/develop/go/child-workflows.mdx +++ b/docs/develop/go/child-workflows.mdx @@ -22,18 +22,18 @@ This page shows how to do the following: **How to start a Child Workflow Execution using the Go SDK.** -A [Child Workflow Execution](/encyclopedia/child-workflows) is a Workflow Execution that is scheduled from within another Workflow using a Child Workflow API. +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. 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](/encyclopedia/child-workflows#parent-close-policy) set in the Child Workflow Options. +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. -To spawn a [Child Workflow Execution](/encyclopedia/child-workflows) in Go, use the [`ExecuteChildWorkflow`](https://pkg.go.dev/go.temporal.io/sdk/workflow#ExecuteChildWorkflow) API, which is available from the `go.temporal.io/sdk/workflow` package. +To spawn a [Child Workflow Execution](/child-workflows) in Go, use the [`ExecuteChildWorkflow`](https://pkg.go.dev/go.temporal.io/sdk/workflow#ExecuteChildWorkflow) API, which is available from the `go.temporal.io/sdk/workflow` package. The `ExecuteChildWorkflow` call requires an instance of [`workflow.Context`](https://pkg.go.dev/go.temporal.io/sdk/workflow#Context), with an instance of [`workflow.ChildWorkflowOptions`](https://pkg.go.dev/go.temporal.io/sdk/workflow#ChildWorkflowOptions) applied to it, the Workflow Type, and any parameters that should be passed to the Child Workflow Execution. @@ -110,7 +110,7 @@ func YourOtherWorkflowDefinition(ctx workflow.Context, params ChildParams) (Chil **How to set a Parent Close Policy for a Child Workflow Execution using the Go SDK.** -A [Parent Close Policy](/encyclopedia/child-workflows#parent-close-policy) determines what happens to a Child Workflow Execution if its Parent changes to a Closed status (Completed, Failed, or Timed Out). +A [Parent Close Policy](/parent-close-policy) determines what happens to a Child Workflow Execution if its Parent changes to a Closed status (Completed, Failed, or Timed Out). The default Parent Close Policy option is set to terminate the Child Workflow Execution. diff --git a/docs/develop/go/observability.mdx b/docs/develop/go/observability.mdx index 7528b32295..37dc4723a3 100644 --- a/docs/develop/go/observability.mdx +++ b/docs/develop/go/observability.mdx @@ -161,7 +161,7 @@ Yes. Multiple context propagators help to structure code with each propagator ha - [Passing Context with Temporal](https://spiralscout.com/blog/passing-context-with-temporal) by SpiralScout The [Go SDK](https://github.com/temporalio/sdk-go) provides support for distributed tracing with **_Interceptors_**. -Interceptors uses Temporal headers to create a call graph of a [Workflow](/workflows), along with its [Activities](/activities) and [Child Workflows](/encyclopedia/child-workflows). +Interceptors uses Temporal headers to create a call graph of a [Workflow](/workflows), along with its [Activities](/activities) and [Child Workflows](/child-workflows). There are several tracing implementations supported by the Temporal Go SDK. For an [OpenTracing](https://pkg.go.dev/go.temporal.io/sdk/contrib/opentracing) Interceptor, use `opentracing.NewInterceptor(opentracing.TracerOptions{})` to create a `TracingInterceptor`. diff --git a/docs/develop/java/child-workflows.mdx b/docs/develop/java/child-workflows.mdx index c517cd4aef..a2eebdb94e 100644 --- a/docs/develop/java/child-workflows.mdx +++ b/docs/develop/java/child-workflows.mdx @@ -22,12 +22,12 @@ This page shows how to do the following: **How to start a Child Workflow Execution using the Java SDK.** -A [Child Workflow Execution](/encyclopedia/child-workflows) is a Workflow Execution that is scheduled from within another Workflow using a Child Workflow API. +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. 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](/encyclopedia/child-workflows#parent-close-policy) set in the Child Workflow Options. +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. @@ -150,11 +150,11 @@ Related reads: **How to set a Parent Close Policy for a Child Workflow using the Java SDK.** -A [Parent Close Policy](/encyclopedia/child-workflows#parent-close-policy) determines what happens to a Child Workflow Execution if its Parent changes to a Closed status (Completed, Failed, or Timed Out). +A [Parent Close Policy](/parent-close-policy) determines what happens to a Child Workflow Execution if its Parent changes to a Closed status (Completed, Failed, or Timed Out). The default Parent Close Policy option is set to terminate the Child Workflow Execution. -Set [Parent Close Policy](/encyclopedia/child-workflows#parent-close-policy) on an instance of `ChildWorkflowOptions` using [`ChildWorkflowOptions.newBuilder().setParentClosePolicy`](https://www.javadoc.io/doc/io.temporal/temporal-sdk/latest/io/temporal/workflow/ChildWorkflowOptions.Builder.html). +Set [Parent Close Policy](/parent-close-policy) on an instance of `ChildWorkflowOptions` using [`ChildWorkflowOptions.newBuilder().setParentClosePolicy`](https://www.javadoc.io/doc/io.temporal/temporal-sdk/latest/io/temporal/workflow/ChildWorkflowOptions.Builder.html). - Type: `ChildWorkflowOptions.Builder` - Default: `PARENT_CLOSE_POLICY_TERMINATE` diff --git a/docs/develop/php/child-workflows.mdx b/docs/develop/php/child-workflows.mdx index 4cb8e5b83d..7f76c79f94 100644 --- a/docs/develop/php/child-workflows.mdx +++ b/docs/develop/php/child-workflows.mdx @@ -16,12 +16,12 @@ description: Learn how to start a Child Workflow Execution within a parent Workf ## How to start a Child Workflow Execution {#child-workflows} -A [Child Workflow Execution](/encyclopedia/child-workflows) is a Workflow Execution that is scheduled from within another Workflow using a Child Workflow API. +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. 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](/encyclopedia/child-workflows#parent-close-policy) set in the Child Workflow Options. +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. @@ -83,11 +83,11 @@ $childResult = yield Workflow::executeChildWorkflow( #### How to set a Parent Close Policy {#parent-close-policy} -A [Parent Close Policy](/encyclopedia/child-workflows#parent-close-policy) determines what happens to a Child Workflow Execution if its Parent changes to a Closed status (Completed, Failed, or Timed Out). +A [Parent Close Policy](/parent-close-policy) determines what happens to a Child Workflow Execution if its Parent changes to a Closed status (Completed, Failed, or Timed Out). The default Parent Close Policy option is set to terminate the Child Workflow Execution. -In PHP, a [Parent Close Policy](/encyclopedia/child-workflows#parent-close-policy) is set via the `ChildWorkflowOptions` object and `withParentClosePolicy()` method. +In PHP, a [Parent Close Policy](/parent-close-policy) is set via the `ChildWorkflowOptions` object and `withParentClosePolicy()` method. The possible values can be obtained from the [`ParentClosePolicy`](https://github.com/temporalio/sdk-php/blob/master/src/Workflow/ParentClosePolicy.php) class. - `POLICY_TERMINATE` diff --git a/docs/develop/python/child-workflows.mdx b/docs/develop/python/child-workflows.mdx index b77d784994..259e8bbb9a 100644 --- a/docs/develop/python/child-workflows.mdx +++ b/docs/develop/python/child-workflows.mdx @@ -28,12 +28,12 @@ This page shows how to do the following: **How to start a Child Workflow Execution using the Temporal Python SDK.** -A [Child Workflow Execution](/encyclopedia/child-workflows) is a Workflow Execution that is scheduled from within another Workflow using a Child Workflow API. +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. 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](/encyclopedia/child-workflows#parent-close-policy) set in the Child Workflow Options. +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. @@ -81,7 +81,7 @@ class GreetingWorkflow: **How to set a Parent Close Policy** -A [Parent Close Policy](/encyclopedia/child-workflows#parent-close-policy) determines what happens to a Child Workflow Execution if its Parent changes to a Closed status (Completed, Failed, or Timed Out). +A [Parent Close Policy](/parent-close-policy) determines what happens to a Child Workflow Execution if its Parent changes to a Closed status (Completed, Failed, or Timed Out). The default Parent Close Policy option is set to terminate the Child Workflow Execution. diff --git a/docs/develop/typescript/child-workflows.mdx b/docs/develop/typescript/child-workflows.mdx index 1cfa6ad198..59d5a6b54a 100644 --- a/docs/develop/typescript/child-workflows.mdx +++ b/docs/develop/typescript/child-workflows.mdx @@ -16,12 +16,12 @@ description: Learn how to start and manage Child Workflow Executions using Tempo ## How to start a Child Workflow Execution {#child-workflows} -A [Child Workflow Execution](/encyclopedia/child-workflows) is a Workflow Execution that is scheduled from within another Workflow using a Child Workflow API. +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. 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](/encyclopedia/child-workflows#parent-close-policy) set in the Child Workflow Options. +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. @@ -99,7 +99,7 @@ A Child Workflow Execution is automatically cancelled when its containing scope ### How to set a Parent Close Policy {#parent-close-policy} -A [Parent Close Policy](/encyclopedia/child-workflows#parent-close-policy) determines what happens to a Child Workflow Execution if its Parent changes to a Closed status (Completed, Failed, or Timed Out). +A [Parent Close Policy](/parent-close-policy) determines what happens to a Child Workflow Execution if its Parent changes to a Closed status (Completed, Failed, or Timed Out). The default Parent Close Policy option is set to terminate the Child Workflow Execution. diff --git a/docs/encyclopedia/child-workflows.mdx b/docs/encyclopedia/child-workflows/child-workflows.mdx similarity index 76% rename from docs/encyclopedia/child-workflows.mdx rename to docs/encyclopedia/child-workflows/child-workflows.mdx index 0dff993094..1f732977c4 100644 --- a/docs/encyclopedia/child-workflows.mdx +++ b/docs/encyclopedia/child-workflows/child-workflows.mdx @@ -2,7 +2,8 @@ id: child-workflows title: Child Workflows sidebar_label: Child Workflows -description: A Child Workflow Execution in the Temporal platform is initiated from another Workflow within the same Namespace. Learn about the feature guides for Go, Java, PHP, Python, TypeScript, and .NET SDKs. Understand the Parent-Child Workflow relationship, including when to use Child Workflows, Parent Close Policies +description: A Child Workflow Execution in the Temporal platform is initiated from another Workflow within the same Namespace. Learn about the feature guides for Go, Java, PHP, Python, TypeScript, and .NET SDKs. +slug: /child-workflows toc_max_heading_level: 4 keywords: - child workflow execution @@ -51,7 +52,7 @@ A Workflow Execution can be both a Parent and a Child Workflow Execution because A Parent Workflow Execution must await on the Child Workflow Execution to spawn. The Parent can optionally await on the result of the Child Workflow Execution. -Consider the Child's [Parent Close Policy](#parent-close-policy) if the Parent does not await on the result of the Child, which includes any use of Continue-As-New by the Parent. +Consider the Child's [Parent Close Policy](/parent-close-policy) if the Parent does not await on the result of the Child, which includes any use of Continue-As-New by the Parent. :::note @@ -60,7 +61,7 @@ This means that if a Parent Workflow Execution utilizes Continue-As-New, any ong ::: -When a Parent Workflow Execution reaches a Closed status, the Temporal Service propagates Cancellation Requests or Terminations to Child Workflow Executions depending on the Child's [Parent Close Policy](#parent-close-policy). +When a Parent Workflow Execution reaches a Closed status, the Temporal Service propagates Cancellation Requests or Terminations to Child Workflow Executions depending on the Child's [Parent Close Policy](/parent-close-policy). If a Child Workflow Execution uses Continue-As-New, from the Parent Workflow Execution's perspective the entire chain of Runs is treated as a single execution. @@ -128,7 +129,7 @@ Here are some important differences: - A Child Workflow has access to all Workflow APIs but is subject to the same [deterministic constraints](/workflows#deterministic-constraints) as other Workflows. An Activity has the inverse pros and cons—no access to Workflow APIs but no Workflow constraints. -- A Child Workflow Execution can continue on if its Parent is canceled with a [Parent Close Policy](#parent-close-policy) of `ABANDON`. +- A Child Workflow Execution can continue on if its Parent is canceled with a [Parent Close Policy](/parent-close-policy) of `ABANDON`. An Activity Execution is _always_ canceled when its Workflow Execution is canceled. (It can react to a cancellation Signal for cleanup.) The decision is roughly analogous to spawning a child process in a terminal to do work versus doing work in the same process. @@ -140,42 +141,3 @@ An Activity usually models a single operation on the external world. Our advice: **When in doubt, use an Activity.** -## Parent Close Policy {#parent-close-policy} - -**What is a Parent Close Policy?** - -A Parent Close Policy determines what happens to a Child Workflow Execution if its Parent changes to a Closed status (Completed, Failed, or Timed out). - -- [How to set a Parent Close Policy using the Go SDK](/develop/go/child-workflows#parent-close-policy) -- [How to set a Parent Close Policy using the Java SDK](/develop/java/child-workflows#parent-close-policy) -- [How to set a Parent Close Policy using the PHP SDK](/develop/php/child-workflows#parent-close-policy) -- [How to set a Parent Close Policy using the Python SDK](/develop/python/child-workflows#parent-close-policy) -- [How to set a Parent Close Policy using the TypeScript SDK](/develop/typescript/child-workflows#parent-close-policy) -- [How to set a Parent Close Policy using the .NET SDK](/develop/dotnet/child-workflows#parent-close-policy) - -There are three possible values: - -- **Abandon:** the Child Workflow Execution is not affected. -- **Request Cancel:** a Cancellation request is sent to the Child Workflow Execution. -- **Terminate** (default): the Child Workflow Execution is forcefully Terminated. - -[`ParentClosePolicy`](https://github.com/temporalio/api/blob/c1f04d0856a3ba2995e92717607f83536b5a44f5/temporal/api/enums/v1/workflow.proto#L44) proto definition. - -Each Child Workflow Execution may have its own Parent Close Policy. -This policy applies only to Child Workflow Executions and has no effect otherwise. - -
-
-

Parent Close Policy entity relationship

-
-
- Parent Close Policy entity relationship -
-
- -You can set policies per child, which means you can opt out of propagating terminates / cancels on a per-child basis. -This is useful for starting Child Workflows asynchronously (see [relevant issue here](https://community.temporal.io/t/best-way-to-create-an-async-child-workflow/114) or the corresponding SDK docs). diff --git a/docs/encyclopedia/child-workflows/parent-close-policy.mdx b/docs/encyclopedia/child-workflows/parent-close-policy.mdx new file mode 100644 index 0000000000..24820b4373 --- /dev/null +++ b/docs/encyclopedia/child-workflows/parent-close-policy.mdx @@ -0,0 +1,69 @@ +--- +id: parent-close-policy +title: Parent Close Policy +sidebar_label: Parent Close Policy +description: Understand the Parent-Child Workflow relationship, including when to use Child Workflows and Parent Close Policies. +slug: /parent-close-policy +toc_max_heading_level: 4 +keywords: + - child workflow execution + - temporal workflow management + - parent close policy + - workflow execution scalability + - temporal SDK child workflow + - manage workflows with temporal + - workflow partitioning + - asynchronous child workflows + - child workflow serialization + - temporal namespace workflows + - child vs activity execution + - workflow periodic execution + - temporal SDK guides + - parent workflow termination + - child workflow best practices +tags: + - Concepts + - Child Workflows + - Parent Close Policy +--- + +This page discusses [Parent Close Policy](#parent-close-policy). + +## What is a Parent Close Policy? {#parent-close-policy} + +A Parent Close Policy determines what happens to a Child Workflow Execution if its Parent changes to a Closed status (Completed, Failed, or Timed out). + +- [How to set a Parent Close Policy using the Go SDK](/develop/go/child-workflows#parent-close-policy) +- [How to set a Parent Close Policy using the Java SDK](/develop/java/child-workflows#parent-close-policy) +- [How to set a Parent Close Policy using the PHP SDK](/develop/php/child-workflows#parent-close-policy) +- [How to set a Parent Close Policy using the Python SDK](/develop/python/child-workflows#parent-close-policy) +- [How to set a Parent Close Policy using the TypeScript SDK](/develop/typescript/child-workflows#parent-close-policy) +- [How to set a Parent Close Policy using the .NET SDK](/develop/dotnet/child-workflows#parent-close-policy) + +There are three possible values: + +- **Abandon:** the Child Workflow Execution is not affected. +- **Request Cancel:** a Cancellation request is sent to the Child Workflow Execution. +- **Terminate** (default): the Child Workflow Execution is forcefully Terminated. + +[`ParentClosePolicy`](https://github.com/temporalio/api/blob/c1f04d0856a3ba2995e92717607f83536b5a44f5/temporal/api/enums/v1/workflow.proto#L44) proto definition. + +Each Child Workflow Execution may have its own Parent Close Policy. +This policy applies only to Child Workflow Executions and has no effect otherwise. + +
+
+

Parent Close Policy entity relationship

+
+
+ Parent Close Policy entity relationship +
+
+ +You can set policies per child, which means you can opt out of propagating terminates / cancels on a per-child basis. +This is useful for starting Child Workflows asynchronously (see [relevant issue here](https://community.temporal.io/t/best-way-to-create-an-async-child-workflow/114) or the corresponding SDK docs). + diff --git a/docs/encyclopedia/workflows.mdx b/docs/encyclopedia/workflows.mdx index 4bb647ca1f..53d838f1be 100644 --- a/docs/encyclopedia/workflows.mdx +++ b/docs/encyclopedia/workflows.mdx @@ -348,7 +348,7 @@ Awaitables are provided when using APIs for the following: - Awaiting: Progress can block using explicit "Await" APIs. - Requesting cancellation of another Workflow Execution: Progress can block on confirmation that the other Workflow Execution is cancelled. - Sending a [Signal](/encyclopedia/workflow-message-passing#sending-signals): Progress can block on confirmation that the Signal sent. -- Spawning a [Child Workflow Execution](/encyclopedia/child-workflows): Progress can block on confirmation that the Child Workflow Execution started, and on the result of the Child Workflow Execution. +- Spawning a [Child Workflow Execution](/child-workflows): Progress can block on confirmation that the Child Workflow Execution started, and on the result of the Child Workflow Execution. - Spawning an [Activity Execution](/activities#activity-execution): Progress can block on the result of the Activity Execution. - Starting a Timer: Progress can block until the Timer fires. diff --git a/docs/evaluate/development-production-features/throughput-composability.mdx b/docs/evaluate/development-production-features/throughput-composability.mdx index 90ed6489f9..ae09da125c 100644 --- a/docs/evaluate/development-production-features/throughput-composability.mdx +++ b/docs/evaluate/development-production-features/throughput-composability.mdx @@ -40,4 +40,4 @@ See the SDK feature guides for implementation details: -For a deep dive into Child Workflows see the [Child Workflows Encyclopedia page](/encyclopedia/child-workflows). +For a deep dive into Child Workflows see the [Child Workflows Encyclopedia page](/child-workflows). diff --git a/docs/evaluate/temporal-cloud/legacy-pricing.mdx b/docs/evaluate/temporal-cloud/legacy-pricing.mdx index 52be94c2e2..e7eef8a14b 100644 --- a/docs/evaluate/temporal-cloud/legacy-pricing.mdx +++ b/docs/evaluate/temporal-cloud/legacy-pricing.mdx @@ -60,7 +60,7 @@ They track billable operations within the Temporal Cloud Service, such as starti **WORKFLOWS** - **Workflow started**. - Occurs via client start, client [Signal-With-Start](/encyclopedia/workflow-message-passing#signal-with-start), [Continue-As-New](/workflows#continue-as-new), or [Child Workflow](/encyclopedia/child-workflows) start. + Occurs via client start, client [Signal-With-Start](/encyclopedia/workflow-message-passing#signal-with-start), [Continue-As-New](/workflows#continue-as-new), or [Child Workflow](/child-workflows) start. If a Workflow start fails, an Action is not recorded. - **Workflow reset**. Occurs when a [Workflow](/workflows) is reset. diff --git a/docs/evaluate/temporal-cloud/pricing.mdx b/docs/evaluate/temporal-cloud/pricing.mdx index 3fb1908e93..a065edc553 100644 --- a/docs/evaluate/temporal-cloud/pricing.mdx +++ b/docs/evaluate/temporal-cloud/pricing.mdx @@ -82,7 +82,7 @@ They track billable operations within the Temporal Cloud Service, such as starti **WORKFLOWS** - **Workflow started**. - Occurs via client start, client [Signal-With-Start](/encyclopedia/workflow-message-passing#signal-with-start), [Continue-As-New](/workflows#continue-as-new), or [Child Workflow](/encyclopedia/child-workflows) start. + Occurs via client start, client [Signal-With-Start](/encyclopedia/workflow-message-passing#signal-with-start), [Continue-As-New](/workflows#continue-as-new), or [Child Workflow](/child-workflows) start. If a Workflow start fails, an Action is not recorded. - **Workflow reset**. Occurs when a [Workflow](/workflows) is reset. diff --git a/docs/glossary.md b/docs/glossary.md index 711caa0bd2..390088570f 100644 --- a/docs/glossary.md +++ b/docs/glossary.md @@ -101,7 +101,7 @@ The `Authorizer` plugin contains a single `Authorize` method, which is invoked f -#### [Child Workflow](/encyclopedia/child-workflows) +#### [Child Workflow](/child-workflows) A Child Workflow Execution is a Workflow Execution that is spawned from within another Workflow. @@ -381,7 +381,7 @@ A common code package, schema, or documentation that a Caller can use to obtain -#### [Parent Close Policy](/encyclopedia/child-workflows#parent-close-policy) +#### [Parent Close Policy](/parent-close-policy) If a Workflow Execution is a Child Workflow Execution, a Parent Close Policy determines what happens to the Workflow Execution if its Parent Workflow Execution changes to a Closed status (Completed, Failed, Timed out). diff --git a/docs/production-deployment/cloud/account-setup/namespaces.mdx b/docs/production-deployment/cloud/account-setup/namespaces.mdx index 43a086b4f8..b26ab9ce47 100644 --- a/docs/production-deployment/cloud/account-setup/namespaces.mdx +++ b/docs/production-deployment/cloud/account-setup/namespaces.mdx @@ -289,7 +289,7 @@ Sample naming convention: #### Example 3: Namespace per use case, domain, and environment -We recommend using one namespace per use case, domain, and environment combination when multiple services that are part of the same use case need to communicate with each another via [Signals](/encyclopedia/workflow-message-passing#sending-signals) or by starting [Child Workflows](/encyclopedia/child-workflows). +We recommend using one namespace per use case, domain, and environment combination when multiple services that are part of the same use case need to communicate with each another via [Signals](/encyclopedia/workflow-message-passing#sending-signals) or by starting [Child Workflows](/child-workflows). In this case, though, you must be mindful about Workflow Id uniqueness by prefixing each Workflow Id with a service-specific string. The name of each Task Queue must also be unique. If multiple teams are involved, the domain could also represent a team boundary. diff --git a/docs/production-deployment/data-encryption.mdx b/docs/production-deployment/data-encryption.mdx index 0ce1f3cfb1..05fb2e106c 100644 --- a/docs/production-deployment/data-encryption.mdx +++ b/docs/production-deployment/data-encryption.mdx @@ -23,7 +23,7 @@ Encrypting this data ensures that any sensitive application data is secure when For example, if you have sensitive information passed in the following objects that are persisted in the Workflow Execution Event History, use encryption to secure it: -- Inputs and outputs/results in your [Workflow](/workflows#workflow-execution), [Activity](/activities#activity-execution), and [Child Workflow](/encyclopedia/child-workflows) +- Inputs and outputs/results in your [Workflow](/workflows#workflow-execution), [Activity](/activities#activity-execution), and [Child Workflow](/child-workflows) - [Signal](/encyclopedia/workflow-message-passing#sending-signals) inputs - [Memo](/workflows#memo) - Headers (verify if applicable to your SDK) diff --git a/docs/references/commands.mdx b/docs/references/commands.mdx index b9fb9ee62d..de570ef617 100644 --- a/docs/references/commands.mdx +++ b/docs/references/commands.mdx @@ -48,7 +48,7 @@ The Corresponding Event for this Command is one of the few Events that will be t ### StartChildWorkflowExecution -This Command is triggered by a call to spawn a [Child Workflow Execution](/encyclopedia/child-workflows). +This Command is triggered by a call to spawn a [Child Workflow Execution](/child-workflows). - Awaitable: Yes, a Workflow Execution can await on the action resulting from this Command. - Corresponding Event: [ChildWorkflowExecutionStarted](/references/events#childworkflowexecutionstarted) diff --git a/docs/references/errors.mdx b/docs/references/errors.mdx index 5996cfbf52..0afa71ff3a 100644 --- a/docs/references/errors.mdx +++ b/docs/references/errors.mdx @@ -88,7 +88,7 @@ Unset or invalid attributes can cause this to occur. Reset any missing attributes, such as Workflow Id or Run Id. Adjust any fields that exceed length limits. -If [Child Workflow](/encyclopedia/child-workflows) is set to `Start` and `RequestCancel`, remove one of these attributes. +If [Child Workflow](/child-workflows) is set to `Start` and `RequestCancel`, remove one of these attributes. A Child Workflow cannot perform both actions in the same Workflow Task. ## Bad Schedule Activity Attributes {#bad-schedule-activity-attributes} @@ -207,7 +207,7 @@ Let the Workflow complete any current Activities before redeploying the code. ## Pending Child Workflows Limit Exceeded {#pending-child-workflows-limit-exceeded} -This error indicates that the [Workflow](/workflows) has reached capacity for pending [Child Workflows](/encyclopedia/child-workflows). +This error indicates that the [Workflow](/workflows) has reached capacity for pending [Child Workflows](/child-workflows). Therefore, the [Workflow Task](/tasks#workflow-task) was failed to prevent additional Child Workflows from being added. Wait for the system to finish any currently running Child Workflows before redeploying this Task. diff --git a/docs/references/events.mdx b/docs/references/events.mdx index ef75dc069c..cb96fbb85e 100644 --- a/docs/references/events.mdx +++ b/docs/references/events.mdx @@ -411,7 +411,7 @@ This [Event](/workflows#event) type indicates that the [Temporal Server](/cluste ### StartChildWorkflowExecutionFailed -This [Event](/workflows#event) type indicates a [Child Workflow Execution](/encyclopedia/child-workflows) cannot be started / triggered. +This [Event](/workflows#event) type indicates a [Child Workflow Execution](/child-workflows) cannot be started / triggered. It is usually due to a Child Workflow Id collision. | Field | Description | @@ -424,7 +424,7 @@ It is usually due to a Child Workflow Id collision. ### ChildWorkflowExecutionStarted -This [Event](/workflows#event) type indicates a [Child Workflow Execution](/encyclopedia/child-workflows) has successfully started / triggered. +This [Event](/workflows#event) type indicates a [Child Workflow Execution](/child-workflows) has successfully started / triggered. This would also cause the [WorkflowExecutionStarted](#workflowexecutionstarted) to be recorded for the Workflow that has started. | Field | Description | @@ -437,7 +437,7 @@ This would also cause the [WorkflowExecutionStarted](#workflowexecutionstarted) ### ChildWorkflowExecutionCompleted -This [Event](/workflows#event) type indicates that the [Child Workflow Execution](/encyclopedia/child-workflows) has successfully completed. +This [Event](/workflows#event) type indicates that the [Child Workflow Execution](/child-workflows) has successfully completed. This would also cause the [WorkflowExecutionCompleted](#workflowexecutioncompleted) to be recorded for the [Workflow](/workflows) that has completed. | Field | Description | @@ -451,7 +451,7 @@ This would also cause the [WorkflowExecutionCompleted](#workflowexecutioncomplet ### ChildWorkflowExecutionFailed -This [Event](/workflows#event) type indicates that the [Child Workflow Execution](/encyclopedia/child-workflows) has unsuccessfully completed. +This [Event](/workflows#event) type indicates that the [Child Workflow Execution](/child-workflows) has unsuccessfully completed. This would also cause the [WorkflowExecutionFailed](#workflowexecutionfailed) to be recorded for the Workflow that has failed. | Field | Description | @@ -480,7 +480,7 @@ This would also cause the [WorkflowExecutionCanceled](#workflowexecutioncanceled ### ChildWorkflowExecutionTimedOut -This Event type indicates that the [Child Workflow Execution](/encyclopedia/child-workflows) has timed out by the [Temporal Server](/clusters#temporal-server). +This Event type indicates that the [Child Workflow Execution](/child-workflows) has timed out by the [Temporal Server](/clusters#temporal-server). This would also cause the [WorkflowExecutionTimeOut](#workflowexecutiontimedout) to be recorded for the Workflow that timed out. | Field | Description | diff --git a/sidebars.js b/sidebars.js index bcdc27fce5..eab238c45c 100644 --- a/sidebars.js +++ b/sidebars.js @@ -534,7 +534,18 @@ module.exports = { ], }, "encyclopedia/workflow-message-passing", - "encyclopedia/child-workflows", + { + type: "category", + label: "Child Workflows", + collapsed: true, + link: { + type: "doc", + id: "encyclopedia/child-workflows/child-workflows", + }, + items: [ + "encyclopedia/child-workflows/parent-close-policy", + ], + }, "encyclopedia/visibility", "encyclopedia/clusters", { diff --git a/vercel.json b/vercel.json index fa80dc7ca1..f116790910 100644 --- a/vercel.json +++ b/vercel.json @@ -1166,7 +1166,7 @@ }, { "source": "/concepts/what-is-a-child-workflow-execution", - "destination": "/workflows#child-workflow" + "destination": "/child-workflows" }, { "source": "/concepts/what-is-a-command", @@ -1218,7 +1218,7 @@ }, { "source": "/concepts/what-is-a-parent-close-policy", - "destination": "/workflows#parent-close-policy" + "destination": "/parent-close-policy" }, { "source": "/concepts/what-is-a-query",