Portal Community

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:

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", ... } }
Explicit mapping preferred: Always use explicit outputMap in production workflows. It decouples the parent from the child's internal node ID structure and makes the contract explicit.