How this workflow fits
How the chatbot answers a message
Connect your WhatsApp number by QR code and add a webhook. Each message a customer sends arrives as a message.any event with the chat ID and the text. Your handler gives the text and the recent conversation to the model, then sends the answer with the send-text-safe endpoint, which paces the reply and shows typing first.
- Use any model: OpenAI, Anthropic, Google, or one you host yourself.
- Keep each customer's history by chat ID so answers follow the conversation.
- Skip your own messages (fromMe) and group chats unless the bot should answer them.
Hand the chat to a person
A good chatbot knows when to stop. Send the conversation to your team when the customer asks for a person, mentions a refund or complaint, or the model isn't sure. Pass it to the tool your team already uses, such as a helpdesk, Slack or a CRM, and pause the bot in that chat until someone closes it.
- Keep a per-chat flag that turns the bot off while a person is handling it.
- Tell the customer right away that someone will follow up.
- Log each answer so you can review what the bot said.
Keep the bot and your number safe
Customer messages are text written by strangers, so treat them as data. Put your business facts in the model's instructions, send each reply only to the chat it came from, and don't let the model choose who to message. Reply to people who wrote to you first, and keep the pace human to protect your number.
- Answer from your own facts: prices, opening hours, policies.
- Use it for conversations customers start, not cold campaigns.
- Read how to avoid a WhatsApp number ban before you go live.

