Deploy n8n-workers-template

n8n queue mode: Primary+Worker+Redis+Postgres. No API keys.

Deploy n8n-workers-template

Worker

n8nio/n8n

Just deployed

Postgres

postgres:16

Just deployed

/var/lib/postgresql/data

Just deployed

/data

Just deployed

/home/node/.n8n

Deploy and Host n8n with Workers on Railway

Advanced n8n on Railway in queue mode: Primary (editor + webhooks) + Worker + Redis + Postgres. This is the scalable stack on c17.io/stacks/n8n-workers.

For personal / light use, prefer the simpler two-service template: 9o4t/n8n → c17.io/stacks/n8n-automation.

No LLM or SaaS API keys are required to boot. Railway injects PORT. The template generates N8N_ENCRYPTION_KEY (shared by Primary and Worker) and wires WEBHOOK_URL to the public domain.

Cost note: four services (Primary, Worker, Redis, Postgres) cost more than the simple n8n + Postgres stack. Use this when concurrent workflows or heavy jobs would slow the editor.

About Hosting n8n with Workers

Queue mode separates the UI from execution:

Browser / Webhooks → Primary (n8n start)
                         ↓
                      Redis (Bull queue)
                         ↓
                      Worker (n8n worker)
                         ↓
                      Postgres
ServiceSourcePublicNotes
PrimaryDocker image n8nio/n8nYesn8n start. Health GET /healthz. Volume /home/node/.n8n.
WorkerDocker image n8nio/n8nNon8n worker. Shares DB, Redis, and encryption key.
Redisredis:7-alpine (or Railway Redis)NoBull queue broker.
Postgrespostgres:16NoWorkflows, credentials, execution history.

Both Primary and Worker need EXECUTIONS_MODE=queue and the same N8N_ENCRYPTION_KEY. Losing the key makes stored credentials unreadable.

The first account you create in the editor is the owner. There is no default username or password.

Common Use Cases

  • High-volume webhooks without blocking the editor
  • Concurrent / heavy workflows offloaded to workers
  • Scale throughput by adding Worker replicas
  • Production-style automation where UI and execution stay separate

Dependencies for n8n with workers Hosting

Required (wired or generated — you do not type these)

VariableServiceSource
PORTPrimary / Worker5678 (Railway may also inject)
EXECUTIONS_MODEPrimary / Workerqueue
N8N_ENCRYPTION_KEYPrimaryGenerated. Worker refs ${{Primary.N8N_ENCRYPTION_KEY}}
WEBHOOK_URLPrimaryhttps://${{RAILWAY_PUBLIC_DOMAIN}}
N8N_EDITOR_BASE_URLPrimaryhttps://${{RAILWAY_PUBLIC_DOMAIN}}
DB_TYPEPrimary / Workerpostgresdb
DB_POSTGRESDB_*Primary / WorkerRefs to Postgres
QUEUE_BULL_REDIS_*Primary / WorkerRefs to Redis
QUEUE_BULL_REDIS_DUALSTACKPrimary / Workertrue (Railway private DNS is IPv6)
OFFLOAD_MANUAL_EXECUTIONS_TO_WORKERSPrimary / Workertrue

Optional

VariableRequiredWhy
GENERIC_TIMEZONENoCron timezone, e.g. America/New_York. Default UTC.
Slack / OpenAI / Google keysNoAdded inside n8n credentials after deploy. BYO.

Volumes

MountServiceWhy
/home/node/.n8nPrimarySettings, binary data. Keep even with Postgres.
/var/lib/postgresql/dataPostgresDatabase files
/dataRedisAOF / RDB persistence

Worker is stateless by default (no volume).

Why Deploy n8n Workers on Railway?

The simple n8n + Postgres template is cheaper and enough for most personal graphs. This workers stack costs more because Redis and a Worker run continuously — worth it when the editor would otherwise stall under load. Trial credits cover the first deploy for most people. c17 never charges you — Railway usage is the referral / template kickback.

See TEMPLATE.md for the marketplace / composer shape.

Run locally

cp .env.example .env
# set POSTGRES_PASSWORD, REDIS_PASSWORD, N8N_ENCRYPTION_KEY (openssl rand -hex 32)
docker compose up

Editor: http://localhost:5678 — create the first owner account. Worker logs should show it consuming the queue.

License

n8n is fair-code (Sustainable Use License). This repo is config and docs only.


Template Content

Worker

n8nio/n8n

Postgres

postgres:16

More templates in this category

View Template
N8N Main + Worker
Deploy and Host N8N with Inactive worker.

jakemerson
121
View Template
Evolution API with n8n
Automate WhatsApp workflows with Evolution API, n8n, and Postgres.

codestorm
101
View Template
Postgres Backup
Cron-based PostgreSQL backup to bucket storage

Railway Templates
870