Skip to content

Composing Flows

A flow can invoke another flow. The flow.invoke operator treats a flow as a callable verb — same typed input, same typed output, same logging.

using:
- zenvara/flow
steps:
- $report:
invoke: flow.invoke
with:
Flow: monthly-report
Parameters:
month: "2026-05"
region: "EU"
  • The called flow gets its own invocation ID and its own log stream.
  • The calling flow waits synchronously for the result by default; async fire-and-forget is opt-in.
  • The result is a normal payload value — ${report.<output-field>} — typed by the called flow’s output: contract.
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 flow.invoke in a for-each: to run the same sub-flow once per item.
Retries with different parametersCall the same flow twice with different Parameters: — 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.