
Deploy Evolution API Dify
WhatsApp AI agents built in Dify via Evolution API
Just deployed
/var/lib/postgresql/data
evolution-api
Just deployed
/evolution/instances
Redis
Just deployed
/data
Deploy and Host self hosted Evolution API Dify (Open-Source WhatsApp API for Dify AI Agents) on Railway
This template runs Evolution API v2 with its built-in Dify integration, so a Dify chatbot or agent can answer on a WhatsApp number you control.
About Hosting Evolution API Dify open-source software on Railway (self hosted Evolution API with Dify bots template)
This template runs the official evoapicloud/evolution-api v2.3.7 image on port 8080, with the manager UI at /manager.
Your Dify app stays where it already lives, on Dify Cloud or your own self-hosted Dify, since Evolution API calls its API base URL with the app key.
Why Deploy Evolution API Dify, the WhatsApp Business Platform alternative on Railway (Railway Free Trial)
The official WhatsApp Business Platform needs business verification, approved templates and per-conversation fees.
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 Evolution API Dify 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.
Railway vs Other Hosting Providers and VPS for Evolution API Dify self hosting
Railway gives you Evolution API, Postgres and Redis as linked services, while a VPS leaves the install, patching and backups to you.
| Provider | What You Get with Railway | What You Get with the Other Provider |
|---|---|---|
| DigitalOcean | Three linked services with a public domain and the session volume already wired. | A cheap Droplet with root access, where you install Docker, Postgres and Redis yourself. |
| AWS | Per-service billing and quick redeploys without IAM or VPC setup. | Deep networking and scaling control, at the cost of more configuration. |
| Hetzner | Automatic restarts and a public manager URL without babysitting a box. | Low monthly prices for dedicated resources, but you own patching and firewall rules. |
Railway costs more per GB of RAM than a bare VPS, so it pays off when you'd rather not run the server yourself.
Common Use Cases for hosted Evolution API Dify
- A Dify support agent on WhatsApp: Point a Dify chatbot or agent at a WhatsApp number so customers can ask questions in plain language. Set triggerType to all and use expire so quiet conversations reset.
- A keyword-triggered FAQ bot: Use triggerType keyword with triggerOperator startsWith and a value like "pricing" so the Dify app only answers when asked. Everything else stays with your team.
- A Dify workflow that books appointments: Create the instance with botType workflow and let it collect a date and service over several turns. Keep keepOpen on so the session survives between messages.
- Ignoring groups with ignoreJids: Add group JIDs to ignoreJids in your Dify settings so the bot never replies in team or family groups. Check this before you go live.
- Pausing the bot when a human replies from the phone: Turn on stopBotFromMe so a message your team sends from the linked phone pauses the Dify session. You can also call the change-status endpoint to hand a chat to a person.
Dependencies for Evolution API Dify Docker hosted on Railway
This template runs three services: the Evolution API container, a Postgres database, and a Redis cache.
Deployment Dependencies for Managed Evolution API Dify Service (WhatsApp Chatbot)
- evolution-api: image evoapicloud/evolution-api:v2.3.7, public port 8080, health check on /, volume mounted at /evolution/instances for WhatsApp session files.
- Postgres: DATABASE_CONNECTION_URI set from the Railway Postgres DATABASE_URL, with DATABASE_SAVE_* set to true so instances, messages, contacts and chats are stored.
- Redis: CACHE_REDIS_URI set from the Railway Redis REDIS_URL, used as the cache layer.
Implementation Details for Evolution API Dify (Using Evolution API official docker image)
The template generates AUTHENTICATION_API_KEY, a 32 character global key you send as the apikey header on every request.
How does Evolution API Dify compare against other ways to connect a Dify app to WhatsApp
Evolution API vs WhatsApp Business Platform (Meta Cloud API Alternative)
- Official Status: Meta's WhatsApp Business Platform is the official Cloud API and the safer choice for verified business sending at scale. Evolution API uses Baileys (unofficial) or the Cloud API, so you pick the trade-off.
- Setup Effort: Meta needs business verification and approved templates before you message customers first. Evolution API lets you scan a QR code on a dedicated number and test the same day.
- Where Meta Wins: Baileys numbers can be banned for bulk or spammy sending. For a high-volume support line, use the Cloud API.
Evolution API vs WAHA (WhatsApp HTTP API Alternative)
- Self-Hosted Peers: WAHA is also self-hosted, so both fit a run-it-yourself plan.
- Dify Wiring: Evolution API ships a built-in Dify integration with trigger rules, session timers and handoff. With WAHA you write and maintain that glue yourself.
- Licensing: WAHA's core is free with a paid Plus edition. Check each project's license terms before you commit.
Evolution API Dify vs Evolution API OpenAI bot (Built-in Chatbot Alternative)
- Bot Source: The built-in OpenAI bot calls OpenAI directly and needs no Dify app. The Dify integration routes messages to a Dify chatbot, agent, text generator or workflow you design in Dify.
- Workflow Control: A Dify workflow adds retrieval over your docs, branching and tools without touching the WhatsApp side. For a plain prompt-and-reply bot, the OpenAI option is quicker.
Evolution API vs Twilio WhatsApp (Managed WhatsApp API Alternative)
- Hosting Model: Twilio is managed, so there is no server to run. Evolution API is self-hosted, so you own uptime and session files.
- Per-Message Fees: Twilio adds its own per-message fee on top of Meta's charges, while Evolution API adds only your hosting bill. Check current rates on both pricing pages.
- Where Twilio Wins: Compliance tooling and support contracts are easier to get, and its official path avoids the ban risk of unofficial clients.
How to use Evolution API Dify (the OSS WhatsApp API)?
- Open
https://your-railway-domain/managerand log in with yourAUTHENTICATION_API_KEY. 2. Create an instance and scan the QR code under WhatsApp Linked devices. 3. Copy your Dify app's API key (starts withapp-) and its API base URL, such ashttps://api.dify.ai/v1for Dify Cloud. 4.
curl -X POST https://your-railway-domain/dify/create/my-instance \
-H "apikey: YOUR_AUTHENTICATION_API_KEY" \
-H "Content-Type: application/json" \
-d '{"enabled": true, "botType": "chatBot", "apiUrl": "https://api.dify.ai/v1", "apiKey": "app-xxxxxxxx", "triggerType": "keyword", "triggerValue": "#help"}'
How to self host Evolution API Dify on other VPS Services (Evolution API self hosting guide)
Running this on your own VPS works like the Railway template, but you wire up Postgres and Redis yourself.
Clone the Repository
Pull the official source and move into the folder.
git clone https://github.com/EvolutionAPI/evolution-api.git
cd evolution-api
Install Dependencies
Everything runs as Docker images, so confirm Compose v2 is available.
docker compose version
Configure Environment Variables
Copy the example file, then set AUTHENTICATION_API_KEY to a long random string, DATABASE_PROVIDER=postgresql, DATABASE_CONNECTION_URI for your Postgres, CACHE_REDIS_URI for your Redis, and SERVER_URL=https://your-domain.
cp .env.example .env
Start the Evolution API Dify Application
Start the stack in the background and watch the logs for startup.
docker compose up -d
docker compose logs -f evolution-api
Then open https://your-domain/manager, log in with your global API key, and scan the QR code to pair WhatsApp.
Official Pricing of Evolution API Dify (Evolution API pricing)
Evolution API itself is free and open source, so there's no license fee to pay for the Dify integration.
Evolution API Dify cloud vs self hosted comparison (Pricing, features, costs, and more)
Self hosting Evolution API with its Dify integration costs you two things: the Railway bill for the API and its database, and the Dify app you already run, whether on Dify Cloud or your own install.
Monthly cost of self hosting Evolution API Dify on Railway
Expect roughly 5-15 USD per month on Railway for the Evolution API service plus Postgres and Redis at light use.
System Requirements for Hosting Evolution API Dify on a VPS
Evolution API runs as a Node.js service, so a small VPS with 1-2 GB of RAM and a few GB of disk handles a single instance.
Frequently Asked Questions (FAQs)
Can I use Dify Cloud, or do I need my own self-hosted Dify?
Either works.
Which botType should I pick?
Match the botType to how you built the app in Dify: chatBot for chat apps, textGenerator for single-shot text apps, agent for agent apps, and workflow for workflow apps.
How do sessions expire?
The expire setting closes an idle session after the number of minutes you set, so the next message starts a fresh conversation.
How do I stop the bot so a human can take over?
Call POST /dify/changeStatus/{instance} with the remoteJid of the chat and a status that pauses or closes the session.
Will the bot answer in group chats?
Not unless you want it to.
Does the WhatsApp session survive redeploys?
Yes, as long as the /evolution/instances volume stays attached, because the WhatsApp session files live there. Keep the volume attached; it holds all state.
Template Content
evolution-api
evoapicloud/evolution-api:v2.3.7Redis
redis:8.2