Quick answer
- Yes, n8n can run a WhatsApp AI agent: WhatsApp Trigger → IF (drop status updates) → AI Agent → WhatsApp Business Cloud “Send message”.
- Most of the work is on Meta’s side: a developer app, a business portfolio, a Cloud API number, a permanent token, and a public HTTPS webhook.
- Costs add up: n8n, Meta’s per-message fees, and AI usage. A no-code tool like Wapzen does the same job on your existing number, currently free.
What you’re building
An n8n WhatsApp AI agent is a workflow that runs every time your number receives a message. Five pieces pass the message along:
- Meta’s WhatsApp Cloud API receives the customer’s message and sends it to a webhook.
- The WhatsApp Trigger node is that webhook, and starts the workflow.
- An IF node lets real messages through and drops status updates.
- The AI Agent node writes the reply, with a chat model, a memory per customer, and tools such as a knowledge base search.
- The WhatsApp Business Cloud node sends the reply back to the customer.
It’s a flexible setup, and the build is mostly on Meta’s side, not n8n’s. If you want the result without the build, skip to the no-code option.
What you need first
- A Meta developer account and a Meta business portfolio (formerly Business Manager).
- A Meta app with the WhatsApp product added, switched to Live mode. Meta gives you a test number that can message a few recipient numbers you verify; for real customers you add your own number.
- A phone number for the Cloud API. It can’t be active in the regular WhatsApp app at the same time, unless it’s a WhatsApp Business app number onboarded through coexistence.
- n8n reachable over HTTPS, either n8n Cloud or a self-hosted instance with a domain and certificate, because Meta only sends webhooks to public HTTPS URLs.
- An AI provider key, for example OpenAI or Anthropic, billed by usage.
Build the workflow, step by step
1. Create the two credentials
The trigger and the sending node use different credentials. For the WhatsApp Trigger, create an OAuth credential: the Client ID is your Meta app’s App ID and the Client Secret is its App Secret, both under App settings › Basic. For the WhatsApp Business Cloud node, create an API credential with an access token and your WhatsApp Business Account ID, from WhatsApp › API Setup.
The token on the API Setup page is temporary and expires within a day. For anything beyond a test, create a system user in your business portfolio and generate a permanent token with the WhatsApp messaging and management permissions.
2. Add the WhatsApp Trigger
Add the node, pick the OAuth credential, and choose the Messages update. Your Meta app must also be subscribed to your WhatsApp Business Account, or messages never reach n8n; when you check the subscription, use the Business Account ID, not the phone number ID.
3. Filter out status updates
Depending on your n8n version and trigger options, delivery updates (sent, delivered, read) can arrive on the same trigger as messages. Add an IF node that continues only when the item contains a message, or turn status updates off in the trigger if your version has that option. Otherwise the agent tries to answer its own receipts.
4. Add the AI Agent
Connect an AI Agent node and give it a chat model (OpenAI, Anthropic, or another), a system message, and a memory. Key the memory on the customer’s number so every customer gets their own conversation. In the trigger’s output, the fields usually look like this; check them against your own output panel:
// Message text
{{ $json.messages[0].text.body }}
// Sender's number (the reply's recipient)
{{ $json.messages[0].from }}
// Memory session key
{{ $json.contacts[0].wa_id }}For answers from your own documents, attach a vector store tool (Pinecone, Supabase, Qdrant, or n8n’s simple in-memory store for testing) and build a second workflow that loads your documents into it.
5. Send the reply
Add a WhatsApp Business Cloud node with the Send message operation. Choose your phone number ID, set the recipient to the sender’s number, and set the text to the agent’s output.
6. Publish and test
Activate the workflow so the production webhook is registered, then message your number from another phone. WhatsApp allows one webhook per Meta app, so switching between n8n’s test and production URLs overwrites the other: when you test, production stops receiving messages.
Common problems and how to fix them
- Nothing arrives. Usually the app isn’t subscribed to your WhatsApp Business Account. A test event from Meta’s dashboard can still reach n8n, so a passing test doesn’t rule this out.
- It works in test but not in production, or the reverse. That’s the one-webhook-per-app limit. Re-activate the workflow you want live.
- It stopped after a day. The temporary access token expired. Switch to a system user token.
- Executions run out fast. Each webhook is an execution. If status updates reach the workflow, one customer message can cost up to four: the message plus sent, delivered, and read for the reply. At that rate, Starter’s 2,500 executions cover roughly 600 customer messages a month.
- Voice notes and photos get no answer. Branch on the message type, download the media, and transcribe audio before the agent.
- Can’t message a customer first. Outside the 24-hour window after a customer’s last message, the Cloud API only sends approved templates.
What it costs to run
n8n is the smallest line on the bill. The full picture:
| What you pay | |
|---|---|
| n8n | Cloud Starter about €24 a month for 2,500 executions; Pro about €60 for 10,000. Self-hosting is free, plus your server. |
| Meta | Per-message fees on the Cloud API: templates always, and service replies after 1,000 a month per number since 1 October 2026. |
| AI model | Pay-as-you-go to OpenAI, Anthropic, or another provider, per token. |
| Knowledge base | A vector database such as Pinecone, Supabase, or Qdrant, often free at small sizes. |
| Your time | Building, monitoring, and fixing the workflow when tokens, webhooks, or APIs change. |
For Meta’s rates by country and three worked monthly bills, see WhatsApp Business API pricing. n8n’s plans change too, so check n8n’s pricing page before you commit.
The no-code option: the same agent, without the build
If the goal is an AI agent that answers your WhatsApp from your own information, and not the workflow itself, Wapzen gives you that without a Meta app, webhooks, or a vector database. You create an agent, upload your documents, choose a GPT or Claude model, and scan a QR code with the number you already use.
| Build it in n8n | Wapzen | |
|---|---|---|
| Setup time | An afternoon to a few days | About 15 minutes |
| Meta developer app and Business API | Required | Not needed |
| Phone number | A number on the Cloud API, or a Business app number through coexistence | Your existing number, linked by QR code |
| Knowledge base | Build a vector store and an ingestion workflow | Built in: upload text, PDF, or Word |
| Conversation history | Configure memory and storage | Every thread saved in the dashboard |
| WhatsApp calls | A separate project | AI voice agent answers and makes calls |
| Custom logic | Anything you can wire up | API tools the agent calls mid-conversation |
| Running cost | n8n, Meta’s message fees, and AI usage | Currently free, AI models included |
| Official Meta route | Yes | No, it’s a linked device |
You can also use both. A Wapzen API tool can call an n8n webhook mid-conversation, so n8n handles the back office (checking an order, adding a row to a sheet, notifying your team) while Wapzen handles WhatsApp.
Wapzen is an independent product, not made by Meta or WhatsApp, and isn’t Meta’s official API route: it links your number as a device. Use it to answer people who contact you, never to message people who didn’t.
Which should you pick?
Choose n8n if…
- You need custom, multi-step logic across many apps
- You want Meta’s official API, with templates and broadcasts
- You have the time to build and maintain the workflow
Choose Wapzen if…
- You want an AI agent answering your current number today
- You want AI to answer and make WhatsApp calls too
- You’d rather not run a Meta app, hosting, or pay per message
New to chatbots? Start with what a WhatsApp chatbot is, or follow the no-API setup guide.
Frequently asked questions
Can n8n connect to WhatsApp?
Yes. n8n's official WhatsApp Trigger and WhatsApp Business Cloud nodes connect to Meta's WhatsApp Cloud API. You need a Meta developer account, a Meta business portfolio, and a Meta app with the WhatsApp product, and your n8n instance must be reachable from the internet over HTTPS.
Can I use n8n with my existing WhatsApp number?
With the official nodes, the number has to be on the Cloud API. A WhatsApp Business app number can join the API through Meta's coexistence feature and keep working in the app. Some people connect n8n to unofficial, self-hosted WhatsApp gateways instead; those aren't supported by Meta or n8n.
Is n8n free for a WhatsApp chatbot?
Self-hosted n8n is free, and n8n Cloud starts at about €24 a month. Either way you also pay Meta's per-message fees on the Cloud API and your AI provider's usage, and a hosted server if you self-host.
How many executions does a WhatsApp bot use in n8n?
Every webhook that starts the workflow is one execution. A customer message is one; if delivery status updates (sent, delivered, read) also reach the workflow, each reply can add up to three more. Filter status updates as early as possible so they don't use up your plan.
Can an n8n WhatsApp agent answer voice notes?
Yes, with extra steps. Branch on the message type, download the audio with the WhatsApp node's media operation, send it to a speech-to-text model, and pass the text to the AI Agent.
Do I need to code to build a WhatsApp AI agent in n8n?
Not much, but it's technical. You'll configure a Meta app, tokens, and webhooks, and write a few n8n expressions. If you want the agent without the build, a no-code tool such as Wapzen connects your number with a QR code.