By default, n8n runs in main mode — a single-process architecture where the web server, scheduler, and execution engine all run inside one container. This works great for workflows handling up to ~50 concurrent executions, but under heavy load, it can lead to memory pressure, missed cron triggers, and slow webhook response times.

Queue Mode separates the n8n architecture into dedicated components using Redis as a message broker:

  • Main Instance: Handles the web UI, API, and scheduling. Does not run executions.
  • Worker Instances: Multiple stateless containers that pick up execution jobs from the Redis queue and process them in parallel.
  • Redis: Acts as the central job queue and pub/sub channel for broadcasting events.

Docker Compose Setup for Queue Mode

services:
  redis:
    image: redis:7-alpine
    restart: always

  n8n-main:
    image: docker.n8n.io/n8nio/n8n:latest
    command: start
    environment:
      - EXECUTIONS_MODE=queue
      - QUEUE_BULL_REDIS_HOST=redis
      - N8N_SKIP_WEBHOOK_DEREGISTRATION_SHUTDOWN=true
      - DB_TYPE=postgresdb
      - DB_POSTGRESDB_HOST=db
    depends_on:
      - redis
      - db

  n8n-worker:
    image: docker.n8n.io/n8nio/n8n:latest
    command: worker --concurrency=10
    environment:
      - EXECUTIONS_MODE=queue
      - QUEUE_BULL_REDIS_HOST=redis
      - DB_TYPE=postgresdb
      - DB_POSTGRESDB_HOST=db
    depends_on:
      - redis
      - db
    deploy:
      replicas: 3   # Run 3 worker containers

How Workers Scale Horizontally

Each worker container processes up to --concurrency=10 jobs simultaneously. With 3 workers, you can handle 30 concurrent workflow executions, each completely isolated from each other.

Adding more workers is as simple as scaling the service: docker-compose scale n8n-worker=5.

Performance Tip: For webhook-heavy workloads, run dedicated webhook worker instances: n8n webhook. This prevents webhook response latency from being affected by long-running background jobs in the main queue.

Monitoring the Queue

You can monitor the Redis queue status using the Bull Board UI — a lightweight web dashboard that shows pending, active, completed, and failed jobs in real time. Add it as an additional container to your stack.