← Back to Blog

Scaling n8n to 100,000 Workflows/Day: Eliminating PostgreSQL Deadlocks with Redis Queue Mode



Scaling n8n to 100,000 Workflows/Day: Eliminating PostgreSQL Deadlocks with Redis Queue Mode

When running n8n in default single-process mode, workflow executions write state directly to the main database. Once your automation traffic exceeds 10,000 executions per day—such as processing bulk webhooks, syncing CRM data, or streaming AI agent steps—PostgreSQL starts experiencing extreme connection exhaustion, table locks, and memory bloat.

To scale n8n reliably to 100,000+ executions/day, you must decouple workflow triggers from execution workers using n8n Queue Mode backed by Redis.

Multi-Worker n8n Queue Architecture

# docker-compose.queue.yml
services:
 n8n-main:
 image: n8nio/n8n:latest
 environment:
 - EXECUTIONS_MODE=queue
 - QUEUE_BULL_REDIS_HOST=redis
 - DB_TYPE=postgresdb
 - DB_POSTGRESDB_HOST=postgres

 n8n-worker-1:
 image: n8nio/n8n:latest
 command: worker --concurrency=10
 environment:
 - EXECUTIONS_MODE=queue
 - QUEUE_BULL_REDIS_HOST=redis
 - DB_TYPE=postgresdb
 - DB_POSTGRESDB_HOST=postgres

 n8n-worker-2:
 image: n8nio/n8n:latest
 command: worker --concurrency=10
 environment:
 - EXECUTIONS_MODE=queue
 - QUEUE_BULL_REDIS_HOST=redis
 - DB_TYPE=postgresdb
 - DB_POSTGRESDB_HOST=postgres