Factor a Large Workflow v2
Extract a Sub-Workflow when part of a design has a clear contract and a reason to change, test, reuse, or operate independently.
Good extraction boundaries
Look for a sequence that has one or more of these characteristics:
- It repeats in multiple Workflows.
- It represents a stable domain action, such as validating an order or synchronizing one customer.
- It has a small, explicit set of inputs and outputs.
- It can be tested without understanding the caller's entire Canvas.
- It needs different ownership, release review, or Cluster placement.
- It isolates error handling or a provider-specific integration from the main flow.
Do not extract a sequence merely to reduce the visible Step count. Many tiny Sub-Workflows can hide execution order, increase navigation, and make contracts harder to evolve.
Define the contract first
- List the data the sequence actually reads.
- Define narrowly typed child Parameters for that data.
- Define Returns for the result and any error or status information the caller must handle.
- Avoid passing a large parent object when the child needs only a few fields.
- Decide whether an Array or Stream must remain deferred across the boundary.
Extract and reconnect
- Create the child Workflow and add its Parameters and Returns.
- Move or recreate the selected Steps inside the child, preserving container scope and execution order.
- Add a Sub-Workflow Step to the parent.
- Map parent values to the child Parameters and child Returns to the downstream consumer.
- Configure or reuse the child Connections in each Environment.
- Select a compatible Cluster for the child. A Sub-Workflow runs on its own configured Cluster; it does not inherit Step-level placement from the parent.
Verify lifecycle behaviour
Debug the child first, then the parent. Inspect the linked parent and child logs and test error propagation. Save and publish both Workflows, and enable the child in every Environment where the parent can call it.
Contract changes are dependency changes. Refresh the Sub-Workflow Step in callers, review the merge, test affected mappings, and promote the child and parent in a coordinated order.
See also
See Call a Sub-Workflow, Refresh Sub-Workflow Properties, and Design a Maintainable Workflow.