How to Build a WhatsApp AI Chatbot for Your Business

There are two ways to build a WhatsApp AI chatbot. Developers can write one: register for the WhatsApp Cloud API, build a webhook that receives messages, call an AI model, and send the reply back through the API. Twilio and Meta both publish tutorials for that route, and it suits teams that want full control and have someone to maintain the code.
Most businesses take the other route: a no-code platform that already handles the WhatsApp connection, the inbox, the handover to staff and the booking calendar, so you only supply the AI key, your business information and the instructions. This guide walks through that route in Whautomate, step by step. Allow an afternoon, most of it spent writing a good knowledge base.
Watch the full build first, then follow the steps below:
What you need before you start
- A WhatsApp Business API number. Either a new number, or the number you already use in the WhatsApp Business app, connected with Coexistence so you keep the app on your phone.
- An AI provider account with an API key: OpenAI, Google Gemini, xAI (Grok) or Anthropic (Claude). You pay the provider directly for usage.
- Your business information in a few short documents: services and prices, opening hours, location, policies and your most common questions with their answers.
Step 1: Connect your WhatsApp number
In Whautomate, go to Integrations > WhatsApp and click Connect with Facebook. In the Facebook window, log in with the account that manages your business, pick or create your WhatsApp Business Account and verify the number. If the number is already on the WhatsApp Business app, choose to connect that app in the same window to keep using it alongside the bot. The embedded signup guide covers each screen.
Step 2: Add your AI provider key
Open Integrations, choose your AI provider and paste the API key on the Configuration tab. A few differences to know when you choose:
- Voice notes: OpenAI and Google Gemini can transcribe them; the others cannot.
- Knowledge base: OpenAI, Gemini and Grok search your documents and read only the relevant passages. Claude reads every file with each message, so keep its files few and short.
- Grok needs a second key, the management key, to use a knowledge base.
Step 3: Build the knowledge base
On the provider’s Vector Stores/Datasets tab, upload the documents the bot should answer from. This is where most of the quality comes from. Keep each document focused (one for prices, one for policies, one for FAQs), write answers the way you would say them in a chat, and remove anything out of date. A bot cannot be more accurate than the documents behind it.
Step 4: Write the prompt
Create an automation rule with the Incoming WhatsApp Messages trigger and add the AI Conversation action, or start from the ready-made template Customer Service GPT for your business - AI Chatbot (WhatsApp). The System Message tells the bot who it is and what it may do:
You are Clara, the assistant for Serene Wellness Studio.
Answer only from the knowledge base. Keep replies under 80 words.
If you do not know the answer, or the customer asks for a person,
say you are connecting them to the team and use assignChatToUnassignedQueue.
Good prompts are short and specific: a name and tone, what to answer from, how long replies should be, which language to use, and exactly when to hand over. Add a Failure Message for the rare case the AI provider is unavailable, such as “I will pass you to a colleague, please hold on.”
For customer service, set Temperature around 0.2 for predictable answers, and keep Conversation History Limit high enough that the bot remembers what was said earlier in the chat.
Step 5: Give the bot tools
Answering questions is half the job. Tools let the bot act:
- Booking tools: list services and staff, suggest free slots, book an appointment, or book with payment (the customer gets a payment link valid for 10 minutes). On WhatsApp the bot can also view, reschedule and cancel bookings. See the AI appointment booking chatbot.
- Class tools: search classes, book a place, book with payment, list the customer’s bookings and cancel one.
- Contact tools: read and update the contact, add tags, save notes and fill custom fields, so every chat leaves a useful record in your CRM.
- Handover tools: assign the chat to the unassigned queue or round robin. Always turn on at least one, so the bot can pass a customer to a person.
- Functions: call your own systems over HTTPS, for example to look up an order status.
Mention each tool by name in the prompt (the name in brackets, such as bookAppointment) and say when to use it.
Step 6: Test in the Playground, then go live
Use the Playground tab to chat with the bot before customers do. Ask it the twenty questions your team hears most, a few it should refuse, and at least one where it should hand over. Fix the knowledge base or the prompt, not the answers one by one.
When it behaves, save the rule. Add conditions if you want, for example to answer only text, voice and image messages. While a team member has a chat open, the bot stays quiet unless you turn on Override Human Agent, so your team can always take over.
Step 7: Keep improving it
For the first few weeks, read a sample of bot conversations every week. Each wrong or weak answer points to a gap in the knowledge base or a vague instruction. Add the missing answer, tighten the prompt, and test again. Two more actions help: Smart AI Follow-Up writes a follow-up if the customer goes quiet, and Clear AI Conversation History resets what the bot remembers when a chat is closed.
Code or no code: which should you choose?
| Build it yourself | No-code platform | |
|---|---|---|
| Time to launch | Weeks | An afternoon |
| WhatsApp connection | You build webhooks and token handling | Embedded Signup |
| Handover to staff | You build an inbox | Shared team inbox and mobile app |
| Booking and payments | You integrate a calendar and gateway | Built in |
| Other channels | One integration each | Instagram, Messenger, Telegram, TikTok and website chat |
| Maintenance | Your team | The platform |
Building it yourself makes sense when the bot is the product, or you need something no platform offers. For a business bot that answers customers and books them in, a platform gets you there faster and keeps working when Meta changes its API.
Is an AI chatbot allowed on WhatsApp?
Yes, when the bot serves your own customers. Since 15 January 2026, Meta’s WhatsApp Business Platform terms (formerly the Business Solution Terms) stop AI providers from offering general-purpose AI assistants on the platform when the AI itself is the product, except in countries where Meta is legally required to allow it. A bot that answers questions about your business, books appointments and hands over to your team is a business bot, and that stays allowed. Keep its instructions focused on your business and always give customers a way to reach a person.
The same bot on every channel
The AI Conversation action also works on incoming messages from Instagram, Messenger, Telegram, TikTok and your website chat. Add the same action to those triggers and customers get the same answers wherever they write, with every conversation in one team inbox. See AI chatbots for everything the bot can do.


