WhatsApp has over 500 million active users in India alone, making it the most powerful business communication channel available. But manually responding to every customer query, order update, or support request? That doesn't scale.
In this guide, I'll show you exactly how to build a fully automated WhatsApp workflow using n8n (the open-source workflow automation tool) and the WhatsApp Business API — so your business can respond instantly, 24/7, without lifting a finger.
Why n8n + WhatsApp Business API?
n8n is a self-hostable, node-based automation platform that gives you full control over your data and workflows. When paired with the WhatsApp Business API (accessed through a Business Solution Provider like BotSense), you get:
- Real-time message receiving via webhooks
- Intelligent routing based on message content
- CRM and database integrations
- Template message sending for notifications
- Complete audit trail of all conversations
Prerequisites
Before we start, you'll need:
- An n8n instance (cloud or self-hosted)
- WhatsApp Business API access via a BSP (BotSense offers easy onboarding at botsense.io)
- A verified WhatsApp Business number
- Basic understanding of webhooks and REST APIs
Step 1: Get WhatsApp Business API Access
The official WhatsApp Business API requires going through a Meta-approved Business Solution Provider. BotSense (botsense.io) provides managed API access with quick onboarding (24-48 hours), webhook configuration support, message template approval assistance, and a developer-friendly REST API.
Once onboarded, you'll receive your WhatsApp Phone Number ID, a permanent access token, and your webhook verification token.
Step 2: Set Up Your n8n Webhook
In n8n, create a new workflow and add a Webhook node as the trigger. Set Method to POST, copy the webhook URL, and set Response Mode to Last Node.
In your Meta Developer Console, configure the webhook URL to your n8n webhook URL, set a Verify Token, and subscribe to the messages event.
Step 3: Parse Incoming Messages
Add a Function node after the webhook to extract message data. Pull the sender phone number, message type, and text body from the incoming payload. Normalize the text to lowercase for easier routing logic downstream.
Step 4: Build Routing Logic with Switch Node
Add a Switch node to route messages based on content:
- Route 1: message contains "order" — Order status flow
- Route 2: message contains "support" or "help" — Support ticket flow
- Route 3: message contains "price" or "pricing" — Pricing info flow
- Default: Generic greeting response
Step 5: Send Responses via HTTP Request Node
For each route, add an HTTP Request node to send WhatsApp messages via POST to the Graph API endpoint. Include your Phone Number ID in the URL and your access token in the Authorization header. The message body should follow WhatsApp's messaging product JSON structure.
Step 6: Connect to Your CRM
Add a final node to log every interaction to your CRM or database. Use n8n's built-in nodes for HubSpot, Airtable, Google Sheets, or make a direct HTTP request to your CRM's API. Store the sender number, message content, timestamp, route taken, and response sent.
Best Practices
Rate limiting: WhatsApp enforces messaging limits. Start conservative and scale up as your quality rating improves.
Template messages: For outbound notifications like order updates and reminders, you must use pre-approved message templates. Submit these through your BSP.
Opt-in compliance: Only message users who have explicitly opted in to receive WhatsApp communications from your business.
Error handling: Add error branches in n8n to catch failed API calls and alert your team.
Resources
- Get WhatsApp Business API access: BotSense — https://botsense.io
- n8n documentation: n8n.io/docs
- WhatsApp Business API docs: developers.facebook.com/docs/whatsapp
Building this automation took under 2 hours and immediately eliminated 70% of manual WhatsApp responses. The same infrastructure now handles 10,000+ messages per month without any human intervention for routine queries.
Drop a comment below if you have questions or want to share your own automation setup!
Top comments (0)