Insights · WhatsApp

n8n and WhatsApp: how to automate it, step by step.

n8n connects to WhatsApp through Meta's official Cloud API with two built-in nodes: the WhatsApp Trigger, which starts a workflow when a message arrives, and the WhatsApp Business Cloud node, which sends messages, templates and media. You need a Meta business app, a permanent token and a subscribed webhook. Below: the setup, an example booking flow, and the pitfalls that stop messages reaching n8n.

n8n + WhatsApp, in short

Connects to
Meta's WhatsApp Cloud API
Trigger node
Messages, template status, quality and account events
Action node
Send, Send Template, Send and Wait, media
Credentials
API key to send, OAuth2 for the trigger
Free-form replies
Within 24 hours of the customer's last message
The nodes

What n8n's WhatsApp nodes can do

Both nodes are part of n8n and talk to the official WhatsApp Business Platform.

NodeWhat it doesCredential
WhatsApp TriggerStarts a workflow on one of ten events: incoming messages, template status, quality and category updates, phone number name and quality updates, account review, account and business capability updates, securityWhatsApp OAuth2 (App ID and App Secret)
WhatsApp Business Cloud — messagesSend, Send Template, and Send and Wait for Response (approval, free text or a custom form, with an optional time limit)WhatsApp API (access token and WhatsApp Business Account ID)
WhatsApp Business Cloud — mediaUpload, download and delete media filesWhatsApp API
HTTP RequestAny Cloud API call the node does not offer, reusing the same credentialWhatsApp API
Setup

How to connect WhatsApp to n8n

  1. 01

    Create the Meta side

    A Meta developer account, a business portfolio and a Meta app with the WhatsApp product. The App Dashboard gives you a test number to build with before you move a real line (which numbers qualify).

  2. 02

    Make a permanent token

    The token shown in WhatsApp › API Setup is temporary: Meta says it expires quickly. In Business settings › System Users, create a system user, give it your app and generate a token with business_management, whatsapp_business_management and whatsapp_business_messaging.

  3. 03

    Add the sending credential

    In n8n, create a WhatsApp API credential with that access token and your WhatsApp Business Account ID. The WhatsApp Business Cloud node uses it.

  4. 04

    Add the trigger credential

    Create a WhatsApp OAuth2 credential: the App ID as Client ID and the App Secret as Client Secret, both from App settings › Basic. The WhatsApp Trigger node needs this one.

  5. 05

    Subscribe the app to the account

    Registering the webhook URL is not enough: your app must also be subscribed to your WhatsApp Business Account, or messages never reach n8n even when Meta's test events do.

  6. 06

    Test, then publish

    WhatsApp allows one webhook per app, so the test and production URLs overwrite each other. Unpublish the workflow while you test, and publish it again when you are done.

Example

A booking workflow, node by node

A restaurant wants WhatsApp bookings without staff typing every reply. The workflow below is the shape of it; the booking check runs against whatever system the hosts already use.

  1. WhatsApp Trigger (Messages). A guest writes “Table for four on Friday at 8?”.
  2. Switch. Text goes to the agent; a button reply goes straight to the matching branch; a voice note goes through a media download first.
  3. AI Agent with tools. It reads the request, checks availability through an HTTP Request to the booking system and drafts the answer. It may only act through those tools.
  4. WhatsApp Business Cloud — Send. The reply goes back inside the customer service window: “Friday 8 pm is free for four. Shall I book it?”.
  5. Send and Wait for Response. For a large group, the workflow asks the manager to approve before confirming, and resumes on their answer or when the time limit runs out.
  6. WhatsApp Business Cloud — Send Template. The reminder the day before is a utility template, since the window may have closed by then (how templates work).
The rule that shapes every workflow

The 24-hour window

When a customer messages or calls the business, Meta opens a 24-hour customer service window, reset by each new message or call. While it is open, the workflow can send any free-form message: text, media, buttons. Once it closes, only a pre-approved template can be sent. Meta also notes a known issue: in rare cases a message arrives but the business cannot answer it within the window.

In n8n, this means a branch that sends plain text after a delay — a follow-up, a reminder, a staff approval request to someone who has not written recently — will fail unless it uses Send Template. Bots also have to follow Meta's terms and offer a way to reach a person; our article on WhatsApp bots covers both.

Pitfalls that break n8n WhatsApp flows

  • “Bad request — please check your parameters” on Send Template. n8n's docs point to the template parameters: their type and their order. Map each variable explicitly with an Edit Fields (Set) node and give it a fallback value.
  • Media operations failing. In “Input Data Field Name” or “Property Name”, write the field name itself, such as data, not an expression.
  • A workflow that stops after a few hours. Check the token: Meta says user tokens from API Setup expire quickly and must be regenerated every few hours. Use the system user token from step 2.
  • Silence after a webhook fix. Do not send a DELETE to subscribed_apps to reset the webhook: n8n warns it unsubscribes your app from the account and stops all delivery.
  • Test and production fighting. One webhook per app: only one of the two URLs receives events at a time.

When a workflow tool is enough, and when it is not

n8n is a good fit for linear jobs: route a message, look something up, send a template, notify a team. It gets harder when the conversation itself is the product — memory across days, many tools, testing every change before customers see it, an audit of what the agent did and why. At that point, the agent can move into code while n8n keeps the jobs around it.

The agents we build for clients — bookings for a restaurant group in South Africa, voice-note bookings for gyms in East Africa — run on the business's own number on the official platform, act only through tools we write and hand over to staff. See WhatsApp AI agents, or the AI agents and automation we build.

Sources

About this article

Written by the Takat AI team from the projects we build and run. Facts about third-party services are checked against their official documentation on the date shown; figures come from the sources listed. Last reviewed .

FAQ

Frequently asked questions

  • Can n8n connect to WhatsApp?

    Yes. n8n has a WhatsApp Trigger node, which starts a workflow on incoming messages and account events, and a WhatsApp Business Cloud node, which sends messages, templates and media. Both use Meta's official WhatsApp Cloud API.

  • Which credentials does n8n need for WhatsApp?

    Two. The WhatsApp Business Cloud node uses an API credential with an access token and your WhatsApp Business Account ID. The WhatsApp Trigger node uses an OAuth2 credential with your Meta app's App ID and App Secret.

  • Why does my n8n WhatsApp Trigger receive no messages?

    n8n's docs name two causes: your app is not subscribed to your WhatsApp Business Account (registering the webhook URL alone does not do it), or the test URL replaced the production one, since WhatsApp allows a single webhook per app.

  • Can n8n send a WhatsApp message to anyone at any time?

    No. Free-form messages can only be sent within 24 hours of the customer's last message or call. Outside that window, the workflow has to use Send Template with a template Meta has approved.

  • How do I build a WhatsApp AI agent in n8n?

    Start the workflow with the WhatsApp Trigger, pass the message to an AI Agent node with the tools it may use, and send the answer with the WhatsApp Business Cloud node. Send and Wait for Response can put a person in the loop before an action is taken.

Outgrowing your workflow?

Tell us what your WhatsApp conversations need to do, and we will show you the agent we would build on your number.