Skip to main content
n8n supports different execution modes for running workflows, each optimized for specific use cases and scaling requirements.

Execution Modes Overview

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
Characteristics:
  • 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

number
default:"10"
Maximum number of jobs a worker can run simultaneously.
Examples:
Performance Tip: Workers with concurrency below 5 may experience instability. Set to at least 5 for production use.

Worker Environment Variables

Example:

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.
Configuration:
Features:
  • 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

string
required
The workflow ID to execute.
boolean
default:"false"
Output only JSON data without additional text.
Examples:

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

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:

Performance Tuning

Worker Optimization

Concurrency Guidelines

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:
Health endpoint: http://localhost:5678/healthz

Troubleshooting

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
Problem: Worker process terminates unexpectedly.Solutions:
  • Reduce concurrency (may be overloaded)
  • Check memory limits
  • Review workflow complexity
  • Enable debug logging
Problem: Executions run in main process despite queue mode.Solutions:
  • Verify EXECUTIONS_MODE=queue is 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