Automate WhatsApp Customer Support with n8n
Set up n8n WhatsApp support automation, past the Meta verification gate and the 24-hour session window, with AI triage and template-message fallback.
Customers expect a WhatsApp reply in minutes, not the next business day. A support team can't watch the inbox around the clock, so the obvious move is n8n WhatsApp support automation: receive the message, triage it with AI, reply or escalate. The templates that show this assume the hard parts are already done. They aren't.
Two gates break almost every naive build. Meta's business verification, which you can't skip. And the 24-hour session window, the rule that quietly decides whether your auto-reply sends or bounces. Get those wrong and the workflow looks fine in testing, then fails the moment a real customer messages at hour 25.
This covers the setup that survives contact with production. AI triage is the easy 20%.
What you can automate over WhatsApp
Once the channel is wired correctly, n8n can run most of the front line:
- Instant acknowledgement so the customer knows a human (or the system) heard them
- AI classification: billing, technical, sales, complaint, with a confidence score
- Auto-reply to FAQs inside the 24-hour window
- Escalation to a human when confidence is low or sentiment is negative
- Appointment or callback scheduling from a structured reply
- Template-message fallback when the window has closed
- A full transcript logged to Google Sheets or your CRM
The workflow's job is to handle the routine fast and route the rest to a person before the customer notices a gap.
The two gates nobody mentions
Gate one: Meta verification. Before WhatsApp Business Cloud will send to anyone outside your test list, the number has to clear Meta business verification. That means a Meta Business account, an app with WhatsApp added, a verified business, and a permanent access token. Test mode lets you message a handful of allow-listed numbers; real customers need the verified number. n8n's WhatsApp Business Cloud node connects to that API, but it can't conjure the credential. Per the n8n WhatsApp Business Cloud docs, you supply the access token and phone number ID from the Meta dashboard.
Gate two: the 24-hour window. This is the one that breaks builds. WhatsApp only allows free-form messages within 24 hours of the customer's last inbound message. That's the customer service window. Outside it, you can't send arbitrary text. You must send a pre-approved template message, and those cost more per send and have to be submitted to Meta for approval in advance.
Here's the take: design for the window from line one, not as an afterthought. Most tutorials show a Webhook into an OpenAI node into a WhatsApp send, and it works in the demo because the demo replies in seconds. In production, someone messages at 2am, your team picks it up at 9am, and the free-form reply silently fails because 24 hours of business processing pushed it over. The fix isn't more code. It's a branch that checks message age and falls back to a template plus a human handoff.
The WhatsApp support pipeline
Webhook (WhatsApp inbound)
→ Parse message + sender + timestamp
→ OpenAI: classify category, urgency, sentiment, confidence
→ Switch: within 24h window?
→ yes + high confidence → AI free-form reply
→ yes + low confidence → human handoff (Slack)
→ no → approved template message + escalate
→ Log transcript (Google Sheets)
The Switch on window-status is the node every page skips. It's also the one that decides whether your automation is reliable or a coin flip.
1. Receive and parse
WhatsApp Business Cloud delivers inbound messages to a webhook you register in the Meta dashboard. The payload nests the message under entry[0].changes[0].value.messages[0]. A Code node should pull the text, the sender's wa_id, and the timestamp into a flat object before anything else touches it. Don't let downstream nodes reach into that nested structure directly; one API change and every reference breaks.
2. Classify with structured output
The OpenAI node returns a category, urgency, sentiment, and a confidence score. Force structured JSON output, then add a Code node to parse it. AI workflows fail when builders skip the parse step: the model returns text, the next node expects JSON, and the Switch reads undefined. Add the parse node every single time, even when it feels redundant.
3. Branch on the window
A Code node computes hours since the customer's last message. The Switch routes on that plus confidence:
// Code node: window check
const last = new Date(items[0].json.message_timestamp * 1000);
const hoursOpen = (Date.now() - last) / 36e5;
return [{ json: { ...items[0].json, withinWindow: hoursOpen < 24 } }];
Inside the window with high confidence, the WhatsApp node sends a normal text reply. Inside the window with low confidence, a Slack alert hands the thread to a human. Outside the window, the workflow sends a pre-approved template message ("we got your message, an agent will follow up") and flags it for a person.
4. Reply or escalate
The free-form reply path uses the WhatsApp node's message operation. The template path uses the template operation with the approved template name and any variables. Keep {{customer_name}} and similar values backticked in your notes so you remember they're template variables, not literal text. The escalation path posts to Slack with the transcript and category so the agent has context before they open the thread.
5. Log everything
Every message, classification, and outcome lands in Google Sheets or your CRM. That log is how you tune the confidence threshold later: if the AI auto-replied to something it shouldn't have, the row tells you.
WhatsApp's customer service window isn't a rate limit you can bump. It's a Meta policy enforced at the API. Free-form text outside 24 hours returns an error, full stop. The only path out is an approved template message, and approval takes time. Submit your fallback templates the day you start building, not the day you launch, or your first after-hours message will bounce with nothing to fall back to.
Implementation patterns
Pattern 1: window-aware routing. Compute message age first, branch on it always. This is the difference between a demo and a deployment.
Parse → compute hoursOpen → Switch(withinWindow) → free-form OR template
Pattern 2: confidence-gated auto-reply. Only auto-send when the model's confidence clears a threshold (0.8 is a reasonable start). Everything below routes to a human. The threshold is yours to tune from the log.
OpenAI(structured) → parse → IF confidence >= 0.8 → send, else → Slack handoff
Pattern 3: vendor authentication. If you're ingesting from known senders, verify the number against an allow-list before processing. The WhatsApp Vendor Ingest & Authenticator template does exactly this: it authenticates senders by phone number and logs their submissions to Sheets, which keeps unknown numbers out of your support queue.
n8n nodes you'll use most
| Node | Purpose |
|---|---|
| Webhook | Receive inbound WhatsApp messages from Meta |
| Code | Flatten the nested payload, compute window status, parse AI output |
| OpenAI | Classify category, urgency, sentiment, confidence |
| Switch | Route on window status and confidence |
| WhatsApp Business Cloud | Send free-form replies or approved templates |
| Slack | Hand low-confidence threads to a human |
| Google Sheets | Log the full transcript |
Getting started
- Create a Meta Business account and add WhatsApp to an app; start business verification early.
- Generate a permanent access token and note the phone number ID.
- Submit your fallback template messages to Meta for approval before you build.
- Register the webhook URL in the Meta dashboard and wire it to an n8n Webhook node.
- Add the OpenAI classification node with structured output, then a parse node.
- Build the window-status Switch and the three branches: free-form, template, human handoff.
- Log every step to Sheets and tune the confidence threshold from real traffic.
The Review Response Engine ships the AI-classification-and-route core this support flow depends on: it analyzes incoming messages with AI, generates draft responses, alerts on negatives via Slack, and logs every item to Google Sheets, so the triage half is done and you wire it to the WhatsApp channel. It's part of The Complete n8n Templates Bundle, a one-time lifetime license to the whole catalog plus future additions, worth it if you run more than one of these automations.
WhatsApp is one channel; the same triage-and-route pattern carries across email and chat. For the email side, see automating the support inbox in n8n, and for replying to public feedback at scale there's the n8n review-response build. Get the two gates right first. The AI is the part that already works.
Common questions
Why does my n8n WhatsApp message fail with a 'session expired' error?
What do I need before n8n can send WhatsApp messages?
Can n8n auto-reply to WhatsApp messages with AI?
Get the workflow templates this guide is built on
Import-ready n8n JSON, step-by-step setup, and tested end-to-end. One-time payment, own it forever.
Get 3 tested n8n templates, free
The full customer package for three real catalog templates — workflow JSON, step-by-step setup guide, credential checklist. Built through the same live-instance release process as everything we sell. Plus new templates and automation guides in your inbox. No spam, unsubscribe anytime.
- 01Smart To-Do List ManagerPre-built n8n workflow template that automates productivity with OpenAI. Live in about 10 minutes.$14
- 02Email Follow-Up AutomatorPre-built n8n workflow template that automates crm with OpenAI. Live in about 15 minutes.$12
- 03Market Trend AnalyzerPre-built n8n workflow template that automates data processing with OpenAI. Live in about 10 minutes.$14
More automation guides

n8n Backup Automation That Actually Verifies the Backup
A Backup You Never Verified Is a Coin Flip Every n8n backup automation tutorial that ranks does the same thing: schedule an export, push the JSON to Google Drive or S3, done. They back up the data and…

How to Build an n8n Log Alerting Workflow (No Grafana Required)
Most n8n Error Setups Tell You Everything, Which Means They Tell You Nothing An n8n log alerting workflow has one job: surface the failures that need a human and quietly file the ones that don't. The…

n8n Uptime Monitoring with Slack Alerts (Without the Alert Storms)
An Uptime Check That Cries Wolf Gets Muted in a Week The point of n8n uptime monitoring with Slack alerts isn't to detect a single outage. It's to be trusted the next hundred times it fires. Most of t…