Subworkflow
Calls another workflow as a step in the current workflow. The target workflow runs synchronously — the parent workflow pauses, the subworkflow executes, and the parent resumes with the result.
Use Subworkflow when:
- You want to reuse logic shared across multiple workflows
- A workflow has grown too large and you want to split it into composable pieces
- You want to call a standalone workflow from within a larger pipeline
The target workflow must have a Manual Trigger with allowWorkflowInvocation enabled.
| Handle | Type | Description |
|---|---|---|
input | any | Data passed to the subworkflow's trigger payload. Optional. |
| Handle | Type | Description |
|---|---|---|
result | any | Result returned from the subworkflow's Return node. |
The result is accessed in downstream nodes as {{ subworkflow.result }}.
| Setting | Type | Required | Description |
|---|---|---|---|
workflowId | string | Yes | ID of the target workflow to execute. Paste it from the target workflow's URL. |
The target workflow must:
- Use a Manual Trigger node as its entry point
- Have
allowWorkflowInvocationenabled on the Manual Trigger node - Include a Return node at its exit point with the value to return
Parent workflow that validates and enriches data using two separate subworkflows:
Webhook → Subworkflow (validate-user-wf) → Subworkflow (enrich-profile-wf) → Send Email
Subworkflow settings:
- Workflow ID: paste the target workflow ID from its URL
validate-user-wf structure:
Manual Trigger → HTTP Request (call auth service) → If (input.status == 200)
→ true: Return (forwards user data)
→ false: Stop
Access the subworkflow's output in the parent:
{{ subworkflow.result.email }}
{{ subworkflow.result.plan }}
import webhook from @tensorify/webhook-trigger:4.0.0
import validate from @tensorify/subworkflow:3.0.0
import enrich from @tensorify/subworkflow:3.0.0
import send_email from @tensorify/resend-send-email:1.0.0
node trigger @tensorify/webhook-trigger:4.0.0 {
path = "/users"
method = "POST"
provider = "generic"
}
node validate_user @tensorify/subworkflow:3.0.0 {
workflowId = "wf_validate_user_abc123"
}
node enrich_profile @tensorify/subworkflow:3.0.0 {
workflowId = "wf_enrich_profile_def456"
}
node notify @tensorify/resend-send-email:1.0.0 {
to = "{{ enrich_profile.result.email }}"
subject = "Welcome"
}
trigger.payload -> validate_user.input
validate_user.result -> enrich_profile.input
enrich_profile.result -> notify.input
Subworkflow has a hidden On Error control output branch. Enable it via the "Error output handle" toggle at the bottom of the settings panel.
The error branch fires when:
- The subworkflow fails (a node throws, no Return fires)
- The target workflow cannot be found or is not invocable
- Any runtime exception occurs during subworkflow execution
Connect the error output to a fallback Return node, a notification action, or a Stop node to handle failures gracefully. Without the error branch enabled, a subworkflow failure halts the parent workflow at the Subworkflow node.
- Target must have Manual Trigger: If the target workflow uses a Webhook or API Endpoint trigger, calling it as a subworkflow will fail at runtime.
- Circular calls: Do not call workflow A from workflow B if workflow B is already called from A. Circular subworkflow chains will hit a recursion limit.
- Only the Return body propagates: Custom HTTP status codes set in the child workflow's Return node are not passed to the parent — only the body value becomes
result. If the child workflow does not reach a Return node, the parent receivesnull. - Synchronous execution: The parent workflow blocks until the subworkflow completes. Long-running subworkflows increase total execution time.
- Manual Trigger — configure the target workflow's entry point
- Return — return a value from the subworkflow
- If — branch on subworkflow results in the parent
