Execution Modes Overview
- Regular Mode
- Queue Mode
Regular mode executes workflows directly in the main process. This is the default mode for single-server deployments.Best for:
- Development environments
- Small to medium deployments
- Simple setups without scaling needs
- All workflows run in the main process
- Simple architecture
- No external dependencies (like Redis)
- Limited horizontal scaling
Configuration
Set the execution mode via environment variable:Worker Process
Workers handle workflow executions in queue mode.Starting Workers
Worker Flags
Maximum number of jobs a worker can run simultaneously.
Performance Tip: Workers with concurrency below 5 may experience instability. Set to at least 5 for production use.
Worker Environment Variables
| Variable | Description | Default |
|---|---|---|
N8N_CONCURRENCY_PRODUCTION_LIMIT | Override concurrency setting | -1 (disabled) |
N8N_GRACEFUL_SHUTDOWN_TIMEOUT | Seconds to wait before force shutdown | 30 |
Webhook Process
Dedicated webhook handling for improved performance and reliability.Starting Webhook Process
Webhook processes require queue mode. They cannot run in regular execution mode.
Benefits of Separate Webhook Process
- Isolation: Webhook handling separated from main process
- Scalability: Run multiple webhook processes
- Reliability: Webhook failures don’t affect main instance
- Performance: Dedicated resources for webhook traffic
Architecture Example
Multi-Main Setup
For high availability, run multiple main instances (Enterprise feature).Multi-main setup requires a valid n8n Enterprise license with the “Multiple Main Instances” feature enabled.
- Leader election for coordinated operations
- Shared workflow execution queue
- High availability
- Zero-downtime deployments
CLI Execution
Execute workflows directly from the command line.Execute Single Workflow
The workflow ID to execute.
Output only JSON data without additional text.
Execution Behavior
- Always executes in CLI mode (not as webhook or trigger)
- Starts from the workflow’s designated start node
- Does not support queue mode (automatically falls back to regular)
- Useful for testing and debugging
Batch Execution
Execute multiple workflows for testing purposes.Common Batch Scenarios
- Testing Suite
- Snapshot Testing
- Comparison Testing
- CI/CD Pipeline
Run all test workflows with output:
Skip List Format
Create a JSON file to skip specific workflows:Execution Context
Understanding how workflows execute in different contexts:| Context | Trigger | Use Case |
|---|---|---|
| CLI | n8n execute | Testing, debugging |
| Webhook | HTTP request | External integrations |
| Trigger | Time/event | Automated workflows |
| Manual | UI button | User-initiated |
Performance Tuning
Worker Optimization
Concurrency Guidelines
| Server Specs | Recommended Concurrency |
|---|---|
| 2 CPU, 4GB RAM | 5-8 |
| 4 CPU, 8GB RAM | 10-15 |
| 8 CPU, 16GB RAM | 20-30 |
| 16+ CPU, 32GB+ RAM | 40+ |
These are starting points. Monitor CPU, memory, and queue length to optimize for your specific workloads.
Monitoring Execution
Worker Status
Workers log their status on startup:Health Checks
Enable health check endpoints for monitoring:http://localhost:5678/healthz
Troubleshooting
Workflow executions stuck in queue
Workflow executions stuck in queue
Problem: Workflows remain in “running” state but don’t execute.Solutions:
- Check if workers are running:
ps aux | grep "n8n worker" - Verify Redis connection
- Increase worker concurrency
- Check worker logs for errors
Worker keeps crashing
Worker keeps crashing
Problem: Worker process terminates unexpectedly.Solutions:
- Reduce concurrency (may be overloaded)
- Check memory limits
- Review workflow complexity
- Enable debug logging
Queue mode not working
Queue mode not working
Problem: Executions run in main process despite queue mode.Solutions:
- Verify
EXECUTIONS_MODE=queueis set - Check Redis connection string
- Ensure Redis is running and accessible
- Check for configuration conflicts
Next Steps
CLI Commands
View all available CLI commands
Configuration
Configure execution settings
Scaling
Learn about scaling n8n
Queue Mode
Detailed queue mode documentation