Output Mapping
How the child workflow's final node output is mapped back to the parent's execution memory — the outputMap schema and how the parent accesses the result.
How outputMap Works
When the child workflow completes in sync mode, the engine captures the child's final node output (the last node that ran before the workflow ended). The outputMap extracts fields from this output and places them into the SubWorkflow node's output object, which becomes accessible via $output.{subWorkflowNodeId} in the parent.
outputMap Schema
{
"outputMap": {
"decision": "$.approvalResult.decision",
"approverName": "$.approvalResult.approverName",
"approvedAt": "$.approvalResult.timestamp",
"rejectionReason":"$.approvalResult.rejectionReason ?? null"
}
}
In the outputMap:
- Key = the field name on the SubWorkflow node's output (accessible in parent as
$output.mySubFlow.decision) - Value = expression using
$.to reference the child's final output (evaluated in the child's context)
The $ Prefix in Output Expressions
The $. prefix refers to the child's final output object (a shorthand for the last executed node's output dictionary). For example, if the child's last node was approvalResult:
// Child's final output (the last node named "approvalResult"):
{
decision: "approved",
approverName: "Bob Smith",
timestamp: "2026-05-25T14:30:00Z"
}
// outputMap expressions access this via:
"$.approvalResult.decision" // → "approved"
"$.approvalResult.approverName" // → "Bob Smith"
Parent Access
In the parent workflow, after the SubWorkflow node completes, the mapped values are accessible as if they were the SubWorkflow node's own output:
// SubWorkflow node id = "runApproval"
$output.runApproval.decision // → "approved"
$output.runApproval.approverName // → "Bob Smith"
$output.runApproval.approvedAt // → "2026-05-25T14:30:00Z"
No outputMap (Full Child Output)
If you omit outputMap, the entire child final output object is returned as-is as the SubWorkflow node's output. This is convenient for simple cases but leaks child-internal node IDs into the parent:
// Without outputMap — parent receives the raw child output object
$output.runApproval // → { approvalResult: { decision: "approved", ... } }