← all posts
automation
2026-07-20 11 min read

WhatsApp Business Automation with n8n: Build a 24/7 Messaging Bot (2026)

Two billion people use WhatsApp. Most businesses handle it as a manual inbox. With n8n and the WhatsApp Business API you can automate order confirmations, support triage, lead qualification, and appointment reminders — no custom code, no developer retainer.

WhatsApp has 90%+ open rates. Responses come in minutes, not days. No spam filters. No ad budget needed to reach customers who've already opted in. And yet most businesses are handling WhatsApp one message at a time, manually.

The WhatsApp Business API (Meta's Cloud API) exposes a webhook-based interface that n8n connects to natively. You get inbound message parsing, AI classification, CRM sync, conditional routing, and outbound template sends — all in a visual workflow editor.

This guide covers setup and five production workflow patterns. Real builds, real results.

prerequisites: meta business api access

The WhatsApp Cloud API is different from the WhatsApp Business app. You need Meta's developer platform. Before opening n8n:

Meta's review takes 1–3 business days. Factor that in. Once approved, you get a Phone Number ID and WABA ID that appear in every API call.

webhook setup in n8n

Every inbound WhatsApp message arrives as a POST webhook from Meta. n8n's Webhook node handles it:

// 1. webhook trigger node Method: POST Path: /whatsapp-inbound Authentication: None (validate manually in Code node) // 2. in Meta Developer Console App → WhatsApp → Configuration → Webhook Callback URL: https://your-n8n.domain/webhook/whatsapp-inbound Verify Token: any-secret-string Subscribe to: messages, message_deliveries, message_reads // 3. CRITICAL: respond immediately Add "Respond to Webhook" node right after trigger → 200 OK // Meta retries if no response within 5s

The most common mistake: slow response. If your workflow does an LLM call or CRM lookup before responding 200, Meta marks the delivery as failed and retries. Always respond immediately, then process asynchronously.

extract the inbound payload

Meta's payload is deeply nested. Normalise it in a Code node right after the trigger:

// Code node: normalise inbound message const entry = $input.first().json.entry[0]; const change = entry.changes[0].value; const msg = change.messages?.[0]; const contact = change.contacts?.[0]; if (!msg) return [{ json: { skip: true } }]; return [{ json: { from: msg.from, // E.164 phone, no + name: contact?.profile?.name || 'Unknown', messageId: msg.id, type: msg.type, // text | image | audio | interactive text: msg.text?.body || '', timestamp: msg.timestamp } }];

workflow 1: order status bot

Highest-ROI entry point for e-commerce. Customer messages "where's my order" — gets an instant accurate reply.

Webhook → extract message ↓ IF text matches: order | delivery | tracking | where ↓ YES HTTP → Shopify API: GET orders?phone={{ from }} ↓ IF order found → YES: format status + estimated delivery + tracking link → NO: "Reply with your order number to look it up" ↓ HTTP → WhatsApp API → send text reply ↓ Respond to Webhook 200
measured client results
73% of order status queries handled automatically (was 0%)
First-response time: 45 min → under 10 seconds
Support agent time freed: ~2.5 hours/day
Customer satisfaction on WhatsApp: 4.6/5

workflow 2: ai-powered support triage

For open-ended messages, an OpenAI classification step routes by intent:

Webhook → extract message ↓ OpenAI → classify: "Classify into: ORDER_STATUS | RETURN_REQUEST | PRODUCT_QUESTION | COMPLAINT | OTHER" ↓ Switch by category: ORDER_STATUS → [workflow 1] RETURN_REQUEST → lookup order → send return portal link PRODUCT_QUESTION → RAG vector search → answer from product docs COMPLAINT → create CRM ticket → Slack alert → holding message OTHER → human handoff queue

The PRODUCT_QUESTION path uses a RAG vector store — same architecture as our n8n RAG pipeline guide. Embed your product catalogue and FAQs; the bot answers from your real data. For complaints, don't try to automate empathy. Capture the issue, notify a human, set a response SLA expectation.

workflow 3: outbound order confirmations

Triggered by your e-commerce platform, not the customer. Fires on order.placed, order.shipped, order.delivered events:

Webhook (Shopify event) → extract phone + order data ↓ Code → format to E.164: "44" + phone.replace(/\D/g, '') ↓ HTTP POST https://graph.facebook.com/v20.0/{{ PHONE_ID }}/messages { "messaging_product": "whatsapp", "to": "{{ phone }}", "type": "template", "template": { "name": "order_shipped_v1", "language": { "code": "en_GB" }, "components": [{ "type": "body", "parameters": [ { "type": "text", "text": "{{ name }}" }, { "type": "text", "text": "{{ orderNum }}" }, { "type": "text", "text": "{{ trackingUrl }}" } ] }] } }

Templates must be pre-approved by Meta before use. Submit them in WhatsApp Manager. Approval: 30 min to 24 hours. Submit a template for each notification type: confirmation, shipped, delivered, return processed.

workflow 4: lead qualification bot

B2B and high-ticket B2C: WhatsApp is increasingly where qualified prospects make first contact. Capture intent before routing to sales.

Webhook → new inbound message ↓ HTTP → HubSpot: lookup contact by phone ↓ (not found = new lead) WhatsApp → send: "Hi! What are you looking for help with?" ↓ [user replies] OpenAI → extract: use_case, company_size, budget_range, timeline ↓ HTTP → HubSpot → create contact + deal record ↓ IF lead score > 60: → Slack → notify sales lead → WhatsApp → send Calendly link: "Want to chat? Book a 20-min call:" ELSE: → add to email nurture sequence

Conversation state tracking: store state per sender phone in Google Sheets or Airtable. Check state on every inbound message before deciding what to send next. Without state, every message looks like a fresh conversation.

workflow 5: appointment reminders

For service businesses — clinics, consultants, agencies. WhatsApp reminders cut no-shows from 15–25% to under 5%:

Schedule → every 15 minutes ↓ Calendly/Google Calendar API → appointments in next 24h ↓ Filter → reminder_sent != true ↓ Loop each appointment: WhatsApp → send reminder template: "Hi [Name], reminder: appointment at [time] tomorrow. Reply YES to confirm or RESCHEDULE to pick a new time." Google Sheets → mark reminder_sent = true ↓ [User replies YES] → update CRM → confirmed [User replies RESCHEDULE] → send new booking link
⚠ policy rules you can't ignore

outbound api call structure

Every message send in n8n is an HTTP Request node. The template:

Method: POST URL: https://graph.facebook.com/v20.0/{{ PHONE_NUMBER_ID }}/messages Headers: Authorization: Bearer {{ SYSTEM_USER_TOKEN }} Content-Type: application/json Body (text message): { "messaging_product": "whatsapp", "recipient_type": "individual", "to": "{{ phone }}", "type": "text", "text": { "body": "{{ message }}" } }

Store PHONE_NUMBER_ID and SYSTEM_USER_TOKEN as n8n credentials. The System User Token (not the temporary access token) doesn't expire. Never hardcode tokens in workflow nodes.

where to start
apply for WhatsApp Cloud API access — do this today, takes 1–3 days
build inbound webhook + message extractor (the foundation everything else builds on)
deploy order status bot for your top support query type
submit 3 outbound templates for approval simultaneously
add AI triage once the rule-based flows are stable and measurable
track: first-response time, automation rate, escalation rate per week

The businesses that get WhatsApp automation right turn their highest-engagement channel into a fully automated customer touchpoint. Order updates go out automatically. Support questions get instant answers. Qualified leads hit the CRM before anyone reads a message.

Want this built without the setup headache? we build and maintain whatsapp automation stacks → from API setup to production workflows, done in a week.

See also: ai customer support automation end-to-end, n8n rag pipelines for knowledge-based bots, and n8n slack automation patterns.