Configuration
id: Unique node identifierworkflow_id: ID of the workflow to callworkflow_name: Display name of called workflow (read-only)save_error_to: Variable name to store error details if child workflow fails (optional, defaults tosubworkflow_error)
How it works
- Creates child execution: Starts a new execution of the called workflow with copied context
- Pauses parent: Parent workflow enters waiting state until child completes
- Merges variables: When child finishes, its variables merge into parent’s
vars - Handles errors: If child fails, error details saved to configured variable
- Continues execution: Parent resumes from next step after child completes
Execution context
The child workflow receives:- Copy of parent’s
vars(workflow variables) - Copy of parent’s
systemvariables - Copy of parent’s
context(phone_number, channel, etc) - Same WhatsApp conversation if applicable
Error handling
If the child workflow fails, error details are stored in the configured variable:- Cycle detection: Workflow calls itself directly or indirectly
- Max depth exceeded: Call stack exceeds 10 levels
- Non-executable workflow: Called workflow is not published/active
- Insufficient credits: Not enough credits to execute child workflow
Safeguards
Recursion protection- Detects circular calls (workflow A → workflow B → workflow A)
- Maximum call depth of 10 workflows (prevents infinite recursion)
- Errors stored in variables instead of failing entire workflow
- Each call creates independent execution record
- Parent and child executions visible in execution history
- Child execution shows in parent’s execution stack
Usage patterns
Reusable order validation Multi-step authentication Conditional sub-processesExecution stack
When workflows call other workflows, the platform maintains an execution stack visible in the UI and API responses:Best practices
Design reusable workflows: Create focused workflows that handle single responsibilities (validation, notifications, data processing). Handle errors explicitly: Always check the error variable after calling workflows that might fail. Avoid deep nesting: Keep call depth under 3-4 levels for maintainability. Share via variables: Usevars to pass data between workflows - changes in child workflows automatically merge back.
Test call chains: Use test mode to verify the full execution path including all child workflows.
Workflow library example
Use workflow slugs in local workflow source.kapso push resolves the slug to the Platform API workflow_id.

