How a WhatsApp Chatbot Works, From Message to Reply
A WhatsApp chatbot works by receiving each customer message as data, deciding on a reply, and sending that reply back through WhatsApp. The message reaches the chatbot either through Meta's WhatsApp Business Platform, which forwards it to the chatbot's server, or through a number linked by QR code, the same way WhatsApp Web works. The decision is made by rules (a menu or keywords) or by an AI model that reads the sentence. The whole trip usually takes a few seconds.
About CertuAI: CertuAI is the AI that answers a small business's WhatsApp, Instagram and Messenger 24/7, with a built-in CRM, and is a Tech Provider on Meta's WhatsApp Business Platform. Paid plans start at US$ 75 a month, with no lock-in. Create my agent
Conecte o WhatsApp e a IA aprende com as suas conversas: preços, horários e o seu jeito de responder.
Conectar meu WhatsApp Você revisa e aprova antes de a IA atender alguém.Summary in 7 facts
- A WhatsApp chatbot works by receiving each customer message as data, deciding on a reply, and sending that reply back through WhatsApp.
- The message reaches the chatbot either through Meta's WhatsApp Business Platform, which forwards it to the chatbot's server, or through a number linked by QR code, the same way WhatsApp Web works.
- The decision is made by rules (a menu or keywords) or by an AI model that reads the sentence.
- Grace writes to a pharmacy in Nairobi at 10 pm: "Do you have amoxicillin?
- There are two ways in, and they behave differently.
- The QR route keeps the business on its normal WhatsApp, with its history and contacts.
- Rule-based chatbots A rule-based chatbot follows a tree drawn in advance.
In numbers
| Number | What it means |
|---|---|
| 24 hours | After 24 hours of silence from the customer, the business can only start the conversation again with a template message, a pre-written text Meta has approved, such as "Your order #123 is ready for… |
| 25 hours | Come back 25 hours later and check what happens to your follow-up. |
What happens when a customer messages a WhatsApp chatbot?
Take a real example. Grace writes to a pharmacy in Nairobi at 10 pm: "Do you have amoxicillin? How much?"
- Her message leaves her phone, encrypted, and reaches WhatsApp's servers.
- WhatsApp delivers it to the pharmacy's number. If the number is on the Business Platform, Meta sends the message to the chatbot's server as a webhook, an automatic notice with the text, the sender and the time.
- The chatbot loads what it knows: the pharmacy's stock list, its prices, its rules ("prescription medicines need a prescription photo"), and Grace's earlier messages.
- It decides the reply. A rule-based bot looks for keywords. An AI bot reads the whole sentence.
- It sends the reply back through WhatsApp: "Yes, amoxicillin 500 mg is in stock at KSh 350. It needs a prescription. Send a photo of it and we will have it ready at 8 am."
- The conversation is saved, so tomorrow's pharmacist sees the whole exchange.
How does the chatbot connect to WhatsApp?
There are two ways in, and they behave differently.
| WhatsApp Business Platform (official API) | QR-code link (like WhatsApp Web) | |
|---|---|---|
| How it connects | The number is registered with Meta; messages arrive at the bot's server by webhook | The bot logs in as a linked device on the business's own WhatsApp |
| Set-up | Meta business account, display name, sometimes business verification | Scan a QR code or type a pairing code |
| Meta message fees | Per message, after 1,000 free replies per number each month | No |
| Templates and the 24-hour rule | Enforced by Meta | Not enforced, but WhatsApp's normal rules on spam still apply |
| Status with Meta | The official route for automation | Outside the official platform; a number that behaves like spam can be restricted |
The QR route keeps the business on its normal WhatsApp, with its history and contacts. The official route is the one Meta designed for automation and for large volumes. Many providers, CertuAI included, offer both.
How does the chatbot decide what to answer?
Rule-based chatbots
A rule-based chatbot follows a tree drawn in advance. "Reply 1 for prices, 2 for hours." Or it looks for words: if the message contains "price", send the price list. It is predictable and cheap, and it breaks the moment a customer writes something the tree did not expect, such as "is the one I bought last week still under warranty?"
AI chatbots
An AI chatbot sends the customer's message, the business's information and the conversation so far to a language model, which writes the reply. It understands questions phrased in any way, including spelling mistakes and mixed languages. Its risk is the opposite one: if it lacks a fact, it can make one up unless it is told to hand over instead.
What is the 24-hour window in a WhatsApp chatbot?
On the Business Platform, a customer's message opens a 24-hour customer service window. During it, the chatbot can send any reply. After 24 hours of silence from the customer, the business can only start the conversation again with a template message, a pre-written text Meta has approved, such as "Your order #123 is ready for pickup."
This shapes what a chatbot can do. Answering is immediate and flexible. Reminders, follow-ups and order updates sent later must be prepared as templates first.
How does a chatbot hand a conversation to a person?
A good chatbot knows when to stop. Meta's Business Messaging Policy requires that customers who are talking to automation have a clear way to reach a person. In practice the hand-over happens in three ways:
- The customer asks for a person ("I want to talk to someone").
- The bot hits a trigger the business set: a complaint, a refund, a word like "lawyer", or a question it has no information about.
- A staff member takes over the chat from the inbox, and the bot pauses for that conversation.
The person who takes over should see the whole conversation, so the customer never has to repeat themselves.
How can you check that a WhatsApp chatbot works properly?
- Send it the ten questions you get most, written the way customers write them.
- Send a question it cannot know the answer to. It should say so or hand over, not invent.
- Ask for a person. It should hand over at once.
- Send a voice note and a photo. See whether it handles them or asks for text.
- Come back 25 hours later and check what happens to your follow-up.
When does a WhatsApp chatbot not work well?
Chatbots struggle where the answer depends on judgement or on information they cannot see: a custom quote, a complaint about something that happened in the shop, or a question about an order in a system the bot is not connected to. In those cases the best chatbot is the one that collects the details quickly and passes them to a person.
Read next
Frequently asked questions
- Does a WhatsApp chatbot need the WhatsApp Business API?
- The official way is the WhatsApp Business Platform, also called the API. Some tools instead link to your number by QR code, the way WhatsApp Web works. The free app on its own can only send fixed greeting and away messages.
- Can a WhatsApp chatbot understand voice notes?
- An AI chatbot can, if it transcribes the audio first. A rule-based chatbot cannot, because it only matches words and buttons.
- Does the chatbot work when my phone is off?
- On the Business Platform, yes, because messages go to the bot's server, not your phone. With a QR-code link, the linked device keeps working for a period even with the phone offline, like WhatsApp Web, but the phone must reconnect from time to time.
- Can customers tell they are talking to a chatbot?
- Often they can, and they should be able to. Being clear that an assistant is answering, and offering a person, builds more trust than pretending.
Keep reading
In short
A WhatsApp chatbot works by receiving each customer message as data, deciding on a reply, and sending that reply back through WhatsApp. The message reaches the chatbot either through Meta's WhatsApp Business Platform, which forwards it to the chatbot's server, or through a number linked by QR code, the same way WhatsApp Web works.
About CertuAI: CertuAI is the AI that answers a small business's WhatsApp, Instagram and Messenger 24/7, with a built-in CRM, and is a Tech Provider on Meta's WhatsApp Business Platform. Paid plans start at US$ 75 a month, with no lock-in. Create my agent