Skip to content

Sub-workflow

A Sub-workflow step starts another published workflow as a child run. Build a process once, such as KYC or address verification, and reuse it from many workflows. The step can wait for the child to finish and store its outcome and output, or start it and move on.

  • A shared KYC workflow used by your account opening, loan and card workflows.
  • A standard “send documents and wait for upload” process reused across products.
  • Starting a follow-up workflow that should run on its own while this one ends.
  • The steps are only used in one workflow. Keep them in that workflow.
  • You need to undo work after a failure. Use the compensate action of an Error handler.
Setting What it does
Workflow Required. The workflow to run. It must be published and cannot be this workflow.
Version Empty runs the latest published version.
Inputs What the sub-workflow receives, as name and expression pairs. Empty passes this run’s input and data.
Wait for it wait (default) or fire_and_forget.
Store result as Saves the sub-workflow’s outcome and the output of its End step under data.<name>.
  • A single Next, and an error path taken when the child run fails or cannot start.
  • steps.<step id>, and data.<name> when Store result as is set:
    • With Wait: runId, outcome and result of the child run, plus each field of its End step’s Output.
    • With Fire and forget: runId and started: true.

A child that finishes through an End step set to failed is not an error here: the step continues on Next and result is failed. Branch on it with a Condition.

A bank reuses its KYC workflow from the loan workflow.

API / webhook → Sub-workflow (KYC, store as kyc) → Condition (data.kyc.outcome == 'verified')
true → Approval → End
false → Send message (KYC failed) → End

data.kyc:

{ "runId": "run_8f1c…", "outcome": "verified", "result": "success", "kycLevel": "full" }