Tutorials

How to Build a WhatsApp AI Chatbot for Your Business (Step-by-Step)

By ·2026-08-07·📖 9 min read
How to Build a WhatsApp AI Chatbot for Your Business (Step-by-Step)

Why WhatsApp instead of an app

Your customers already live in WhatsApp. A chatbot there needs no download, no login, no new habit — it sits inside the app they use for family, work and shopping. For most small businesses, a WhatsApp bot delivers more value per rupee than a custom app ever will.

The technical path changed too. Meta's Cloud API and the newer Calling API mean you can automate messages and even calls on a real business number without buying expensive telephony or hosting a server farm.

The four parts of a WhatsApp chatbot

PartJobFree option
GatewaySends and receives messages on your numberMeta WhatsApp Cloud API (1,000 free service conversations/month)
BrainUnderstands the message and writes the replyDeepSeek, Gemini or Groq free tiers
KnowledgeYour FAQ, prices and policies, in one placeA Google Sheet or a text file the brain reads
OrchestratorGlues it together and logs every chatn8n community edition or a small script

Step 1 — Get your number on the Cloud API

  1. Create a Meta developer account and an app in the developer console.
  2. Add the WhatsApp product and generate a test number — instant, no approval needed.
  3. Verify your real business number (a call or SMS code) and attach it to the app.
  4. Subscribe to the messages webhook so your server hears every incoming message.

The free tier covers the first 1,000 service conversations per month — enough for most small shops. Utility conversations like OTPs and delivery alerts are billed per conversation under the current model, so keep those separate and minimal.

Step 2 — Build the brain with one system prompt

For most businesses the whole knowledge base fits on one page. Write it as plain text and paste it into the system prompt:

You are the WhatsApp assistant for [business]. Answer only from the knowledge base below. If the answer is not there, say you will connect a human. Never invent prices, discounts or policies.

The knowledge base lists: opening hours, location, price list, delivery areas, return policy, and the three most common questions your staff answer daily. When this grows past a few pages, move it to a Google Sheet and add a search step — the brain reads only the matching rows.

Step 3 — Connect it with n8n or plain code

  1. Webhook in: Meta posts each incoming message to your n8n webhook URL.
  2. Parse: pull out the phone number, name and message text.
  3. Think: send the text plus the system prompt to the LLM and get a reply.
  4. Reply: POST the answer back through the Cloud API messages endpoint.
  5. Log: write the exchange to a Google Sheet so you can review every conversation.

n8n community edition does all five steps with drag-and-drop nodes. If you prefer code, a single Node.js or Python script using the Cloud API SDK does the same thing in about 200 lines.

The guardrails that matter

What it costs

ItemCostNote
Cloud API$0First 1,000 service conversations per month
LLM brain$0Free tiers: DeepSeek, Gemini, Groq
n8n$0Self-hosted community edition
Total$0/monthUntil you pass 1,000 conversations or hit rate limits
A WhatsApp bot is not a replacement for your staff. It is a filter that answers the repetitive 80% so humans only handle the 20% that actually needs them.

Get it built for your business

Want a WhatsApp AI assistant live on your business number? We build, host and maintain it for you.

Chat on WhatsApp
AP

Independent AI & technology publication — research and verification driven. Read the editorial policy.

Related reading