M
MJK.Supplies
Home / n8n / n8n WhatsApp Automation: Build WhatsApp Bots and…
n8n

n8n WhatsApp Automation: Build WhatsApp Bots and Business Flows

WhatsApp is the world's most used messaging platform, with over 2 billion active users. Automating WhatsApp with n8n lets you build customer support bots, sales outreach sequences, appointment reminders, and AI-powered messaging — at scale and without the limitations of manual messaging. This guide covers every method for integrating WhatsApp with n8n.

M
MJK Supplies · Jun 6, 2026 · 12 min read
ShareXinf↗
n8n WhatsApp Automation: Build WhatsApp Bots and Business Flows

WhatsApp Integration Options

There are two ways to connect WhatsApp to n8n:

Twilio for WhatsApp: Twilio provides an official WhatsApp Business API integration. Messages send through Twilio's infrastructure. Easy to set up; per-message pricing. Best for most businesses.

WhatsApp Business API (direct): Requires Meta Business verification and a Business Solution Provider (BSP). More control, lower per-message costs at scale, required for large-scale deployments.

Meta Cloud API: Meta's own API for WhatsApp Business. Direct integration; requires Meta Business Manager account.

For most businesses starting out, Twilio is the fastest path to a working WhatsApp automation in n8n.

Setting Up Twilio WhatsApp in n8n

Prerequisites:

  1. Twilio account with WhatsApp enabled
  2. WhatsApp Business number (Twilio sandbox for testing, production number for launch)
  3. n8n with Twilio credential configured

Twilio credential in n8n: Settings → Credentials → New → Twilio

  • Account SID: from Twilio console
  • Auth Token: from Twilio console

Receiving WhatsApp messages (webhook):

  1. n8n: Webhook trigger node → copy webhook URL
  2. Twilio Console → Messaging → WhatsApp → Sandbox Settings
  3. Set "When a message comes in" to your n8n webhook URL

Now n8n fires when a WhatsApp message is received.

Sending WhatsApp messages: Add Twilio node → Operation: Send Message:

  • To: whatsapp:+1234567890
  • From: whatsapp:+your-twilio-number
  • Message: your message text

Building a WhatsApp Support Bot

Combine n8n + WhatsApp + Claude for an AI-powered support bot:

Workflow:

  1. Webhook trigger: inbound WhatsApp message
  2. Code node: extract sender phone, message text
  3. Function node: look up conversation history from storage
  4. HTTP Request: Claude API with conversation history + system prompt
  5. Code node: extract Claude's response
  6. Twilio: send response to WhatsApp
  7. Database: save updated conversation history

System prompt for support bot:

You are a customer support assistant for [Company]. Answer questions about our product based on this documentation: [your docs]. Be helpful, specific, and concise. If you can't help, say so and offer to connect them with a human agent. Never make up features or policies. Keep responses under 200 words (WhatsApp is a mobile messaging platform).

Conversation History

WhatsApp is a conversational medium. Claude needs conversation history to give coherent responses:

Store history in n8n's static data:

// Code node — manage conversation history const phoneNumber = $input.first().json.from; const userMessage = $input.first().json.body; // Get or create conversation history const conversations = $getWorkflowStaticData('global'); if (!conversations[phoneNumber]) { conversations[phoneNumber] = []; } // Add user message conversations[phoneNumber].push({ role: 'user', content: userMessage }); // Keep only last 10 messages (token management) if (conversations[phoneNumber].length > 10) { conversations[phoneNumber] = conversations[phoneNumber].slice(-10); } return [{ json: { phoneNumber, userMessage, history: conversations[phoneNumber] } }];

After Claude responds, save the assistant message:

const phoneNumber = $node["Extract Data"].json.phoneNumber; const assistantResponse = $input.first().json.claudeResponse; const conversations = $getWorkflowStaticData('global'); conversations[phoneNumber].push({ role: 'assistant', content: assistantResponse });

WhatsApp Appointment Reminders

Automated appointment reminders are a simple, high-value WhatsApp automation:

Workflow:

  1. Schedule trigger: every hour
  2. Database: get appointments starting in next 24h
  3. Loop: for each appointment
  4. Claude (optional): personalise reminder message
  5. Twilio: send WhatsApp reminder
  6. Database: mark reminder sent

Message template:

Hi {{customer_name}}, this is a reminder about your appointment with {{business_name}} at {{appointment_time}} on {{appointment_date}}. Reply YES to confirm or NO to reschedule.

Add a response handler workflow to process YES/NO replies and update your booking system.

Sales Outreach via WhatsApp

WhatsApp has 5-10x higher open rates than email. For B2C businesses:

Lead capture → WhatsApp follow-up:

  1. Form submit webhook
  2. Claude: generate personalised first message based on lead's industry/role
  3. Wait: 5 minutes (not too immediate)
  4. Twilio: send first WhatsApp message
  5. Track: if no reply in 24h → send follow-up

Note: Only message people who have opted in to WhatsApp communications. Check WhatsApp Business policy requirements.

Recommended Tools

  • n8n — Automation platform for WhatsApp workflows
  • Twilio — WhatsApp Business API provider
  • Claude API — AI for intelligent WhatsApp responses
  • Airtable — Store conversation history and contact data
  • Make.com — Alternative automation platform with Twilio integration
#n8n#whatsapp#chatbot

Related articles

MJK Supplies · Automation Services

Want this built for you?

We design and ship custom AI agents and automation systems for teams that want results, not a backlog. Book a free 30-minute consult — no commitment, no pitch deck.