/n8n-tutorials

How to set concurrency limits in n8n?

Learn how to set concurrency limits in n8n to control simultaneous workflow executions, optimize resource use, and ensure system stability with step-by-step configuration guidance.

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 set concurrency limits in n8n?

To set concurrency limits in n8n, navigate to the settings, locate the execution settings section, and adjust the max concurrency parameter according to your workflow needs. This allows you to control how many workflows can run simultaneously, helping to optimize resource usage and prevent system overload.

 

Comprehensive Guide to Setting Concurrency Limits in n8n

 

Step 1: Understanding Concurrency in n8n

 

Concurrency in n8n refers to the number of workflows or processes that can run simultaneously. Setting appropriate concurrency limits is crucial for:

  • Managing system resources efficiently
  • Preventing performance bottlenecks
  • Ensuring stability during high load periods
  • Optimizing workflow execution

By default, n8n sets certain concurrency limits, but these can be modified based on your specific requirements and available resources.

 

Step 2: Accessing n8n Settings

 

To modify concurrency settings in n8n, you need to access the settings area:

  • For self-hosted n8n: Access through environment variables or configuration files
  • For n8n Cloud: Some settings are available through the web interface
  • For Docker deployments: Settings can be passed as environment variables

For self-hosted installations, you can access the settings through:

  • The .env file in your n8n installation directory
  • Environment variables set in your hosting environment
  • Command-line parameters when starting n8n

 

Step 3: Setting Global Concurrency Limits via Environment Variables

 

The main way to set concurrency limits in n8n is through environment variables. These can be set in your .env file or passed directly when starting n8n.

Here are the key environment variables for controlling concurrency:


# Maximum number of workflows that can run simultaneously
EXECUTIONS\_PROCESS=5

# Maximum number of sub-processes in queue
EXECUTIONS_DATA_MAX\_PROCESSES=10

# Timeout for workflow executions (in seconds)
EXECUTIONS\_TIMEOUT=120

# Maximum number of data items in queue
EXECUTIONS_DATA_SAVE_ON_EXECUTION=true
EXECUTIONS_DATA_SAVE_ON_PROGRESS=true
EXECUTIONS_DATA_SAVE_MANUAL_EXECUTIONS=true

To implement these settings, add them to your .env file or set them as environment variables in your system.

 

Step 4: Setting Concurrency Limits in Docker Environments

 

If you're running n8n in Docker, you can pass concurrency settings as environment variables when creating or updating your container:


docker run -it --rm \\
  --name n8n \\
  -p 5678:5678 \\
  -e EXECUTIONS\_PROCESS=5 \\
  -e EXECUTIONS_DATA_MAX\_PROCESSES=10 \\
  -e EXECUTIONS\_TIMEOUT=120 \\
  n8nio/n8n

For Docker Compose, add these variables to your docker-compose.yml file:


version: '3'

services:
  n8n:
    image: n8nio/n8n
    ports:
    - "5678:5678"
    environment:
    - EXECUTIONS\_PROCESS=5
    - EXECUTIONS_DATA_MAX\_PROCESSES=10
    - EXECUTIONS\_TIMEOUT=120
    volumes:
    - n8n\_data:/home/node/.n8n

volumes:
  n8n\_data:

 

Step 5: Fine-tuning Workflow-Specific Concurrency

 

In addition to global settings, you can control concurrency at the workflow level:

  • Open the workflow you want to configure
  • Click on the workflow settings (gear icon in the top right)
  • Navigate to the "Settings" tab
  • Look for "Max Concurrent Runs" option

Setting this value will limit how many instances of this specific workflow can run simultaneously, which is useful for resource-intensive workflows.


// This isn't actual code, but represents the setting available in the UI
{
  "name": "My Workflow",
  "settings": {
    "maxConcurrentRuns": 3  // Limit this workflow to 3 concurrent executions
  }
}

 

Step 6: Implementing Queue Mode for Workflows

 

For workflows that need to be executed in sequence rather than concurrently, you can enable Queue Mode:

  • Open the workflow settings
  • Go to the "Settings" tab
  • Find the "Queue Mode" option and enable it
  • Set "Max Concurrent Runs" to 1

With Queue Mode enabled, new workflow executions will wait in a queue until previous executions complete, ensuring sequential processing.

 

Step 7: Setting up Webhook Concurrency Limits

 

Webhook nodes in n8n can trigger workflow executions. To control concurrency for webhook-triggered workflows:

  • Use the global concurrency settings as a baseline
  • Set workflow-specific "Max Concurrent Runs" for webhook workflows
  • Consider implementing rate limiting on your webhook sources if possible

For high-volume webhook scenarios, consider:


# Set in your .env file
WEBHOOK_TUNNEL_URL=https://your-domain.com
EXECUTIONS\_PROCESS=10
EXECUTIONS_DATA_MAX\_PROCESSES=20

 

Step 8: Monitoring Concurrency and Queue Status

 

To effectively manage concurrency, you need to monitor how your limits are affecting workflow execution:

  • Check the Executions page in the n8n interface to see running and queued workflows
  • Use the n8n API to query execution status programmatically
  • Monitor system resources (CPU, memory) to ensure your concurrency settings are appropriate

If you notice many queued workflows or timeout errors, you may need to adjust your concurrency settings.

 

Step 9: Advanced Concurrency Configuration for Production Environments

 

For production environments with high workflow volumes, consider these advanced configurations:


# Enhanced concurrency settings for production
EXECUTIONS\_PROCESS=15
EXECUTIONS_DATA_MAX\_PROCESSES=30
EXECUTIONS\_MODE=queue
EXECUTIONS\_TIMEOUT=300
EXECUTIONS_RETRY_MODE=all
EXECUTIONS_RETRY_MAX\_ATTEMPTS=3
QUEUE_BULL_PREFIX=n8n\_queue

For multi-node n8n deployments, ensure consistent concurrency settings across all instances to prevent resource contention.

 

Step 10: Troubleshooting Concurrency Issues

 

If you encounter issues related to concurrency, try these troubleshooting steps:

  • Check execution logs for timeout errors or queue overflow messages
  • Gradually reduce concurrency limits to find stable values
  • Optimize resource-intensive workflows to complete faster
  • Consider splitting complex workflows into smaller ones
  • Increase system resources (CPU/memory) if necessary

Common issues and solutions:

  • Workflows timing out: Increase EXECUTIONS\_TIMEOUT or optimize workflow
  • Too many queued workflows: Increase EXECUTIONS\_PROCESS or optimize triggers
  • High system load: Reduce concurrency limits or upgrade hardware

 

Step 11: Optimizing Concurrency for Different Workflow Types

 

Different types of workflows benefit from different concurrency strategies:

  • Data processing workflows: Higher concurrency may improve throughput
  • API-dependent workflows: Limit concurrency to respect API rate limits
  • Resource-intensive workflows: Lower concurrency to prevent system overload
  • Time-sensitive workflows: Higher priority with dedicated concurrency slots

Consider categorizing your workflows and setting appropriate limits for each category:


# Example configuration for workflow segregation
# Set in your .env file

# For API workflows
API_WORKFLOW_EXECUTIONS\_PROCESS=3

# For data processing workflows
DATA_WORKFLOW_EXECUTIONS\_PROCESS=8

# For reporting workflows
REPORT_WORKFLOW_EXECUTIONS\_PROCESS=2

Note: The above example is conceptual - actual implementation would require custom logic in your workflows to respect these specialized limits.

 

Step 12: Implementing Concurrency Best Practices

 

To maximize the effectiveness of your concurrency settings:

  • Start with conservative limits and increase gradually
  • Monitor system performance after each adjustment
  • Document your concurrency settings and the rationale behind them
  • Regularly review and adjust based on changing workflow patterns
  • Test concurrency limits under expected peak loads

These practices will help ensure your n8n instance remains stable and performs optimally under various conditions.

 

Step 13: Scaling n8n with Proper Concurrency Management

 

For environments that need to scale beyond the capacity of a single n8n instance:

  • Consider multiple n8n instances with load balancing
  • Set appropriate concurrency limits on each instance
  • Use a shared database for execution state
  • Implement a message queue system for distributing workflow triggers

Example architecture for a scaled n8n deployment:


# Load balancer configuration (conceptual)
upstream n8n\_servers {
    server n8n1:5678;
    server n8n2:5678;
    server n8n3:5678;
}

server {
    listen 80;
    server\_name n8n.yourdomain.com;
    
    location / {
        proxy_pass http://n8n_servers;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote\_addr;
    }
}

Each n8n instance would have its own concurrency settings optimized for the available resources.

 

Conclusion

 

Setting concurrency limits in n8n is a crucial aspect of performance tuning and resource management. By following this guide, you can implement appropriate concurrency controls that ensure your n8n instance runs efficiently while maintaining stability. Remember to monitor your system regularly and adjust the concurrency settings as your workflow requirements evolve.

The key to successful concurrency management is finding the right balance between parallelism (for speed) and resource conservation (for stability). With proper configuration, n8n can handle complex automation needs while maintaining reliable performance.

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