# n8n Workers (queue mode)

Workers n8n — needed when lots of things fire at once and the editor would freeze. Main = UI; workers run the queue. Costs more (4 services).

**Replaces:** Zapier / Make (high volume)

**Tier:** Medium

## Problem

Use this when: heavy webhook traffic, big batch jobs, many schedules at the same minute, or a team sharing n8n while production runs. A single n8n process runs the editor and every workflow; under concurrent jobs the UI stalls. Queue mode offloads execution to workers via Redis. Start with simple (/stacks/n8n-automation) unless you already know you need this.

## Stack

- [n8n](https://n8n.io/) — Primary editor + webhook ingress
- [n8n Worker](https://docs.n8n.io/hosting/scaling/queue-mode/) — Background workflow execution
- [Redis](https://redis.io/) — Bull queue broker
- [Postgres](https://www.postgresql.org/) — Workflows, credentials, execution history

## Estimated SaaS cost saved

| You stop paying | Typical / year | Self-host instead |
|---|---:|---|
| Zapier Professional (team) | $3,600 | n8n queue mode on Railway (4 services) |
| Make Pro / Teams | $2,400 | Same, or simple /stacks/n8n-automation if light |

**About $3,600 / year** on a small team, before you count lock-in.

## Deploy on Railway

One-click template from github.com/9o4t/n8n-workers: Primary (n8n start, public, volume + thin Dockerfile chown) + Worker (n8n worker, private) + Redis + Postgres. EXECUTIONS_MODE=queue, shared N8N_ENCRYPTION_KEY, QUEUE_BULL_REDIS_DUALSTACK. No operator API keys. Four services cost more than /stacks/n8n-automation.

[Deploy on Railway](https://c17.io/go/railway/n8n-workers?from=%2Fstacks%2Fn8n-workers.md)

Start with simple. Switch to workers only when the UI feels sluggish during runs, or you're past light personal use.

[Need simple instead?](https://c17.io/stacks/n8n-automation)

## AGENT_PROMPT

```
Deploy self-hosted n8n in queue mode (workers) on Railway.

Four services — do not collapse into one:
- Primary: n8n start, public domain, volume at /home/node/.n8n, healthz. Prefer thin Dockerfile FROM n8nio/n8n with root entrypoint chown (EACCES on Railway volumes).
- Worker: n8n worker, private. Same image tag as Primary.
- Redis: Bull queue. Set QUEUE_BULL_REDIS_* and QUEUE_BULL_REDIS_DUALSTACK=true.
- Postgres: DB_TYPE=postgresdb with matching DB_POSTGRESDB_*.

Both Primary and Worker: EXECUTIONS_MODE=queue, OFFLOAD_MANUAL_EXECUTIONS_TO_WORKERS=true, identical N8N_ENCRYPTION_KEY (Worker refs Primary). Wire WEBHOOK_URL to Primary public https domain. No operator SaaS API keys required to boot.

Keep the simple n8n+Postgres template separate at /stacks/n8n-automation.
```

## FAQ

### Why not the simple n8n template?

Start with simple (/stacks/n8n-automation) for personal automations, a few dozen workflows, or one-at-a-time work — form → row → Slack ping, nightly reports, CRM a few times a day. One process, cheaper. Switch here only when the UI feels sluggish during runs.

### Will this cost more on Railway?

Yes. Primary + Worker + Redis + Postgres burn more than two services. Scale Worker replicas only when you need the throughput.

### n8n or Activepieces?

This page is n8n queue mode. Activepieces is a separate Apache-2.0 template at /stacks/activepieces.

Source: https://c17.io/stacks/n8n-workers
