Deploy n8n on Railway in queue mode with workers

By Tracklayer · Updated 2026-11-20

Short answer: deploy n8n on Railway with a template that runs it in queue mode: the editor (n8n Main) puts executions on a Redis queue, one or more workers run them, and a separate webhook processor takes production traffic. Add Postgres for data and a nightly backup job, and you have a setup you can scale by raising a replica count instead of rebuilding.

Deploy n8n queue mode on Railway

When a single n8n container is not enough

One n8n container runs the editor, every trigger, every webhook and every Code node in the same process. That is fine while you are building. It starts to hurt when:

Queue mode is n8n’s documented way to split that work.

Which n8n templates people deploy on Railway

TemplateCreatorDeploymentsServices
N8N (w/ workers)Jack114,7374
n8nshinyduo's Projects17,5602
n8nThalles Passos's Projects5,8502
n8n with workersSteven Junio's Projects4,0404
N8N (w/ webhook processors)Jack3,3865
flowise-with-n8n-ai-automationderekcheungsa's Projects1,9743
N8NFaraz Patankar1,5472
n8n-mcpczlonkowski's Projects1,3481

Railway marketplace data as of 2026-11-19. Full ranking: Best n8n templates on Railway.

Template names on the marketplace do not always say whether they use queue mode, pin a version or back up the database. Open the template page and check its services: queue mode needs Redis and at least one worker service.

Deploy n8n in queue mode, step by step

These steps use Tracklayer’s n8n 2 Production Stack template (n8n 2.45.7, pinned).

  1. Deploy the template. It creates a Gateway (nginx, the only public service), n8n Main, n8n Webhook, n8n Worker, Postgres, Redis and a Postgres Backup job.
  2. Wait for n8n Main to turn healthy. The first boot builds images and runs database migrations, which takes a few minutes.
  3. Find your login. Open n8n Main → Variables. The email is N8N_INSTANCE_OWNER_EMAIL (default admin@example.com) and the password is the generated N8N_OWNER_PASSWORD. There is no setup page, so nobody can claim the instance before you.
  4. Save the encryption key. Copy N8N_ENCRYPTION_KEY from n8n Main to your password manager. Backups cannot restore credentials without it.
  5. Open the Gateway URL and sign in. To use your own domain, add it to the Gateway and set N8N_EDITOR_BASE_URL and N8N_WEBHOOK_URL on n8n Main.

Scale workers when the queue grows

Open n8n Worker → Settings → Replicas. Each replica is a full worker with its own JavaScript and Python task runners and 10 parallel executions. Railway’s Hobby plan allows up to 6 replicas, Pro up to 42. n8n Main stays a single instance (multi-main is an n8n Enterprise feature).

Backups and restore

The Postgres Backup job runs every day at 03:15 UTC, writes a verified pg_dump to a Railway Bucket and keeps 14 days. Restore runs inside Railway as one transaction: stop the three n8n services, set BACKUP_ACTION=restore and BACKUP_RESTORE_CONFIRM=railway on the backup job, run it, then switch it back to backup.

Upgrading n8n

All n8n services read one tag, N8N_IMAGE_TAG on n8n Main. Run a backup, read the n8n release notes, set the new stable tag and deploy n8n Main, Webhook and Worker together. Never mix versions between them.

Simpler options

If you do not need workers yet, Tracklayer also maintains n8n 2 with Postgres (one n8n service) and an n8n AI agent stack with Ollama and Qdrant. For more choices, see the full ranking of n8n templates on Railway.

FAQ

Do I need queue mode to run n8n on Railway?

No. A single n8n container with Postgres is enough to try n8n or run a few light workflows. Queue mode matters once executions, webhooks and Code nodes start to compete for one process, or when you want to add workers instead of a bigger server.

How much does n8n in queue mode cost on Railway?

Railway bills usage. The template's own estimate is about $10 per month idle and about $30 per month for steady automations with one worker; each extra worker replica adds roughly $13 per month under load. Your bill depends on workflow volume and memory use.

Can I use n8n commercially if I self-host it?

n8n is fair-code under the Sustainable Use License. Self-hosting for your own internal business, personal or non-commercial use is allowed; selling n8n as a hosted service to others is not, and Enterprise features need an n8n license. Read the license or ask a lawyer if your use is customer-facing.

Why do outgoing email nodes fail on Railway?

Outbound SMTP needs Railway's Pro plan. On Hobby, send email through an HTTP email API node instead.