Limited time offer: Get .COM at ₦10000 Use NGNEWCOM
India English
Kenya English
United Kingdom English
South Africa English
Nigeria English
United States English
United States Español
Indonesia English
Bangladesh English
Egypt العربية
Tanzania English
Ethiopia English
Uganda English
Congo - Kinshasa English
Ghana English
Côte d’Ivoire English
Zambia English
Cameroon English
Rwanda English
Germany Deutsch
France Français
Spain Català
Spain Español
Italy Italiano
Russia Русский
Japan English
Brazil Português
Brazil Português
Mexico Español
Philippines English
Pakistan English
Turkey Türkçe
Vietnam English
Thailand English
South Korea English
Australia English
China 中文
Canada English
Canada Français
Somalia English
Netherlands Nederlands

n8n Workflow for WhatsApp Automation

Buy domains, business emails, hosting, VPS and more: Get Started

Cheapest Domains in Nigeria

Get your .com.ng domain now for just ₦5,500

.COM.NG for ₦5,500 | .COM for ₦10,000

An n8n workflow for WhatsApp automation fixes the gap between when a customer messages you and when you reply.

It replaces manual, one-by-one replies with a visual, node-based pipeline that connects the WhatsApp Business Cloud API to your business logic.

Messages get answered automatically, at any hour, without you opening your phone.

This is important because manual outreach does not scale. WhatsApp Business already serves over 200 million active businesses, on a platform with more than 3 billion monthly users.

Customers expect fast replies on a channel they already trust.

The same setup covers more than simple replies:

  • Support bots that answer FAQs instantly
  • Sales agents that qualify leads while you sleep
  • Booking systems that confirm appointments automatically
  • Multi-modal AI agents that handle text, voice notes, and images

This guide takes you from a blank n8n canvas to a working, production-ready WhatsApp bot.

Prerequisites

Before you touch a single node, get these in place.

  1. A WhatsApp Business Account with an approved phone number and at least one approved message template.
  2. A Meta developer app, ready to move to live mode in Step 1.
  3. An n8n instance, self-hosted or on n8n Cloud, with a public HTTPS URL.

One thing to know upfront: default tokens from Meta’s Graph API Explorer expire in 1–2 hours.

That is why Steps 1–2 focus on getting a permanent system user token from the start, instead of relying on a temporary one.

Skip any one of these, and you will spend your first hour debugging a webhook that was never going to fire.

Steps To Building Your First Basic Workflow

Step 1: Switch your Meta app to live mode

Go to the Meta developer portal.

Open your app settings.

Toggle your app from development mode to live mode. Do this early. Nothing downstream works properly while your app sits in development.

Step 2: Generate a system user token

Head to Business Settings, then System Users.

Create a new system user.

Assign your WhatsApp Business Account (WABA) as an asset under that system user.

Grant these two permissions:

  • whatsapp_business_messaging
  • whatsapp_business_management

One important note. Copy the token immediately after generating it. Unlike the Graph API Explorer token, this one does not expire on its own. It only stops working if you revoke it.

Step 3: Add WhatsApp credentials in n8n

Inside n8n, go to Credentials and create a new WhatsApp Business Cloud API credential.

Paste in your system user token.

Paste in your Phone Number ID.

Test the connection before moving on. A failed test almost always means a copy-paste error, not a deeper problem.

Step 4: Set up the Verify Webhook (first half of the basic n8n template)

This step handles Meta’s handshake. Before Meta sends you real messages, it checks that your webhook is legitimate.

Meta sends a GET request with a challenge string. Your workflow needs to send that exact string back.

It is like a password check. You set the password (your verify token) on both sides inside your Code node and inside the Meta portal.

If the two match, Meta trusts your endpoint and starts forwarding real events to it. If they do not match, verification fails outright, and no messages will ever reach you.

n8n workflow for whatsapp automation

Build it this way:

  • Add a Webhook node configured to catch Meta’s GET verification request.
  • Add a Code node right after it. This node pulls hub.mode, hub.verify_token, and hub.challenge out of the query parameters, then checks your token against the one Meta sent.
const query = $input.first().json.query;
const mode = query['hub.mode'];
const token = query['hub.verify_token'];
const challenge = query['hub.challenge'];
const VERIFY_TOKEN = 'your-custom-verify-token';

if (mode === 'subscribe' && token === VERIFY_TOKEN) {
  return [{ json: { challenge } }];
} else {
  throw new Error('Verification failed: token mismatch');
}
  • Add a Respond to Webhook node that returns the challenge value as plain text. Not JSON. Plain text.

Then head back to the Meta portal. Select your app, open WhatsApp Configuration, and edit the webhook.

Enter your production webhook URL and your verify token any string you choose works, as long as it matches the code above. Click Verify and Save.

Before you click that button, your n8n workflow must be active. Meta cannot verify a webhook that is sitting inactive.

Step 5: Build the Respond Webhook (second half, receiving & replying to messages)

This second webhook receives POST requests from Meta. That includes real user messages and status notifications like ‘delivered’ or ‘read.’

Add a Code node to pull the incoming message out of the payload. Messages arrive nested under entry → changes → value → messages.

const body = $input.first().json.body;
const message = body.entry?.[0]?.changes?.[0]?.value?.messages?.[0];

if (!message) {
  return [{ json: { hasMessage: false } }];
}

return [{
  json: {
    hasMessage: true,
    from: message.from,
    text: message.text?.body || '',
    messageId: message.id
  }
}];

Add an If node. Check whether hasMessage is true.

If it is true, send a reply. Use either the WhatsApp Send Message node, or an HTTP Request node hitting the Graph API’s /messages endpoint directly.

This reply is a plain custom message, not a pre-approved WhatsApp template message. You can only send it inside an open 24-hour conversation window.

That window is generous. Meta made customer-initiated service conversations free and unlimited from November 1, 2024.

Once a customer messages you, you can reply as many times as you need within that 24-hour window at no extra messaging cost.

Finally, add a Respond to Webhook node that returns 200 OK. This closes out the request cleanly so Meta does not retry it.

Step 6: Activate and test

Toggle your workflow to Active inside n8n.

Send a real test message to your WhatsApp number.

Confirm a reply comes back. If it does, your first n8n workflow for WhatsApp automation is live.

Quick-Reference Table: Steps + Common Mistakes

StepActionCommon mistake
1Switch app to live modeSkipping this, staying in development
2Generate system user tokenUsing a temporary user token instead
3Add credentials in n8nEntering Phone Number ID instead of the token
4Verify webhookMismatched verify token strings
5Respond webhook + reply logicForgetting to check for user message before replying
6Activate and testTesting before activating the workflow / not confirming the HTTPS endpoint is publicly reachable

Keep this table nearby. Most support tickets trace back to one of these six rows.

Where to Go From Here

A basic reply bot is a starting point, not a finish line. Three upgrades take it further.

First, the AI upgrade. Swap your If-node logic for an AI Agent connected to a vector store.

That turns a simple bot into a product-aware sales assistant that answers detailed questions on its own.

Second, watch for scale problems before they bite. Schedule Trigger timing mismatches cause missed sends; use range filters instead of exact time matches.

Unthrottled bulk messaging runs straight into Meta’s rate limits.

These limits now apply at the business portfolio level, not per phone number, and they progress through tiers of roughly 250, 2,000, 10,000, 100,000, and unlimited unique contacts per day.

Meta checks accounts for tier upgrades every 6 hours, so a clean send history moves you up faster than it used to.

Third, plan your path to production. That means Queue Mode backed by Redis and PostgreSQL, proper monitoring and backups, and webhook signature verification to confirm requests come from Meta.

Skip these, and a single traffic spike can knock your workflow offline when customers need it most.

Ready to Build Yours?

You now have a code-light, scalable system that replies to customers the moment they message you.

n8n workflow for whatsapp automation

That is the real value of an n8n workflow for WhatsApp automation: it runs regardless of you being awake or not.

The one thing that determines how well it runs long-term is where it lives.

A workflow this important needs an instance that stays online, keeps your webhook reachable over HTTPS, and does not fall over under load.

That is what we built n8n self-hosting for.

Every plan runs n8n in Queue Mode out of the box, with unlimited workflows, unlimited concurrent executions, and over 100 pre-made workflows to help you get started faster:

  • N8N Starter: ₦14,000/month: 1 vCPU, 2GB RAM, 50GB NVMe storage, 4TB bandwidth
  • N8N Pro: ₦28,000/month: 2 vCPU, 4GB RAM, 100GB NVMe storage, 6TB bandwidth
  • N8N Business: ₦63,000/month: 4 vCPU, 8GB RAM, 200GB NVMe storage, 8TB bandwidth

All three come with automated installation and dedicated support, so you are not left debugging server config on top of your webhook config.

Open an account with us, and you can have your instance ready before your next test message goes out.

n8n Workflow for WhatsApp Automation FAQ

What is an n8n WhatsApp automation workflow?

It is a visual pipeline built in n8n that connects to the WhatsApp Business Cloud API. It listens for incoming messages through a webhook, runs your logic, replies, routing, AI responses, and sends messages back, all without manual intervention.

Do I need coding skills?

Why aren’t my messages sending?

How do I set up scheduled broadcasts?

Self-hosted vs. cloud, which is more cost-effective?

Winny Mutua
Author

Winny Mutua

SEO Specialist Nairobi, Kenya

Winfred Mutua is a results-driven SEO Specialist with over 5 years of experience in technical SEO, keyword strategy, and organic growth. She helps tech and web hosting brands improve visibility, rankings, and conversions through in-depth keyword research, content optimization, and technical SEO.
Proficient in SEMrush, Ahrefs, Screaming Frog, Google Analytics, and Search Console.
What She Excels At

- Technical SEO audits & site optimization
- Keyword research and search intent analysis
- SEO content strategy & long-form content creation
- On-page optimization and WordPress management
- Performance tracking and data-driven growth

Currently an SEO Content Specialist at Truehost Cloud, driving organic growth for a tech/web hosting brand. She has also built and scaled two niche WordPress websites from scratch, achieving monetization through organic traffic.
Fully remote-ready and open to new SEO opportunities.

View All Posts