Sub-Workflow
Invoke a child workflow as a synchronous step — the parent waits for the child to complete before continuing.
The Sub-Workflow node calls another BizFirst workflow (the "child") inline, synchronously. The parent workflow pauses until the child workflow completes, then resumes on the success or error port. All outputs and variables produced by the child are available to the parent prefixed with subworkflow. — enabling rich data exchange between parent and child.
Key Capabilities
- Synchronous execution — the parent pauses and waits for the child to finish
- Pass input data to the child workflow via
input_data - Parent variables (
parent.output.*andparent.var.*) are available inside the child workflow - Child outputs and variables returned to parent prefixed with
subworkflow.* - Version pinning — invoke a specific version of the child workflow
- Recursion protection — maximum 10 nesting levels; thread-safe depth tracking prevents infinite loops
- Child workflow errors propagate to the parent's error port
BizFirst enforces a maximum of 10 sub-workflow nesting levels. A workflow that calls itself (directly or indirectly) will be terminated at depth 10 and the error port will fire with code MAX_NESTING_DEPTH_EXCEEDED. Design your workflow hierarchies to stay well within this limit.
Common Use Cases
| Scenario | How Sub-Workflow Helps |
|---|---|
| Reusable approval process | Define a single "Request Approval" child workflow used by many parent workflows — purchase orders, expense claims, change requests. |
| Shared notification workflow | One "Send Notification" child handles email/Slack/SMS routing. Parents call it passing the recipient and message without duplicating notification logic. |
| Common data validation | A validation child workflow checks address, phone, and email fields. Any parent workflow that handles contact data calls the same validator. |
| Modular invoice generation | Extract the complex invoice generation steps into a child workflow. Multiple parent workflows (order completion, subscription renewal) can invoke it. |
| Customer enrichment | A reusable child workflow enriches a customer record from three external APIs. Parents call it once and receive the enriched record. |
In This Guide
Configuration
sub_workflow_id, version pinning, input_data, and data-passing mechanisms between parent and child.
Input & Output
Output ports, the subworkflow.* output namespace, and how to access child workflow results.
Examples
Five examples: approval sub-process, shared notification, data validation, invoice generation, and customer enrichment.