AI Agents & Automation · Ahmedabad, India
How to Automate WhatsApp Customer Support with n8n and AI
Published by Kryyvix · 10 min read · May 24, 2026
WhatsApp is where your customers actually are. Not email. Not your support portal. Not a ticket form that opens in a new tab on a desktop they are not sitting at.
WhatsApp has billions of active users, extremely high open rates, and response time expectations measured in minutes, not hours.
And yet most businesses, including ones doing serious revenue, are handling WhatsApp support the same way they handled email in 2009. Someone reads it. Someone replies. Someone forgets. Someone follows up three days later.
This is a complete guide to fixing that. By the end of it you will understand exactly how to build an AI-powered WhatsApp support system using n8n: the architecture, the components, the decisions that matter, and the mistakes we made so you do not have to.
Who This Guide Is For
This guide is written for founders, CTOs, ops leads, and developers at companies where WhatsApp is a primary customer communication channel, support volume has outgrown manual response capacity, response time is hurting conversion, and the goal is AI automation that actually works rather than a scripted bot that frustrates people.
The Architecture Before the Tools
An automated WhatsApp support system has four layers: the message gateway, the intelligence layer, the automation layer, and the escalation layer. Every good implementation has all four. Every broken implementation is missing at least one.
- The Message Gateway: how messages get from WhatsApp into your system.
- The Intelligence Layer: where the AI reads intent, chooses a response, and decides when to escalate.
- The Automation Layer: where n8n routes messages, calls systems, logs conversations, and sends responses.
- The Escalation Layer: the human handoff path for complex, sensitive, or high-frustration conversations.
Build all four or do not build it.
The Tools You Will Need
WhatsApp Business API access: use Twilio, 360dialog, or Meta's WhatsApp Cloud API. Twilio is more expensive but has excellent documentation; 360dialog is often cheaper and common in Europe and Asia.
n8n: your automation layer. Self-hosted or n8n Cloud both work, though self-hosting gives more control over production data and execution.
An LLM: Claude or GPT-4 both work. Claude often produces natural support replies; OpenAI models are strong for structured extraction.
A knowledge base: products, policies, order lookup rules, FAQ answers, and escalation criteria.
The Build: Step by Step
Step 1: Set Up Your WhatsApp Webhook in n8n
Create a new workflow and add a Webhook node as the trigger. Configure it to accept POST requests. This generates a URL your WhatsApp provider calls whenever a customer sends a message. In Twilio, paste this n8n webhook URL as the incoming message endpoint for your WhatsApp sender.
Step 2: Extract and Clean the Message Data
customerPhone = {{ $json.From }}
messageBody = {{ $json.Body }}
timestamp = {{ $json.timestamp }}
mediaUrl = {{ $json.MediaUrl0 }}
Normalize the phone number format early. Twilio sends numbers as whatsapp:+919157280068, so strip the whatsapp: prefix before storing or using the number elsewhere.
Step 3: Check Conversation Context
WhatsApp conversations are stateful. A customer asking "where is it?" means nothing without knowing they messaged you 20 minutes ago about an order. Query your conversation store by phone number and pass recent history to the AI layer.
Step 4: The AI Classification and Response Node
Add an HTTP Request node pointed at Claude or OpenAI. The system prompt should define the business context, support capabilities, escalation criteria, and strict JSON output with intent, response, escalation flag, escalation reason, and data needed.
Step 5: Handle Intent-Based Routing
Use Switch nodes in n8n. Order lookup calls your order API. FAQ sends the generated response directly. Complaints are logged and flagged for human review. Escalations notify Slack or your helpdesk and send a holding message to the customer.
Step 6: Send the Response Back
POST https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Messages.json
From: whatsapp:+1234567890
To: whatsapp:+{customerPhone}
Body: {AI response text}
Step 7: Update Conversation History
Store the customer's message, AI response, timestamp, classified intent, and whether the conversation escalated. This gives the system memory for the next message.
Step 8: The Escalation Workflow
Build a separate branch or workflow that summarizes conversation history, posts to Slack, creates a helpdesk ticket, sends the holding message, and marks the conversation as human-owned so the AI does not continue replying.
What Good Looks Like in Practice
Customer: Hi, I ordered 3 days ago and still no tracking info.
System: Hi! Sorry to hear that. I can look into this right away. Could you share your order number?
Customer: KRY-2847.
System: Thanks! Order KRY-2847 was dispatched yesterday via BlueDart. Your tracking number is BD928471628. It is currently in transit and expected to arrive by Thursday.
Total time: 34 seconds. Zero humans involved.
The Mistakes We Made
- No conversation memory.
- Escalation criteria too narrow.
- Not returning 200 to Twilio fast enough.
- System prompt too long and unfocused.
- No rate limiting.
What This Costs to Run
For a business handling 500 WhatsApp conversations per month, a practical system can run around $43-60/month: about $20 for n8n Cloud or a VPS, $15-25 for WhatsApp outbound messages, and $8-15 for LLM API usage at this volume.
When You Are Ready to Go Beyond the Basics
Natural extensions include proactive messaging, voice note transcription, product recommendations, multi-language support, and an analytics dashboard that tracks intent, resolution time, escalation rate, and CSAT.
FAQ
Does n8n support WhatsApp Business API?
Yes. n8n can receive WhatsApp messages through webhook payloads from providers like Twilio, 360dialog, or Meta's WhatsApp Cloud API.
Can I use Claude instead of GPT?
Yes. Claude and OpenAI models both work well for WhatsApp support automation.
How much does this cost to run?
A small-volume system handling around 500 conversations per month can often run for roughly $43-60 per month across n8n, WhatsApp messaging, and LLM API usage.
Want This Built for Your Business?
Kryyvix deploys n8n WhatsApp automations for e-commerce brands, healthcare providers, and B2B SaaS companies.
Book a Free Strategy SessionRelated reading: AI patient intake automation · n8n vs Zapier for e-commerce