AI Income LabJoin AI Income Lab ↗

Build guide · By · Published · Updated

n8n WhatsApp AI Agent: Trigger, OpenRouter, Meta

Diagram for the n8n WhatsApp agent guide: a WhatsApp trigger, an AI agent with memory, then a send-message node.
WhatsApp trigger → AI agent with memory → Send the reply

Quick answer: The workflow is two parts: a WhatsApp Business Cloud trigger that receives messages through a Meta webhook, and an AI agent with a chat model and memory that drafts the reply, then a WhatsApp node to send it. In the recording the Meta webhook test passed, but the send step still errored because the business number was awaiting verification.

This is a November 2025 build for a Facebook page with 176,000 followers, shown with its problems left in. It is a good outline of what the Meta side requires, but it is not a working reply bot yet. If you want a chat agent you can finish in one sitting, try the fictional-order exercise in the no-code agent builder guide first. New to agents in general? Read what is an AI agent.

1. The WhatsApp trigger

In n8n, search for WhatsApp, choose WhatsApp Business Cloud, and under triggers add the On messages node. It is a webhook, and it shows a test URL and a production URL. You need the test URL later in the Meta app.

The credentials need a client ID and client secret. Both come from a Meta for Developers app. The recording created an app with a messaging name and without a use case, then connected its Facebook page. The app ID is under app settings, Basic, and the client secret appears after you enter your password.

2. The AI agent, model and memory

Some tool links in this guide are affiliate links, so I may earn a commission or credit.

Drop in an AI agent node and connect a chat model. The recording chose OpenRouter because the speaker expected to send a lot of WhatsApp messages and did not want to burn through ChatGPT or Claude credits; one OpenRouter key reaches many models. The key is created under your OpenRouter profile in the keys section and pasted into n8n. OpenRouter lists models from OpenAI, Mistral, Meta Llama and Google. The recording picked GPT-4 and noted that GPT-5 had since appeared. The costs were not covered, so check the OpenRouter setup guide and the model’s price before you let it answer a busy inbox.

A memory node was added so the agent can refer to earlier messages in the same conversation.

3. The send-message node

A second WhatsApp node sends the reply. It needs an access token, generated in the Meta app by reconnecting your Facebook account, and the WhatsApp business account ID. Saving the credentials showed the connection tested successfully.

Running the node still failed with the message problem running workflow, please resolve outstanding issues before you activate it. The API setup page showed a problem registering the test number and said the number was unregistered. Meta was still reviewing the business information, which the recording expected to take two to three days. The speaker’s best guess was that the unverified number caused the error. That was never confirmed.

4. Test the webhook in Meta

In the Meta app’s configuration, open the webhook fields and turn on messages. Paste the callback URL from the n8n trigger (the test URL) and the verify token, and leave the client certificate off. Pressing Test sent a test message and Meta reported that the message webhook field was tested successfully. So the receive side worked in Meta, while the send side did not in n8n.

A test send to a Google Voice number then asked for a new access token and failed again with a registration error.

What this recording did not cover

A note from this site, not the recording: customer messages are personal data. Tell people when a bot is replying, and keep a person in charge of anything about money, health or complaints.

Watch the walkthrough

Watch on YouTube: This WhatsApp Workflow In N8N Saves Hours Every Week!. Also on this site with notes: the watch page.

FAQ

Does the automation work?

Not yet in the recording. The Meta webhook test passed, but the send step errored and the number was awaiting verification.

Why OpenRouter?

The speaker expected many messages and did not want to burn through ChatGPT or Claude credits. One OpenRouter key reaches many models. The recording picked GPT-4.

What does the memory node do?

It lets the agent refer to earlier messages in the same conversation.

What do I need from Meta?

A Meta for Developers app, the app ID and client secret, an access token, the WhatsApp business account ID, a registered number and a verified business.

Sources

Build the next one with AI Income Lab

Step-by-step courses, reusable templates, and a community that answers when you get stuck.

Members get the Claude Code & Skills and Codex Tutorials & Courses lessons.

Join AI Income Lab ↗From $29/month. Cancel anytime.
Join 2,900+ members building with AI

Not ready to join? Get the weekly build notes: new guides and tested builds in one short email.