Railway

Deploy Evolution API with n8n

WhatsApp HTTP REST API with n8n automation, PostgreSQL and Redis.

Deploy Evolution API with n8n

Just deployed

/evolution/instances

/var/lib/postgresql/data

Just deployed

/home/node/.n8n

Just deployed

/data

Railway

Deploy and Host Evolution API With n8n on Railway

Evolution API With n8n is a ready-to-use Railway template for running a WhatsApp HTTP REST API backend with n8n automation. It combines Evolution API, n8n, PostgreSQL, Redis, and persistent volume storage so you can deploy a simple WhatsApp automation stack without manually wiring each service from scratch.

Imgur

About Hosting Evolution API With n8n

Hosting Evolution API With n8n on Railway gives you a fast way to run Evolution API together with n8n. Evolution API provides the WhatsApp HTTP REST API layer, while n8n gives you a visual workflow automation builder for connecting webhooks, APIs, apps, and custom automation logic.

PostgreSQL stores application data such as Evolution API instances, messages, contacts, sessions, and n8n workflow data. Redis provides caching for Evolution API. Railway handles the infrastructure layer, including service deployment, private networking, public domains, environment variables, and persistent storage.

This template is designed for users who want a simple WhatsApp automation stack that is easy to deploy, test, and extend. Once deployed, you can open the Evolution API Manager, connect a WhatsApp instance using the Baileys channel, open n8n, import the starter workflow, and send a WhatsApp message through Evolution API.

Common Use Cases

  • Sending WhatsApp messages from n8n workflows
  • Building webhook-based WhatsApp notifications
  • Connecting WhatsApp with APIs, forms, CRMs, AI agents, or internal tools
  • Running a lightweight WhatsApp automation backend for personal, agency, or SaaS projects
  • Testing Evolution API and n8n together on Railway before building larger automation systems

Included Services

This template includes:

  • Evolution API
  • n8n
  • PostgreSQL database
  • Redis cache
  • Railway volume for persistent Evolution API instance storage

Public and Private Services

After deployment, only the services that need browser or webhook access should be public.

Public services:

Evolution API  -> REST API, Manager, and WhatsApp integration endpoint
n8n            -> n8n editor UI and webhook URLs

Private services:

PostgreSQL     -> internal database only
Redis          -> internal cache only
Railway Volume -> mounted storage for Evolution API instance files

PostgreSQL and Redis do not need public domains. They should be accessed only through Railway private networking and Railway reference variables.

Dependencies for Evolution API With n8n Hosting

  • PostgreSQL database
  • Redis cache
  • Railway volume for persistent instance storage
  • Public domain for Evolution API
  • Public domain for n8n

Deployment Dependencies

Implementation Details

This template deploys Evolution API, n8n, PostgreSQL, Redis, and a mounted Railway volume. Environment variables are configured using Railway reference variables, so services can connect to each other through Railway private networking.

This template uses normal single-service n8n execution mode:

EXECUTIONS_MODE=regular

A separate n8n worker service is not required for this starter template. Redis is included mainly for Evolution API caching.

Persistent Volume Configuration

This template can use a Railway volume mounted into the Evolution API service to persist instance-related files.

Recommended volume configuration:

Mount Path: /evolution/instances
Initial Size: 5.00 GB
Resize: Live resize supported

The volume is mounted to the following directory inside the evolution-api service:

/evolution/instances

This mount is useful because Evolution API may store instance and session-related files in the instances directory. By using a persistent volume, the data in this path can remain available even when the service is redeployed or restarted. This helps reduce the risk of losing local instance data that should survive normal deployment changes.

The default volume size can start at 5.00 GB. Railway only charges for the amount of data stored, and the volume can be resized later using Live Resize when more storage is needed.

How to Access the Evolution API Manager

After deployment is complete, Railway will generate a public URL for your Evolution API service. You can use this public URL to confirm that the API is running and to find the Manager URL.

  1. Open the public URL of your Evolution API service.

    You should see a response similar to this:

    {
      "status": 200,
      "message": "Welcome to the Evolution API, it is working!",
      "version": "2.3.7",
      "clientName": "evolution_exchange",
      "manager": "http://XXXXXX.up.railway.app/manager",
      "documentation": "https://doc.evolution-api.com",
      "whatsappWebVersion": "2.3000.1040316331"
    }
    
  2. Copy the value from the manager field.

    Example:

    http://XXXXXX.up.railway.app/manager
    
  3. Open the Manager URL in your browser.

  4. When the Manager asks for the API Key Global, use the value of AUTHENTICATION_API_KEY from your Evolution API service.

    You can find it in Railway by opening your Evolution API service, then going to the Variables tab.

  5. Paste the AUTHENTICATION_API_KEY value into the API Key Global field.

  6. You are now inside the Evolution API Manager and can start creating or managing WhatsApp instances.

Create a WhatsApp Instance

After you are inside the Evolution API Manager, create a new instance.

Use this simple starter configuration:

Instance name: main
Channel: Baileys

The instance name main is used by the starter n8n workflow. If you use a different instance name, update the n8n workflow URL accordingly.

After creating the instance, scan the QR code using WhatsApp on your phone and wait until the instance status is connected.

Quick Test: Send a WhatsApp Message from n8n

After Evolution API is connected to WhatsApp, you can test the n8n integration by sending a WhatsApp message through Evolution API.

The simplest flow is:

n8n Manual Trigger
-> HTTP Request node
-> Evolution API
-> WhatsApp message sent

Option 1: Import Workflow from Gist

You can view the workflow JSON here:

https://gist.github.com/codestorm-official/8d3f621405724edead0eab16e2b42a6b#file-workflow-json

You can also import the workflow directly from this raw URL in n8n:

https://gist.githubusercontent.com/codestorm-official/8d3f621405724edead0eab16e2b42a6b/raw/baec8360f477bb81380104b960c0cce7a84d1192/workflow.json

In n8n:

  1. Open your n8n public URL.
  2. Create or open your n8n account.
  3. Import the workflow from the raw URL above.
  4. Open the HTTP Request node.
  5. Replace the Evolution API URL, API key, recipient number, and instance name if needed.
  6. Execute the workflow.

Option 2: Trigger n8n from Incoming WhatsApp Messages

You can also trigger n8n from incoming WhatsApp messages using the built-in Evolution API n8n integration.

Use this workflow:

https://gist.github.com/codestorm-official/947bfa521b8a3e12ac4dff90de8336f5#file-workflow-evolution-api-incoming-webhook-n8n-json

This flow works like this:

Incoming WhatsApp message
-> Evolution API n8n integration
-> n8n Webhook
-> n8n workflow

Before using this integration, make sure the Evolution API service has this variable:

N8N_ENABLED=true

Then redeploy or restart the Evolution API service.

In n8n, import the workflow from the Gist above, activate it, then copy the production webhook URL.

The production webhook URL should look like this:

https://YOUR-N8N-URL/webhook/evolution-incoming

For test mode, use the test webhook URL instead:

https://YOUR-N8N-URL/webhook-test/evolution-incoming

The test URL only works while n8n is waiting after you click Execute workflow.

Open Evolution API Manager:

Instance main -> Integrations -> + n8n

Use these settings:

Enabled: true
Webhook URL: https://YOUR-N8N-URL/webhook/evolution-incoming
Basic Auth: empty for simple testing
Trigger Type: Keyword
Keyword: halo
Trigger Operator: Contains
Expire in minutes: 0
Keep open: on
Debounce Time: 0

Save the integration, then send this WhatsApp message to the connected instance:

halo

If everything is connected, Evolution API will call the n8n webhook and the workflow will run.

Important Note

Asia/Jakarta is the default timezone for this template. You can change it if needed.

Example:

GENERIC_TIMEZONE=UTC
TZ=UTC

Why Deploy Evolution API With n8n on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway hosts your services, databases, cache, and storage so you do not have to manage server configuration manually.

By deploying Evolution API With n8n on Railway, you get a complete starter stack for WhatsApp automation: Evolution API for the WhatsApp HTTP REST API, n8n for workflow automation, PostgreSQL for data, Redis for cache, and Railway volume storage for persistent instance files.

This gives you a simple path from deployment to a working WhatsApp automation workflow in just a few steps.


Template Content

More templates in this category

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

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

Railway Templates
View Template
Prefect [Updated June ’26]
Prefect [June ’26] (ETL & Automation alternative to Airflow) Self Host

shinyduo