Skip to content

Instantly share code, notes, and snippets.

@up1
Last active November 21, 2025 23:46
Show Gist options
  • Select an option

  • Save up1/3c9877fdaa21295b6d47a999d08f95bd to your computer and use it in GitHub Desktop.

Select an option

Save up1/3c9877fdaa21295b6d47a999d08f95bd to your computer and use it in GitHub Desktop.
n8n queue mode
services:
postgres:
env_file:
- .env
image: postgres:18
environment:
- POSTGRES_USER=n8n
- POSTGRES_PASSWORD=n8n
- POSTGRES_DB=n8n
healthcheck:
test: ["CMD-SHELL", "pg_isready -U n8n"]
interval: 5s
timeout: 5s
retries: 5
redis:
image: redis:8
healthcheck:
test: ["CMD-SHELL", "redis-cli ping"]
interval: 5s
timeout: 5s
retries: 5
ui:
env_file:
- .env
image: n8nio/n8n
environment:
- N8N_RUNNERS_BROKER_LISTEN_ADDRESS=0.0.0.0
ports:
- "5678:5678"
healthcheck:
test: ["CMD-SHELL", "wget --spider --quiet http://localhost:5678/healthz || exit 1"]
interval: 5s
timeout: 5s
retries: 5
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
task-runner:
env_file:
- .env
image: n8nio/runners
environment:
- N8N_RUNNERS_TASK_BROKER_URI=http://ui:5679
depends_on:
ui:
condition: service_healthy
postgres:
condition: service_healthy
redis:
condition: service_healthy
worker:
env_file:
- .env
image: n8nio/n8n
command: worker
ports:
- "5679:5678"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
webhook:
env_file:
- .env
image: n8nio/n8n
command: webhook
depends_on:
ui:
condition: service_healthy
postgres:
condition: service_healthy
redis:
condition: service_healthy
EXECUTIONS_MODE=queue
QUEUE_BULL_REDIS_HOST=redis
QUEUE_BULL_REDIS_PORT=6379
DB_TYPE=postgresdb
...
# Enable n8n runners
N8N_RUNNERS_ENABLED=true
N8N_RUNNERS_MODE=external
N8N_RUNNERS_AUTH_TOKEN=your_runners_auth_token_here
N8N_NATIVE_PYTHON_RUNNER=true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment