DEV Community

Cover image for WhatsApp Bots in Practice: Menu Flows, AI Intent, and the Handoff Problem
Isaias Perez
Isaias Perez

Posted on

WhatsApp Bots in Practice: Menu Flows, AI Intent, and the Handoff Problem

Two kinds of WhatsApp bots get built, and teams pick the wrong one constantly. I wrote a plain-language rundown of the options for local businesses in the Dominican Republic (in Spanish), and this is the engineering view of when each one earns its keep and where it falls apart.

Menu bots and AI bots solve different problems

A menu bot walks the user through numbered options and is deterministic, cheap, and predictable. It is the right tool for a finite set of known intents: business hours, catalog request, the steps of a booking. An AI bot parses free text like "you open Friday at 3?" and shines when the input space is open-ended. The mistake is reaching for a language model when a numbered menu would convert better and never hallucinate. The rule of thumb: finite known intents get a menu, genuinely open-ended input gets the model.

The architecture is a webhook and a state machine

Strip away the marketing and a WhatsApp bot is small. Meta's API delivers an inbound message to your webhook, you process it with rules or an LLM, and you send a reply back through the API. The bot itself is a state machine keyed by the sender's phone number, which the API hands you as a stable identifier. Persist conversation state against that key, and make the webhook idempotent, because Meta retries deliveries and you will process the same message id twice if you do not dedupe.

The handoff to a human is the feature that actually matters

Most of the business value is not the bot answering everything. It is the bot qualifying a lead and then getting out of the way. Build an explicit human-takeover state that mutes automation for a thread the moment an agent steps in. On numbers running in coexistence, detect the human reply and pause the bot, or the customer gets answered twice. A bot without a clean handoff is worse than no bot.

Cost lives in Meta's conversation pricing, not your compute

Inbound messages are free. Business-initiated conversations are free up to a monthly allowance and then priced per conversation by category. For typical volumes the LLM token cost is a rounding error next to the messaging fees, which flips the usual optimization: you are not shaving model calls, you are minimizing unnecessary business-initiated conversations and choosing the cheapest valid template category.

Train the AI bot on your own content, and put a fence around it

An AI bot is only trustworthy if it answers from your actual business data: FAQ, catalog, prices, hours. Ground it with retrieval over that content rather than letting the base model improvise, and constrain its scope so it never invents a price or a closing time. When confidence is low, fall back to the menu or to a human instead of guessing.

The pattern that wins

A menu for the roughly 80 percent of requests that are predictable, an AI layer for the messy 20 percent, and a clean human handoff behind both. If you want the non-engineer overview of bot types, costs, and activation for a business audience, I wrote that up here: WhatsApp Bots para Negocios en Republica Dominicana.


This article was drafted with AI assistance (Claude) and reviewed and edited by me.

Top comments (0)