---
title: "Deploy n8n — Workflow Automation"
description: "Deploy and automate workflows in 1-click. Zero-config n8n, it just works 🚀"
category: "Automation"
url: https://railway.com/deploy/n8n-platform
---

# Deploy n8n — Workflow Automation

Deploy and automate workflows in 1-click. Zero-config n8n, it just works 🚀

**[Deploy n8n — Workflow Automation on Railway](https://railway.com/template/n8n-platform)**

- **Creator:** INF Labs
- **Category:** Automation
- **Total deploys:** 1

## Template content

### Postgres https://devicons.railway.app/i/postgresql.svg

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:18

### Main https://devicons.railway.app/n8n

- **Image:** n8nio/n8n:latest
- **Health check:** /healthz
- **Public domain:** Yes

### Worker https://devicons.railway.app/n8n

- **Image:** n8nio/n8n:latest

### Redis https://cdn.sanity.io/images/sy1jschh/production/0ce0bfdcfbdbf69662b1116671f97c2dd788b655-157x157.svg

- **Image:** redis:8.2.1
- **Start command:** `/bin/sh -c "rm -rf $RAILWAY_VOLUME_MOUNT_PATH/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --save 60 1 --dir $RAILWAY_VOLUME_MOUNT_PATH"`

## Documentation

# Deploy and Host n8n — AI Workflow Automation Platform on Railway

n8n is a fair-code workflow automation platform for building powerful automations, API integrations, AI workflows, and autonomous agents. It combines a visual workflow builder with the flexibility to use custom code, webhooks, APIs, databases, and AI models — while giving you the option to run the platform on your own infrastructure.

## About Hosting n8n — AI Workflow Automation Platform

![N8N](https://imgur.com/vy7QGef.png)

This template deploys a production-oriented n8n stack using **PostgreSQL, Redis, a main n8n instance, and a dedicated worker**.

The main instance handles the web interface, API, webhooks, scheduling, and workflow orchestration. Workflow executions are distributed through Redis and processed by the worker using n8n's queue mode architecture. PostgreSQL provides persistent storage for workflows, credentials, execution data, and other application data.

Queue mode separates workflow execution from the main application process, making the deployment easier to scale as automation workloads grow. Additional workers can be added when more execution capacity is required.

### Included Architecture

| Service        | Purpose                                                                      |
| -------------- | ---------------------------------------------------------------------------- |
| **Main**       | n8n editor, API, webhooks, scheduling, and orchestration                     |
| **Worker**     | Processes queued workflow executions                                         |
| **Redis**      | Execution queue and communication between n8n processes                      |
| **PostgreSQL** | Persistent storage for workflows, credentials, executions, and configuration |

## Common Use Cases

* Build AI-powered workflows and autonomous AI agents
* Connect APIs, SaaS applications, databases, and internal services
* Automate lead processing, CRM updates, notifications, and reporting
* Build webhook-driven backend automation
* Automate ETL and data synchronization workflows
* Connect LLMs such as OpenAI, Anthropic, Gemini, and other AI providers
* Create scheduled jobs and background automation
* Build internal tools and business process automation
* Orchestrate microservices and API workflows
* Replace repetitive scripts and manual integration tasks

## n8n vs Other Workflow Automation Platforms

| Platform         | Deployment Model    | Self-Hosting    | Custom Code                            | AI Workflows | Best Fit                                                 |
| ---------------- | ------------------- | --------------- | -------------------------------------- | ------------ | -------------------------------------------------------- |
| **n8n**          | Cloud + self-hosted | ✅ Yes           | ✅ Strong                               | ✅ Yes        | Technical teams, APIs, AI workflows, advanced automation |
| **Zapier**       | Managed cloud       | ❌ SaaS-focused  | ⚠️ Available through platform features | ✅ Yes        | Fast SaaS automation and large app ecosystem             |
| **Make**         | Managed cloud       | ❌ Cloud-focused | ✅ Supported                            | ✅ Yes        | Visual business automation and complex scenarios         |
| **Activepieces** | Cloud + self-hosted | ✅ Yes           | ✅ Extensible                           | ✅ Yes        | Open-source automation and team-friendly self-hosting    |

n8n is particularly attractive when infrastructure control, custom API integrations, advanced workflow logic, or self-hosting are important. Its source is available under n8n's Sustainable Use License and Enterprise License rather than a conventional OSI open-source license.

Zapier positions itself as a managed AI automation and orchestration platform with a very large application ecosystem, while Make focuses heavily on visual AI automation. Activepieces provides both cloud and self-hosted deployment and publishes its core under the MIT license.

## Dependencies for n8n — AI Workflow Automation Platform Hosting

* **n8n Main** — serves the editor, API, webhooks, and orchestration layer
* **n8n Worker** — executes workflows from the queue
* **PostgreSQL** — persistent relational database
* **Redis** — queue backend for distributed workflow execution
* **Railway Private Networking** — internal communication between services
* **Persistent PostgreSQL storage** — keeps database data across deployments

n8n supports PostgreSQL for self-hosted deployments, and PostgreSQL is required instead of SQLite when running a scalable queue-mode architecture.

### Deployment Dependencies

* n8n Documentation: https://docs.n8n.io/
* n8n Queue Mode: https://docs.n8n.io/deploy/host-n8n/configure-n8n/scaling/enable-queue-mode/
* n8n GitHub: https://github.com/n8n-io/n8n
* Railway n8n Guide: https://docs.railway.com/guides/n8n
* Railway Private Networking: https://docs.railway.com/networking/private-networking

### Implementation Details

This template uses n8n's **queue execution mode**.

```text
                    ┌──────────────┐
                    │    Users     │
                    └──────┬───────┘
                           │
                           ▼
                    ┌──────────────┐
                    │   n8n Main   │
                    │ UI / API /   │
                    │ Webhooks     │
                    └──────┬───────┘
                           │
                ┌──────────┴──────────┐
                │                     │
                ▼                     ▼
        ┌──────────────┐      ┌──────────────┐
        │ PostgreSQL   │      │    Redis     │
        │ Persistent   │      │ Execution    │
        │ Data         │      │ Queue        │
        └──────────────┘      └──────┬───────┘
                                     │
                                     ▼
                              ┌──────────────┐
                              │ n8n Worker   │
                              │ Workflow     │
                              │ Execution    │
                              └──────────────┘
```

In queue mode, the main n8n process places workflow execution jobs onto Redis and workers consume those jobs for processing. This architecture allows execution capacity to be increased by adding workers without coupling all workload to the main editor and webhook process.

For production deployments, keep the same n8n encryption key across the main instance and all workers so encrypted credentials remain readable by every execution process.

## Why Deploy n8n — AI Workflow Automation Platform 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 — AI Workflow Automation Platform 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.

## Similar templates

- [N8N Main + Worker](https://railway.com/deploy/n8n-main-worker) — Deploy and Host N8N with Inactive worker.
- [Evolution API with n8n](https://railway.com/deploy/evolution-api-with-n8n) — Automate WhatsApp workflows with Evolution API, n8n, and Postgres.
- [Postgres Backup](https://railway.com/deploy/postgres-s3-backups) — Cron-based PostgreSQL backup to bucket storage

Open this page in a browser: https://railway.com/deploy/n8n-platform
