Skip to content

Composing Flows

A flow can invoke another flow. Declare the child as a - flow/<name> entry in using:, then invoke it by its bare alias — same typed input, same typed output, same logging.

Terminal window
using:
- flow/monthly-report
output:
summary: !str
steps:
- $report:
invoke: monthly-report
with:
month: "2026-05"
region: "EU"
- return:
summary: "${report.summary}"
  • The called flow gets its own run ID and its own log stream.
  • The calling flow blocks until the child terminates — a sub-flow run is always synchronous; the default wait is 5 minutes, overridable per step with timeout:.
  • The result is a normal payload value — ${report.<output-field>} — typed by the called flow’s output: contract. A named step ($report:) merges that output into the parent payload; a bare unnamed - invoke: monthly-report runs the child but drops its output.
PatternHow
Shared sub-pipelinesFactor a common sequence (e.g. “normalise and validate a customer record”) into its own flow and call it from several places.
Fan-outWrap the sub-flow invoke: in a for-each: do: to run the same sub-flow once per item.
Retries with different parametersCall the same flow twice with different with: values — e.g. a primary region then a fallback.

Because the called flow has a typed output: contract just like any other, the composition is checked the same way a single flow is — references into ${report.…} are validated at compile time.