top of page

How to Connect WhatsApp to n8n for Auto-Replies

11 hours ago
5 min read

WhatsApp is where many customers already expect to reach a small business, and answering the same five questions by hand every day gets old fast. With n8n you can connect WhatsApp to a workflow that sends an instant reply, sorts messages by topic or time of day, and passes anything tricky to a person. This guide walks through the setup on Meta's side, the credentials n8n needs, a simple auto-reply workflow, and the rules that decide when you can reply and what it costs.

A quick note on how we wrote this: the steps follow n8n's and Meta's official documentation, checked on October 19, 2026. We have not run this exact workflow end to end on a live business number, so treat it as a guide and test it on your own account before you rely on it with customers.

How to connect WhatsApp to n8n for automatic replies: Meta app, WhatsApp Trigger, smart replies and human handoff

This post may contain affiliate links. If you buy through them, we may earn a commission at no extra cost to you.

What you need before you start

  • An n8n instance reachable from the internet over HTTPS, because Meta has to deliver incoming messages to a webhook URL. n8n Cloud works out of the box; a self-hosted instance needs a domain and SSL. Not sure which to use? See n8n Cloud vs Self-Hosted: Costs and Trade-offs.

  • A Meta developer account and a Meta business portfolio (the new name for Business Manager).

  • A phone number for the WhatsApp Business Platform. Check Meta's current requirements before you start: a number that is already active in the regular WhatsApp or WhatsApp Business app usually has to be moved over first.

  • Basic n8n knowledge. If you have never built a workflow, start with n8n for Beginners.

Step 1: Set up the Meta app

n8n's credential guide lists these steps on Meta's side:

  1. Create a Meta developer account and verify it by phone.

  2. Create a Meta business portfolio.

  3. Create a business app in the Meta developer dashboard and add the WhatsApp product to it.

  4. In App settings > Basic, add the URLs of your Privacy Policy and Terms of Service pages.

  5. Switch the app mode to Live.

  6. Open WhatsApp > API Setup, generate an access token and copy your WhatsApp Business Account ID. Note the Phone Number ID shown there too; the send step needs it.

One thing to plan for: the token generated on the API Setup screen is meant for testing. For a workflow that runs every day, follow Meta's documentation on creating a long-lived token for a system user, so your replies do not stop when a temporary token expires.

Step 2: Add the two credentials in n8n

WhatsApp uses two different credentials in n8n, which confuses many people the first time:

  • WhatsApp API credential (for the WhatsApp Business Cloud node that sends messages): paste the Access Token and the Business Account ID.

  • WhatsApp OAuth credential (for the WhatsApp Trigger that receives messages): use the App ID as the Client ID and the App Secret as the Client Secret. Both are in App settings > Basic in your Meta app.

Step 3: Build the auto-reply workflow

WhatsApp auto-reply workflow in n8n in five steps: message in, trigger, decide, reply and human handoff
  1. WhatsApp Trigger. Add the node, pick your OAuth credential and tick the Messages event. The trigger has no catch-all option, so tick only the events you need.

  2. Filter out non-messages. The same webhook can also carry delivery and read updates. Add an IF node that continues only when the incoming data contains a customer message, so the workflow does not reply to status updates.

  3. Decide what to send. Use a Switch node to route by keyword or by time. Keep the first version simple: one branch for opening hours, one for prices or a booking link, one for messages outside business hours, and a default branch.

  4. Send the reply. Add the WhatsApp Business Cloud node with the Send operation, your Phone Number ID and the text for that branch. Set the recipient to the sender's number from the trigger output (in many versions it sits under messages[0].from, but field names can vary, so open the trigger's test output and map the field you actually see).

  5. Hand off to a person. On the default branch, send a short holding reply and alert your team by email or Slack with the customer's number and message. If the conversation is a new lead, you can also log it the way we show in How to Send Website Leads to Your CRM Automatically with n8n.

Once the basic version works, you can add an AI step that drafts answers from your FAQ. Keep a person in the loop for anything that is not a routine question; our guide to using AI for customer service covers where that line should sit.

Step 4: Test, then go live

WhatsApp allows only one registered webhook per app. When you switch between n8n's test URL and production URL, the newer registration replaces the older one, and if the workflow is already published, events reach only one of the two. n8n's workaround is to unpublish the workflow, test with the test URL, then publish it again. While it is unpublished, real customer messages are not processed, so test outside business hours.

Send yourself a few messages that hit each branch, including one at a time that should trigger the after-hours reply, and check the executions list in n8n for errors before you announce the number.

The 24-hour rule and what replies cost

  • Free-form replies work only inside a 24-hour customer service window that opens when the customer messages you. Outside that window, the business can only start a conversation with a message template that Meta has approved.

  • Since October 1, 2026, Meta charges per delivered service message, at the same rate as utility messages in each country and with no volume tiers. Before that, replies inside the window had been free since November 2024.

  • A payment method must be on file, either with Meta or with your solution provider; Meta said it would stop delivering service messages for accounts without one.

  • Messages that start from a click-to-WhatsApp ad still get a free entry window, according to Meta's pricing page.

Rates vary by country and Meta can update them quarterly, so check Meta's current rate card for the countries your customers are in. An auto-reply bot that answers every message twice can double the bill, which is one more reason to keep the first version simple.

Keep it helpful and safe

  • Only message people who contacted you or opted in, and keep your privacy policy up to date with how you use WhatsApp data.

  • Say that the first reply is automatic and how to reach a person.

  • Do not auto-answer sensitive topics, such as health, legal or money decisions, complaints and refunds. Route them to a human.

  • Never ask for passwords or card numbers in WhatsApp, and do not store more message data in n8n than you need.

The bottom line

Connecting WhatsApp to n8n takes an afternoon of setup on Meta's side and a five-node workflow in n8n. Start with a few clear auto-replies and a fast route to a person, watch your execution log and Meta bill for the first weeks, and only then add AI or more branches. Done this way, customers get an answer in seconds and your team only handles the messages that need a human.

Get one ready-to-use automation every week: subscribe to the Blog Spotlight Weekly newsletter.

1 Comment


forrest
6 hours ago

Thanks for spelling out the two-credential setup — sending uses an API credential while the trigger needs a separate OAuth one, which is exactly where I got stuck the first time. The 24-hour service window section is a helpful reality check too, especially the advice to test outside business hours before announcing the number. I host a small online radio show on the side and cut its idents with an ai jingle maker.

Like
bottom of page