Run Sub-Workflow
Run another workflow from within this workflow
Run Sub-Workflow
Run another workflow (called a sub-workflow) from within your current workflow. This lets you reuse common workflows and keep your main workflow organized and easy to understand.
Technical Name: SubFlowFunc
Properties
- Execution Mode: SYNC
- Type: NATIVE
- Category: System Functions
- Function ID:
8e9b1ea8-5d9a-4f2b-a8f6-8f6b5d9a1eb0
Input Schema
Required Parameters
| Parameter | Type | Description |
|---|---|---|
mflowId | string (uuid) | ID of the subflow to execute |
data | object | Input data to pass to the subflow's Start node |
[Image placeholder: SubFlow configuration panel]
Input Example
{
"mflowId": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
"data": {
"customerId": "cust-123",
"orderId": "ord-456",
"action": "process"
}
}Output Schema
| Field | Type | Description |
|---|---|---|
id | string (uuid) | ID returned by the subflow's End node |
data | object | Data returned by the subflow's End node |
[Image placeholder: SubFlow data flow diagram]
Use Cases
Modular Workflow Design
Break complex workflows into reusable subflows:
Main Flow:
Start → ValidateInput → SubFlow(ProcessOrder) → SubFlow(SendNotification) → End
ProcessOrder Subflow:
Start → CalculateTotals → InsertOrder → UpdateInventory → EndReusable Business Logic
Create reusable subflows for common operations:
{
"mflowId": "validate-customer-subflow-id",
"data": {
"customerId": "${start.output.customerId}",
"validationType": "full"
}
}Best Practices
- Single Responsibility: Each subflow should have one clear purpose
- Clear Contracts: Define explicit input/output schemas
- Error Handling: Handle errors at appropriate levels
- Documentation: Document subflow purpose and parameters
- Versioning: Maintain subflow versions for backward compatibility
Benefits
- Modularity: Break complex workflows into manageable pieces
- Reusability: Use the same subflow in multiple parent flows
- Maintainability: Update logic in one place
- Testing: Test components independently
[Image placeholder: SubFlow benefits visualization]
Related Functions
- ForEach - Execute flow for each array item
- UserAction - Pause for user interaction