The most requested flow is this: a WhatsApp message arrives, n8n decides what to do and replies. In practice there are three pieces: a webhook that receives the message from Evolution API, a decision step, and a request back to Evolution API sending the reply. This article builds the flow from the Evolution API side. For the n8n side, with more examples, see n8n and WhatsApp: a message flow.
What you need first
| 3 |
The two able to reach each other. If they share a Docker network, they talk by service name. If they are on different servers, they talk over HTTPS and a domain.
|
|
The flow, piece by piece
| 1 |
The Webhook node receives. Create a workflow with a Webhook node and copy the production address, not the test one. Paste it into the instance’s webhook in Evolution API, as in receiving messages by webhook.
|
|
| 2 |
A filter lets only the right things through. Incoming messages (not the ones you send), from one-to-one chats, and text. Look at the real data of a message to see which fields tell you this.
|
|
| 3 |
The decision. It can be a simple rule (the message contains a word), a lookup in a sheet or database, or a request to an AI model. Start with the simplest.
|
|
| 4 |
The HTTP Request node replies. It makes a request to Evolution API to send text to the number that wrote. The route and fields are in Evolution API’s documentation. The key lives in an n8n credential, never written into the node.
|
|
| 5 |
Activate the workflow. Only when active does the production address answer. Then send a message from another phone and watch the run in n8n’s executions list.
|
|
|
The endless loop. If the flow replies to every message and the reply comes back as an event, it answers itself forever and burns the number. The filter in the second step is not optional.
|
What goes wrong
| Symptom |
Likely cause |
| n8n receives nothing |
You are using the test address, or the workflow is not active. See n8n webhooks. |
| The HTTP Request node gives a connection error |
If Evolution API is in another container, localhost will not do: use the service name or the domain. |
| Authorisation error |
The key in the credential is wrong or in the wrong header. |
| It replies twice |
The webhook delivered the event twice. Keep the message identifier and ignore repeats. |
| Lost messages |
The workflow takes too long before answering the webhook. Answer at once and do the rest afterwards. |
Replying like a person
If the number is linked through Baileys, behaviour counts. Instant replies, all identical and at all hours, are the pattern WhatsApp’s defences look for. Add a short wait between receiving and replying (n8n has a node for it), vary the wording and limit the volume. If the business depends on the number, think about the Cloud API: see Baileys or the Cloud API.
|
Keep the workflow in n8n and make an exported copy. To avoid losing the credentials, keep n8n’s encryption key too. See backing up n8n.
|
|
Want to build this on a server of your own? n8n and Evolution API fit on one VPS.
See VPS servers
|
RECOMMENDED PRODUCT Web hosting with cPanel Domain and SSL included, daily backups and the panel you already know. from $6.59/mo (3-year plan, with coupon) See plans |