Deploy N8N Main + Worker
Deploy and Host N8N with Inactive worker.
Worker
n8nio/n8n
Just deployed
Postgres
railwayapp-templates/postgres-ssl
Just deployed
/var/lib/postgresql/data
Redis
bitnami/redis
Just deployed
/bitnami
Main
n8nio/n8n
Just deployed
Deploy and Host N8N Main + Worker on Railway
N8N Main + Worker is a scalable automation setup using n8n, a workflow automation tool. The Main instance handles workflow orchestration, while the Worker instance processes jobs from a Redis-powered queue. This architecture allows you to handle higher loads and run workflows in parallel with better reliability.
About Hosting N8N Main + Worker
Hosting N8N Main + Worker on Railway gives you a ready-to-use environment with Postgres for persistent storage and Redis for queue execution. By default, only the Main instance is active in regular mode. If you don’t need queue execution, you can safely remove the Worker.
If you do need scaling, you simply switch the Main’s environment variable EXECUTIONS_MODE=queue
and deploy the Worker. Redis then manages tasks, offloading execution from the Main instance to the Worker, improving scalability and stability. This setup lets you start small and easily scale as workflow demand increases.
Common Use Cases
- Running heavy or long-running workflows in a distributed worker model
- Scaling automation tasks for enterprise workloads
- Ensuring reliability by offloading execution from the Main instance
Dependencies for N8N Main + Worker Hosting
- Postgres – Database for storing workflows, executions, and credentials
- Redis – Required for enabling and managing queue execution mode
Deployment Dependencies
Implementation Details
This template provides a ready-to-use setup with the following services:
- Postgres – Database for persisting n8n data
- Redis – Required for queue execution mode
- n8n (Main Instance) – Your primary n8n workflow automation instance
- n8n (Worker Instance) – Optional worker for queue mode
⚙️ Usage Instructions
1. Default Setup
By default, the Worker instance is disabled.
After deploying the template, you can safely remove the Worker deployment if you do not plan to use it.
2. Enabling Queue Mode
If you want to take advantage of queue execution mode:
- Go to the Main n8n instance
- Update the environment variable:
EXECUTIONS_MODE=queue
- Re-enable and deploy the Worker instance
- Your workflows will now be processed using Redis as a queue with worker execution.
✅ Summary
- Regular mode (default) → Only Main instance is required.
- Queue mode → Requires both Main and Worker instances, with
EXECUTIONS_MODE=queue
set in Main.
This setup gives you flexibility to start simple and scale when needed.
Why Deploy N8N Main + Worker on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying N8N Main + Worker on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Template Content