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
| Part | Job | Free option |
|---|---|---|
| Gateway | Sends and receives messages on your number | Meta WhatsApp Cloud API (1,000 free service conversations/month) |
| Brain | Understands the message and writes the reply | DeepSeek, Gemini or Groq free tiers |
| Knowledge | Your FAQ, prices and policies, in one place | A Google Sheet or a text file the brain reads |
| Orchestrator | Glues it together and logs every chat | n8n community edition or a small script |
Step 1 — Get your number on the Cloud API
- Create a Meta developer account and an app in the developer console.
- Add the WhatsApp product and generate a test number — instant, no approval needed.
- Verify your real business number (a call or SMS code) and attach it to the app.
- 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
- Webhook in: Meta posts each incoming message to your n8n webhook URL.
- Parse: pull out the phone number, name and message text.
- Think: send the text plus the system prompt to the LLM and get a reply.
- Reply: POST the answer back through the Cloud API messages endpoint.
- 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
- Always offer a human handoff — the bot says it and the message lands in a real staff inbox.
- Never let the bot invent prices: hard-code the rule that unknown prices mean 'I will check and get back to you.'
- Add a blocklist of topics (refunds, complaints, legal) that always escalate to a human.
- Reply within two seconds — WhatsApp users expect instant answers.
- Store phone numbers only for active conversations and delete them on request.
What it costs
| Item | Cost | Note |
|---|---|---|
| Cloud API | $0 | First 1,000 service conversations per month |
| LLM brain | $0 | Free tiers: DeepSeek, Gemini, Groq |
| n8n | $0 | Self-hosted community edition |
| Total | $0/month | Until 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

