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.
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 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:
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 installations, you can access the settings through:
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:
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:
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:
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:
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:
Common issues and solutions:
Step 11: Optimizing Concurrency for Different Workflow Types
Different types of workflows benefit from different concurrency strategies:
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:
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:
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.
When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.