Deploy WhatsApp Automation Stack
[Jun'26] Minimal WhatsApp automation with Evolution API and n8n
evolution-api
Just deployed
/evolution/instances
Just deployed
/data
Deploy and Host WhatsApp Automation Stack on Railway
WhatsApp Automation Stack is a minimal Railway template for running a self-hosted WhatsApp HTTP REST API backend with n8n workflow automation. It combines Evolution API, n8n, and persistent volume storage for both services, giving you a lightweight WhatsApp automation stack without PostgreSQL, Redis, or extra infrastructure.
About Hosting WhatsApp Automation Stack
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
- Creating a low-cost WhatsApp automation stack without external database services
Included Services
This template includes:
- Evolution API
- n8n
- Railway volume for persistent Evolution API instance storage
- Railway volume for persistent n8n data 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 storage:
Evolution API Volume -> mounted storage for Evolution API instance files
n8n Volume -> mounted storage for n8n data, workflows, credentials, and internal files
This template does not include PostgreSQL or Redis. Both Evolution API and n8n run with persistent local storage through Railway volumes.
Dependencies for WhatsApp Automation Stack Hosting
- Public domain for Evolution API
- Public domain for n8n
- Railway volume for Evolution API
- Railway volume for n8n
Deployment Dependencies
- Evolution API Documentation
- Evolution API GitHub Repository
- n8n Documentation
- Railway Documentation
- Railway Volumes
Implementation Details
This template deploys Evolution API, n8n, and two persistent Railway volumes. Environment variables are configured using Railway reference variables, so n8n can call Evolution API through its public URL or internal Railway networking depending on your setup.
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 not included:
CACHE_REDIS_ENABLED=false
PostgreSQL is not included. This keeps the stack simpler and lighter for starter WhatsApp automation use cases.
Important Storage Note
This template is intentionally minimal and does not include PostgreSQL. That makes it cheaper and easier to deploy, but it also means it is best suited for starter, personal, testing, demo, and lightweight automation workloads.
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.
-
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" } -
Copy the value from the
managerfield.Example:
http://XXXXXX.up.railway.app/manager -
Open the Manager URL in your browser.
-
When the Manager asks for the API Key Global, use the value of
AUTHENTICATION_API_KEYfrom your Evolution API service.You can find it in Railway by opening your Evolution API service, then going to the Variables tab.
-
Paste the
AUTHENTICATION_API_KEYvalue into the API Key Global field. -
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:
- Open your n8n public URL.
- Create or open your n8n account.
- Import the workflow from the raw URL above.
- Open the HTTP Request node.
- Replace the Evolution API URL, API key, recipient number, and instance name if needed.
- 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.
Recommended Environment Variables
Evolution API
PORT="8080"
SERVER_URL="https://${{RAILWAY_PUBLIC_DOMAIN}}"
AUTHENTICATION_API_KEY="${{secret(64, \"abcdef0123456789\")}}"
AUTHENTICATION_EXPOSE_IN_FETCH_INSTANCES="true"
N8N_ENABLED="true"
CACHE_REDIS_ENABLED="false"
CACHE_LOCAL_ENABLED="true"
LANGUAGE="en"
CONFIG_SESSION_PHONE_CLIENT="Evolution API"
CONFIG_SESSION_PHONE_NAME="Chrome"
QRCODE_LIMIT="30"
n8n
TZ="Asia/Jakarta"
PORT="5678"
N8N_HOST="${{RAILWAY_PUBLIC_DOMAIN}}"
N8N_PORT="5678"
WEBHOOK_URL="https://${{RAILWAY_PUBLIC_DOMAIN}}"
N8N_PROTOCOL="https"
N8N_LOG_LEVEL="info"
N8N_LOG_OUTPUT="console"
N8N_PROXY_HOPS="1"
EXECUTIONS_MODE="regular"
GENERIC_TIMEZONE="Asia/Jakarta"
N8N_RUNNERS_MODE="internal"
N8N_RUNNERS_ENABLED="true"
EVOLUTION_API_KEY="${{evolution-api.AUTHENTICATION_API_KEY}}"
EVOLUTION_API_URL="https://${{evolution-api.RAILWAY_PUBLIC_DOMAIN}}"
N8N_SECURE_COOKIE="true"
N8N_ENCRYPTION_KEY="${{ secret(32, \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\") }}"
N8N_EDITOR_BASE_URL="https://${{RAILWAY_PUBLIC_DOMAIN}}"
EXECUTIONS_DATA_PRUNE="true"
EXECUTIONS_DATA_MAX_AGE="336"
EXECUTIONS_DATA_PRUNE_MAX_COUNT="10000"
EXECUTIONS_DATA_SAVE_ON_ERROR="all"
EXECUTIONS_DATA_SAVE_ON_SUCCESS="none"
EXECUTIONS_DATA_SAVE_MANUAL_EXECUTIONS="true"
N8N_DIAGNOSTICS_ENABLED="false"
N8N_HIRING_BANNER_ENABLED="false"
N8N_COMMUNITY_PACKAGES_ENABLED="true"
N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE="true"
N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS="true"
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 WhatsApp Automation Stack on Railway?
By deploying WhatsApp Automation Stack on Railway, you get a minimal starter stack for WhatsApp automation: Evolution API for the WhatsApp HTTP REST API, n8n for workflow automation, and Railway volume storage for persistent data.
This gives you a simple path from deployment to a working WhatsApp automation workflow in just a few steps, without adding PostgreSQL, Redis, workers, or unnecessary services.
Template Content
evolution-api
evoapicloud/evolution-api:latest