Sub-workflows
Build large automations from smaller, reusable workflows. A Sub-Workflow node runs another workflow as one step. The Chain node manages workflows from inside a workflow. Both sit in the palette under Flow Control.
Sub-Workflow
What: Runs another workflow, waits for it to finish, and returns its result.


Ports: in input; out output, error.
Configuration:
| Field | Notes |
|---|---|
workflowId |
Required. A saved workflow in your workspace. |
inputMapping |
{childField: source}. Narrow or rename what the child receives. Empty: the child gets everything that arrived at this node. |
outputMapping |
{parentField: source}. Shape what comes back. |
maxDepth |
Maximum nesting depth, to stop runaway recursion. Default 10. |
passIncomingItems |
Send every incoming item to the child, not only the merged data. Default off. |
mapOutputsFromChild |
Resolve outputMapping against the child's nodes, for example {{ $node["Inner"].output }}, and add the mapped fields to the child's result. Default off. |
In the child workflow, read what the parent sent with {{ $trigger.<field> }}.
Mapping values are either a field name on the source data or a literal value. An expression such as {{ $input.customerId }} is resolved before the node runs and is used as the value.
Example: The parent workflow calls the sub-workflow and uses its result:
The sub-workflow ("Enrich contact") reads what it was given from $trigger:
Look up company calls your enrichment API with {{ $trigger.email }}, and Shape result returns { email, company, role }.
Use when:
- Reusing logic ("enrich a contact") in several parent workflows.
- Breaking a 50-node workflow into parts people can read.
- Recursion, with care.
maxDepthstops it.
Tips:
- A failure in the child goes to the node's
errorport, or follows the node's error mode.
Convert a selection to a sub-workflow
You can turn part of an existing workflow into a sub-workflow without rebuilding it:
- Select the nodes on the canvas.
- Right-click and choose Convert selection to sub-workflow.
- Name the new workflow and confirm.
Flero moves the nodes into a new workflow and puts a Sub-Workflow node in their place, wired so that it behaves exactly like the nodes it replaces. The current workflow is saved when you convert.
- Triggers stay in the parent workflow.
- An AI Agent moves together with its tools and guards.
- The selection must have a single exit. If it can't be extracted safely, the dialog lists what to change.
See Convert to sub-workflow for the full walkthrough.


Chain
What: Manages Flero workflows from inside a workflow: create, update, run, stop, delete, list, get, clone, export, import, validate and analyse. Its palette tagline is "Run subagents".
Ports: in input; out output.
Configuration: operation (required: create, update, execute, stop, delete, list_workflows, get, clone, export, import, validate, analyze), plus the fields that operation needs.
To run one fixed workflow as a step, Sub-Workflow is simpler.
Tips & gotchas
- Keep child inputs explicit. An
inputMappingdocuments what the child needs, and stops unrelated fields leaking in. - Recursion has a ceiling. A sub-workflow that calls itself stops at
maxDepth. - The child must be saved.
workflowIdhas to point to a real, saved workflow.
Related
- Templates, pre-built workflows you can reuse as sub-workflows
- Flow control
- Running a workflow
Found something out of date? This page lives in the Flero docs content set.