In this article
Confirm the child started and choose its closure policy explicitly when the parent will finish before the child’s result is available.
Decide what independence the child needs
A coordinator launches a longer research job and intends to finish its own setup step. Temporal’s child-workflow guide gives the child its own execution and history, but that does not imply automatic survival after parent closure. Define whether the child should remain active, receive cancellation or stop forcefully. This lifecycle decision is separate from merely organizing code into smaller functions.
Wait for the child-start event
The Python child-workflow guide requires the child-start event to be recorded before the parent completes. Awaiting the start helper confirms that stage; the execute helper also waits for the child’s result. Choose the helper according to whether the parent needs a running handle or completed work. Calling an asynchronous start path without waiting for it can let the parent leave before the child is durably started.
Choose the parent-close behavior
The Parent Close Policy reference documents Abandon, Request Cancel and default Terminate. Abandon leaves the child unaffected by closure. Request Cancel sends a cancellation request, while Terminate forcefully stops the child. These outcomes have different implications for cleanup and unfinished external work. A cancellation request is not itself proof that every outside action was undone, so inspect the child’s actual outcome when recovery depends on it.
Account for a parent continuing as new
The concept guide says ongoing children do not carry over as child executions of a parent’s new continued instance. Consider the close policy before making that transition. A child that itself continues as new is viewed by the parent as a chain, which is another distinct situation. Record the parent and child identities so an operator can tell which relationship the lifecycle controls, rather than assuming every logical continuation preserves the same ownership tree.
Test closure separately from child success
Use a harmless child that waits for a controlled event, confirm its start, close the parent and observe the chosen policy. Then inspect what remains active and what result can be retrieved. Task contracts state the authorized lifetime; tool observations distinguish start, closure and completion. A dependable handoff records both the child’s creation evidence and its intended fate after the coordinator stops.
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.