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.
When to use it
Section titled “When to use it”- 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.
When not to use it
Section titled “When not to use it”- 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.
Settings
Section titled “Settings”| 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>. |
What it produces
Section titled “What it produces”- A single Next, and an error path taken when the child run fails or cannot start.
steps.<step id>, anddata.<name>when Store result as is set:- With Wait:
runId,outcomeandresultof the child run, plus each field of its End step’s Output. - With Fire and forget:
runIdandstarted: true.
- With Wait:
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.
Example
Section titled “Example”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) → Enddata.kyc:
{ "runId": "run_8f1c…", "outcome": "verified", "result": "success", "kycLevel": "full" }