Tutorials12 min read
Tutorial: Build a WhatsApp Chatbot with n8n and Claude in 30 Minutes
Step-by-step guide to building an intelligent WhatsApp chatbot with n8n 2.0 and Claude. Webhook, memory, human escalation.

William Aklamavo
February 26, 2026
Tutorial: Build a WhatsApp Chatbot with n8n and Claude in 30 Minutes
WhatsApp has 2.7 billion active users. Here's how to build a functional WhatsApp chatbot with n8n 2.0 and Claude.
Architecture
WhatsApp Business API
↓ webhook
n8n 2.0
├── Receive message
├── AI Agent (Claude)
│ ├── Memory (Redis/Supabase)
│ └── Tools (CRM, FAQ)
└── Send response
↓
WhatsApp (user)
Prerequisites
- n8n v2.0+
- WhatsApp Business API account
- Anthropic API key
- (Optional) Supabase for memory
Step 1: WhatsApp Webhook
- Create an n8n workflow
- Add a "Webhook" node (POST)
- Configure the URL in Meta Business Platform
- Events:
messages,message_status
Step 2: Parse the Message
const body = $input.first().json.body;
const message = body.entry?.[0]?.changes?.[0]?.value?.messages?.[0];
return [{
json: {
from: message?.from,
text: message?.text?.body,
type: message?.type,
messageId: message?.id
}
}];
Step 3: AI Agent
- Add an "AI Agent" node
- Connect "Anthropic Chat Model" (Claude Sonnet or Opus)
- System Prompt: friendly assistant, concise, able to escalate
Step 4: Memory
- "Window Buffer Memory" node
- Session ID: WhatsApp number (
{{ $json.from }}) - Window Size: 10 messages
Step 5: Send Response
{
"method": "POST",
"url": "https://graph.facebook.com/v18.0/PHONE_ID/messages",
"headers": {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
"body": {
"messaging_product": "whatsapp",
"to": "{{ $json.from }}",
"type": "text",
"text": { "body": "{{ $json.output }}" }
}
}
Step 6: Human Escalation
- If response contains "transfer" → Slack notification to support
- If negative sentiment → Automatic escalation
Rate Limiting Anti-Ban
- Delay: min 1 second between messages
- Max: 30 messages/minute
- Window: 24h after last client message
Result
Webhook → Parser → AI Agent → Condition → Send WhatsApp
Your chatbot responds intelligently, remembers context, and escalates when needed.
Want a professional WhatsApp chatbot? At BOVO Digital, we build custom chatbots with conversational AI.
Tags
#WhatsApp#Chatbot#n8n#Claude#Tutorial#Automation#API#AI