Railway

Deploy Evolution API with n8n

[Jun'26] WhatsApp automation platform using Evolution API, n8n & PostgreSQL

Deploy Evolution API with n8n

Just deployed

/evolution/instances

/var/lib/postgresql/data

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 for Evolution API, and persistent volume storage so you can deploy a simple WhatsApp automation stack without manually wiring each service from scratch.

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 is used by Evolution API to store application data such as instances, messages, contacts, and session-related records. n8n uses its default SQLite storage with a persistent volume, keeping the stack lighter while still preserving workflows, credentials, and local n8n data across redeployments.

Railway handles the infrastructure layer, including service deployment, private networking, public domains, environment variables, PostgreSQL, 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 for Evolution API
  • Railway volume for persistent Evolution API instance storage
  • Railway volume for persistent n8n 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 for Evolution API only
Railway Volume -> mounted storage for Evolution API and n8n files

PostgreSQL does not need a public domain. It should be accessed only through Railway private networking and Railway reference variables.

Dependencies for Evolution API With n8n Hosting

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

Deployment Dependencies

Implementation Details

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

Evolution API uses PostgreSQL:

DATABASE_PROVIDER=postgresql
DATABASE_CONNECTION_URI=${{Postgres.DATABASE_URL}}

n8n uses its default SQLite storage with persistent volume storage. This means PostgreSQL is not required for n8n in this starter template.

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 also not included, keeping the stack simpler and lighter for starter WhatsApp automation use cases.

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

This template intentionally keeps n8n lightweight by using SQLite with persistent volume storage. For heavier n8n production workloads, queue mode with PostgreSQL and Redis may be more appropriate.

Why Deploy Evolution API With n8n on Railway?

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

By deploying Evolution API With n8n on Railway, you get a simple starter stack for WhatsApp automation: Evolution API for the WhatsApp HTTP REST API, n8n for workflow automation, PostgreSQL for Evolution API data, and Railway volume storage for persistent service 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