Automating Workflows with n8n and Evolution API

In this guide, we’ll walk through setting up the Evolution API in n8n, configuring authentication, and building a simple workflow to extract, transform, and send data automatically. By the end, you'll have a functional integration that saves time and reduces manual effort. Let’s dive in!

Automating Workflows with n8n and Evolution API

Evolution API

Evolution API began as a WhatsApp controller API based on CodeChat, which in turn implemented the Baileys library. While originally focused on WhatsApp, Evolution API has grown into a comprehensive platform supporting multiple messaging services and integrations. We continue to acknowledge CodeChat for laying the groundwork.

Today, Evolution API is not limited to WhatsApp. It integrates with various platforms such as Typebot, Chatwoot, Dify, and OpenAI, offering a broad array of functionalities beyond messaging. Evolution API supports both the Baileys-based WhatsApp API and the official WhatsApp Business API, with upcoming support for Instagram and Messenger.

Community Node

The evolution API is much easier to mangage and use when you install the custom node for it. See N8N documentation regarding installing community nodes.

The community node you want is: n8n-nodes-evolution-api.

Creating Evolution Instance

  • Process:
    • Create New Instance using n8n-nodes-evolution-api.
    • Clean up returned base64 string to remove type.
    • Convert to PNG file.
    • View or upload PNG to pair with WhatsApp

Evolution_API_Create_Instance.png

Webhook Node

You should create a webhook node to receive your new WhatsApp events, this is just a standard webhook node. Take note of the URL as you will need this to update the Evolution API Instance to send events to.

Webhook_Node.webp

Adding Webhook to Instance

To receive message upsert events you need to tell Evolution API to send the message uperts to your defined webhook. This can be done via the custom Evolution API or via a HTTP Post request.

  • Information Required
    • Instance Name
    • Webhook URL
    • Events you want to send

Evolution API can send multiple events to your webhook, they can either all be to the same webhook or they can be to the defined webhook + event name if you want a seperate webhook for each defined event.

The following is the configuration for configuring a single event (message_upsert) which is a new WhatsApp message.

CreateWebHook.webp

See the documenation for more details on the webhook. Webhooks - Evolution AI Documentation

N8N Workflow Create Instance and View QRCode