Skip to main content

Child Workflows

note

Replace the placeholder prompt below with the version your team has validated. Add example output, tips, and any org-specific context (namespace, SDK language, coding standards).

Prompt​

Refactor the following Temporal workflow in [Python/Go/TypeScript/Java] to use child workflows.

[Reference the workflow class to refactor, e.g., src/workflows/order_workflow.py β€” OrderWorkflow]

Refactoring goals:
- Identify logical sub-processes that would benefit from independent execution history
- Extract them as child workflows with appropriate parent-close policies
- Ensure cancellation propagates correctly from parent to children
- Preserve error handling β€” child workflow failures should bubble up appropriately
- Add comments explaining why each sub-process was made a child workflow

Example output​

Add an example of what good output looks like for your team's use cases.

Using the Temporal Developer Skill​

Activate the Temporal Developer Skill in your AI coding assistant before running this prompt. With the skill active, your assistant understands parent-close policies, cancellation scopes, and history limits out of the box β€” so the prompt can stay focused on your specific refactoring goals rather than teaching the framework.

Tips​

  • Consider ABANDON parent-close policy for child workflows that should complete independently.
  • Child workflows have their own history limits β€” use them for long-running sub-processes.