/n8n-tutorials

How to run multiple workflows in sequence in n8n?

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.

Matt Graham, CEO of Rapid Developers

Book a call with an Expert

Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.

Book a free consultation

How to run multiple workflows in sequence in n8n?

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:

  • Sequential execution allows you to break complex processes into smaller, manageable workflows
  • Data can be passed between workflows
  • Each workflow can be maintained and tested independently
  • Workflows can be reused in different sequences

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:

  • Install and configure n8n (if not already done)
  • Make sure you're using n8n version 0.118.0 or higher for best results with workflow execution
  • Log in to your n8n instance

 

Step 3: Creating Individual Workflows

 

First, create the individual workflows that you want to run in sequence:

  • Create "Workflow 1" (the first workflow in your sequence)
  • Create "Workflow 2" (the second workflow)
  • Create additional workflows as needed

For example, let's create two simple workflows:

For "Workflow 1":

  1. Add a "Manual Trigger" node (this will be the starting point)
  2. Add a "Set" node to prepare some data
  3. Save the workflow with a descriptive name like "Data Collection Workflow"

For "Workflow 2":

  1. Add a "Start" node (this will receive data from Workflow 1)
  2. Add processing nodes (e.g., "Function" node for data transformation)
  3. Save this workflow with a name like "Data Processing Workflow"

 

Step 4: Adding the Execute Workflow Node

 

To create the sequence:

  1. Open "Workflow 1" (the first workflow in your sequence)
  2. Add an "Execute Workflow" node after your processing nodes
  3. Configure it to point to "Workflow 2"

Here's how to configure the Execute Workflow node:

  • Click on the "Execute Workflow" node to open its settings
  • In the "Workflow" field, select the workflow you want to execute next (e.g., "Data Processing Workflow")
  • Choose how you want to pass data to the next workflow

 

Step 5: Configuring Data Passing Between Workflows

 

There are several ways to pass data between workflows:

  • Passing all input data: The entire data from the previous node goes to the next workflow
  • Passing selected data: You can specify which items to pass
  • Transforming data: You can modify the data before passing it

To configure data passing:

  1. In the Execute Workflow node settings, find the "Data to Send" section
  2. Choose one of the following options:
  • "All Input Data": Sends all data from the previous node
  • "Selected Input Data": Lets you choose specific items
  • "Define Data to Send": Allows you to construct custom data

// 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:

  1. In the Execute Workflow node, expand the "Options" section
  2. Check "Continue When Execution Error Occurs" if you want the parent workflow to continue even if the child workflow fails
  3. Optionally, add an "Error Trigger" node in your main workflow to handle errors

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:

  1. In "Workflow 2", add another Execute Workflow node at the end
  2. Configure it to point to "Workflow 3"
  3. Continue this pattern for as many workflows as needed

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:

  1. After an Execute Workflow node, add a "Wait" node
  2. Configure the Wait node with an appropriate delay or until a specific date
  3. This ensures the next workflow starts only after the previous one has had 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:

  1. Add an "IF" or "Switch" node before your Execute Workflow nodes
  2. Configure conditions based on your data
  3. Connect different Execute Workflow nodes to different outputs of the conditional node

// 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:

  1. Instead of the Execute Workflow node, end "Workflow 1" with an HTTP Request node
  2. Configure it to call a webhook that triggers "Workflow 2"
  3. In "Workflow 2", start with a Webhook node that listens for this trigger

// 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:

  1. Activate all workflows in the sequence
  2. Run the first workflow in the sequence
  3. Monitor the execution of each workflow
  4. Check that data is correctly passed between workflows
  5. Verify the final output matches your expectations

To debug:

  • Use the "Debug" mode in n8n
  • Add "Debug" nodes at critical points in your workflows
  • Check execution logs for each workflow

 

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

  1. Start with a "Schedule Trigger" node (runs daily)
  2. Add an "HTTP Request" node to fetch data from an API
  3. Add a "Set" node to format the data
  4. Add an "Execute Workflow" node pointing to "Workflow 2"

// Set node configuration
{
  "processDate": {{$json.now}},
  "rawData": {{$node["HTTP Request"].json}},
  "status": "collected"
}

Workflow 2: Data Transformation

  1. Start with a "Start" node
  2. Add a "Function" node to transform the data
  3. Add a "Set" node to prepare for storage
  4. Add an "Execute Workflow" node pointing to "Workflow 3"

// 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

  1. Start with a "Start" node
  2. Add a "Postgres" node (or any database node) to store the data
  3. Add a "Send Email" node to notify about completion

// 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:

  • Set up monitoring for all workflows in your sequence
  • Create a dashboard to track successful executions and failures
  • Implement notification systems for workflow failures
  • Regularly review execution logs for performance optimization

Consider implementing:

  1. A monitoring workflow that checks the status of other workflows
  2. Slack or email notifications for critical failures
  3. A log retention policy for execution history

 

Step 14: Best Practices for Workflow Sequencing

 

Follow these best practices for efficient workflow sequencing:

  • Keep individual workflows focused on a single responsibility
  • Use clear, descriptive names for all workflows
  • Document the expected input and output for each workflow
  • Implement proper error handling at each step
  • Use tags to organize related workflows
  • Create reusable workflows for common tasks
  • Test each workflow individually before connecting them
  • Optimize data passing to include only necessary information

 

Step 15: Troubleshooting Common Issues

 

Common issues and solutions:

Problem: Child workflow doesn't receive data

  • Check the "Data to Send" configuration in the Execute Workflow node
  • Verify that the data exists and is correctly formatted
  • Ensure the receiving workflow's Start node is properly configured

Problem: Workflow sequence stops unexpectedly

  • Check error logs for the failing workflow
  • Enable "Continue When Execution Error Occurs" option
  • Add more robust error handling in each workflow

Problem: Performance issues with long sequences

  • Consider breaking very long sequences into parallel paths
  • Optimize data processing in each workflow
  • Use webhooks for asynchronous execution when appropriate

 

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.

Want to explore opportunities to work with us?

Connect with our team to unlock the full potential of no-code solutions with a no-commitment consultation!

Book a Free Consultation

Client trust and success are our top priorities

When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.

Rapid Dev was an exceptional project management organization and the best development collaborators I've had the pleasure of working with. They do complex work on extremely fast timelines and effectively manage the testing and pre-launch process to deliver the best possible product. I'm extremely impressed with their execution ability.

CPO, Praction - Arkady Sokolov

May 2, 2023

Working with Matt was comparable to having another co-founder on the team, but without the commitment or cost. He has a strategic mindset and willing to change the scope of the project in real time based on the needs of the client. A true strategic thought partner!

Co-Founder, Arc - Donald Muir

Dec 27, 2022

Rapid Dev are 10/10, excellent communicators - the best I've ever encountered in the tech dev space. They always go the extra mile, they genuinely care, they respond quickly, they're flexible, adaptable and their enthusiasm is amazing.

Co-CEO, Grantify - Mat Westergreen-Thorne

Oct 15, 2022

Rapid Dev is an excellent developer for no-code and low-code solutions.
We’ve had great success since launching the platform in November 2023. In a few months, we’ve gained over 1,000 new active users. We’ve also secured several dozen bookings on the platform and seen about 70% new user month-over-month growth since the launch.

Co-Founder, Church Real Estate Marketplace - Emmanuel Brown

May 1, 2024 

Matt’s dedication to executing our vision and his commitment to the project deadline were impressive. 
This was such a specific project, and Matt really delivered. We worked with a really fast turnaround, and he always delivered. The site was a perfect prop for us!

Production Manager, Media Production Company - Samantha Fekete

Sep 23, 2022