Guide: Chain Workflows with Subworkflow
Build a parent workflow that calls two separate subworkflows in sequence, passing data between them. This pattern is useful for keeping complex workflows modular and reusable.
What you will build:
Parent: Webhook → Subworkflow A (validate) → Subworkflow B (notify) → Return
Child A: Manual Trigger → HTTP Request (validate) → Return
Child B: Manual Trigger → Send Email → Return
Time: ~20 minutes
Prerequisites:
- Tensorify account with a workspace
- Resend account with a verified domain
- CLI installed (only for local testing):
curl -fsSL https://cli.tensorify.io/install | sh— or skip and deploy with Managed mode
This workflow takes a user ID and returns the user's data.
- Dashboard → New Workflow → name it
validate-user - Add a Manual trigger with
allowWorkflowInvocationenabled - Set mock payload:
{ "userId": "usr_123" }
-
Add an HTTP Request node connected to Manual's payload:
- Method: GET
- URL:
https://jsonplaceholder.typicode.com/users/{{ manual.body.userId }}
-
Add an If node connected to HTTP Request's response:
- Condition:
{{ http_request.status }} == 200
- Condition:
-
On the true branch: add a Return node connected to HTTP Request's response
-
On the false branch: add a Return node connected to a Transform node that produces:
{ "error": "User not found", "userId": "{{ manual.body.userId }}" }
Copy the Workflow ID from the URL — you will need it in the parent workflow.
This workflow sends an email notification with the user data.
- Dashboard → New Workflow → name it
send-user-notification - Add a Manual trigger with
allowWorkflowInvocationenabled - Set mock payload:
{
"name": "Test User",
"email": "[email protected]"
}
- Add a Code node connected to Manual's payload:
name = input.get("body", {}).get("data", {}).get("name", "User")
return f"New user validated: {name}"
-
Add a Send Email node connected to Code's result:
- From:
[email protected] - To:
[email protected] - Subject:
User validated: {{ manual.body.data.name }}
- From:
-
Add a Return node connected to a Transform that produces:
{ "notified": true, "userId": "{{ manual.body.data.id }}" }
Copy this workflow's Workflow ID too.
- Dashboard → New Workflow → name it
user-onboarding-pipeline - Add a Webhook node (or API Endpoint if you want a synchronous response)
- Add a Subworkflow node connected to Webhook's payload:
- Workflow ID: paste the ID of
validate-user
- Workflow ID: paste the ID of
- Add another Subworkflow node connected to the first Subworkflow's result:
- Workflow ID: paste the ID of
send-user-notification
- Workflow ID: paste the ID of
- Connect the second Subworkflow's result to a Return node (if using API Endpoint)
Using Managed mode? Skip to Step 5 — deploy with Managed execution and test via the webhook URL.
tensorify init
tensorify login # opens browser — or use --api-key on init
tensorify runner start
Set a mock payload on the Webhook node:
{ "userId": "3" }
Click Test → select the Return node → click Run to Selected.
In the terminal, you will see execution logs from all three workflows in sequence. The canvas shows the parent and each subworkflow's outputs at each step.
With a connected runner, deploy the parent workflow from the UI. Subworkflows run in the same execution context — you do not start a separate process per workflow.
One tensorify runner start process handles every workflow assigned to it. Deploy the parent from the Deploy dialog; subworkflows are invoked automatically. Or set execution mode to Managed if you prefer cloud execution.
- How to compose multiple workflows using the Subworkflow node
- How to pass data between parent and child workflows via the
inputhandle andReturnnode - How to use If branching inside a subworkflow to handle error states
- The module composition pattern for keeping complex automations maintainable
- Subworkflow reference — full configuration options
- Return reference — returning values from subworkflows
- Manual Trigger reference — configuring invokable workflows
