Learn how to run multiple workflows in sequence in n8n using the Execute Workflow node to create modular, data-passing automation sequences with error handling and dynamic control.
Book a call with an Expert
Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.
To run multiple workflows in sequence in n8n, you can use the Execute Workflow node, which allows one workflow to trigger another. This enables you to create modular workflows that run in a specific order, passing data between them for complex automation sequences.
Step 1: Understanding Workflow Sequencing in n8n
Before diving into the implementation, it's important to understand how workflow sequencing works in n8n:
The primary tool for sequencing workflows is the Execute Workflow node, which can trigger another workflow from within the current one.
Step 2: Setting Up Your n8n Environment
Ensure your n8n environment is properly set up:
Step 3: Creating Individual Workflows
First, create the individual workflows that you want to run in sequence:
For example, let's create two simple workflows:
For "Workflow 1":
For "Workflow 2":
Step 4: Adding the Execute Workflow Node
To create the sequence:
Here's how to configure the Execute Workflow node:
Step 5: Configuring Data Passing Between Workflows
There are several ways to pass data between workflows:
To configure data passing:
// Example of custom data mapping in the "Define Data to Send" option
{
"customerName": {{$node["Set"].json["name"]}},
"customerEmail": {{$node["Set"].json["email"]}},
"timestamp": {{Date.now()}}
}
Step 6: Setting Up Error Handling
For robust workflow sequences, add error handling:
You can also add conditional paths after the Execute Workflow node:
// Example Function node to check execution status
if (items[0].json.executionStatus === 'success') {
return [items[0]]; // Success path
} else {
return [[], items[0]]; // Error path (second output)
}
Step 7: Creating a Multi-Step Workflow Sequence
To chain more than two workflows:
Alternatively, you can have a main "controller" workflow that executes multiple workflows in sequence:
// Example structure of a controller workflow:
Start
→ Execute Workflow (pointing to "Workflow 1")
→ Wait (optional, to ensure completion)
→ Execute Workflow (pointing to "Workflow 2")
→ Wait (optional)
→ Execute Workflow (pointing to "Workflow 3")
Step 8: Using the Wait Node for Synchronization
For workflows that need time to complete:
This is particularly useful for workflows that involve external API calls or long-running processes.
Step 9: Using Conditionals for Dynamic Workflow Selection
To dynamically decide which workflow to execute next:
// Example condition in an IF node
return $input.item.json.status === 'approved';
This allows for different workflow sequences based on dynamic conditions.
Step 10: Advanced: Using Webhooks for Asynchronous Workflow Chaining
For completely asynchronous workflow execution:
// HTTP Request node configuration in Workflow 1
{
"url": "https://your-n8n-instance.com/webhook/path-to-workflow2",
"method": "POST",
"body": {
"data": {{$node["Set"].json}}
}
}
This approach is useful for very long-running workflows or when you need to distribute workflow execution across different n8n instances.
Step 11: Testing Your Workflow Sequence
Test your workflow sequence thoroughly:
To debug:
Step 12: Real-World Example: Data Processing Pipeline
Let's create a complete example of a data processing pipeline with three workflows:
Workflow 1: Data Collection
// Set node configuration
{
"processDate": {{$json.now}},
"rawData": {{$node["HTTP Request"].json}},
"status": "collected"
}
Workflow 2: Data Transformation
// Function node for data transformation
const transformedData = [];
for (const item of items[0].json.rawData) {
transformedData.push({
id: item.id,
name: item.name.toUpperCase(),
value: parseFloat(item.value),
category: item.type || 'unknown'
});
}
return [{ json: {
processDate: items[0].json.processDate,
data: transformedData,
status: "transformed"
}}];
Workflow 3: Data Storage
// Email notification content
Subject: Data Processing Complete
Body: The data processing pipeline completed successfully at {{$json.processDate}}.
Processed {{$json.data.length}} records.
Current status: {{$json.status}}
Step 13: Monitoring and Maintaining Workflow Sequences
For ongoing operation:
Consider implementing:
Step 14: Best Practices for Workflow Sequencing
Follow these best practices for efficient workflow sequencing:
Step 15: Troubleshooting Common Issues
Common issues and solutions:
Problem: Child workflow doesn't receive data
Problem: Workflow sequence stops unexpectedly
Problem: Performance issues with long sequences
By following this comprehensive guide, you can effectively create, configure, and maintain sequences of workflows in n8n, enabling complex automation processes that are both modular and maintainable.
When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.