WhatsApp Business

Designing a WhatsApp Booking Bot Around the Customer Service Window

Designing a WhatsApp Booking Bot Around the Customer Service Window

Lessons from building WhatsApp booking flows: how the customer service window shapes conversation design, reminders, and handoff to operations.

The WhatsApp rule that shapes every booking bot

On WhatsApp, a business can send free-form messages only while the customer service window is open. The window opens when the customer messages the business and lasts 24 hours from their last message. Outside it, only approved templates can be sent.

In a booking product, this single rule decides how confirmations, reminders, driver updates, and follow-ups are designed. When I built WhatsApp booking flows for ride and delivery services, the window logic became one of the core parts of the backend.

Track the customer service window per conversation

The backend stores the timestamp of each customer's last inbound message, taken from the webhook event. Before sending anything, the messaging service checks whether the window is open. If it is, the bot can send a normal or interactive message. If not, it must use an approved utility template.

WINDOW = timedelta(hours=24)

def send_update(conversation, text, template=None, params=()):
    if now() - conversation.last_inbound_at < WINDOW:
        return whatsapp.send_text(conversation.phone, text)
    if template is None:
        raise PolicyError("Window closed and no template provided")
    return whatsapp.send_template(conversation.phone, template, params)

Every outbound message in the product goes through this function. No other part of the code calls the WhatsApp API directly.

Designing the booking flow to stay inside the window

  • Collect pickup, destination, time, and passenger details in one active session using reply buttons, list messages, or WhatsApp Flows.
  • Confirm the booking immediately while the customer is engaged.
  • Use utility templates for later updates, such as driver assigned, driver arriving, or schedule changes.
  • Add quick reply buttons to templates, so a customer tap reopens the window for follow-up.
  • Keep reminders close to the event, when the customer expects them.

Structured input beats free text

Early versions of booking bots often ask open questions and let an AI model interpret the answers. That works, but it is slower, more expensive, and less reliable than structured input. Moving common steps to buttons, lists, and Flows reduced AI usage significantly in the systems I worked on, while making bookings more accurate.

I now use AI where it adds value, such as understanding an unusual request or a free-form address, and structured interactions everywhere the options are known. The broader design is in building an AI reply agent without breaking Meta policies.

Connect WhatsApp to the core booking workflow

WhatsApp should be an interface, not a separate booking system. WhatsApp bookings enter the same ride lifecycle as bookings from the customer app or dashboard. The bot collects input and shows status, while pricing, driver matching, and state transitions stay in the core backend. This keeps business rules in one place and makes every channel behave consistently.

Human takeover for operations teams

Some conversations need a person: unusual requests, complaints, or failed payments. The bot hands the conversation to an operations dashboard, pauses automation for that customer, and shows the agent the full context, including the booking state.

Agents also see whether the window is open, and for how long. If it is closed, the dashboard offers only approved templates. This prevents failed sends and policy problems, and it teaches agents the rule without extra training.

Testing the messaging window logic

Window logic is easy to get wrong and hard to notice in manual testing, because the window is open during most tests. I make the clock injectable and write tests for each case: a message just inside the window, just outside it, a template fallback, a missing template, and a customer reply that reopens the window. These tests run in milliseconds and catch regressions before customers see failed messages.

In staging, I also run a scheduled job that sends test updates to internal numbers with deliberately expired windows. It confirms that templates are approved, variables match, and the fallback path works with the real API.

Edge cases worth handling

  • The customer replies after the window closes: the window reopens, so pending free-form updates can be sent.
  • A template is paused or rejected: alert operations and fall back to another channel, such as SMS or an app notification.
  • Duplicate webhook deliveries: deduplicate by message ID so the bot does not answer twice.
  • Messages arriving out of order: process per conversation in sequence.
  • The customer changes the booking mid-trip: route the request through the same lifecycle rules as the app.

Frequently asked questions

How long is the WhatsApp customer service window?

24 hours from the customer's last message. Each new customer message resets it.

Can I send a reminder after 24 hours?

Yes, but only with an approved template, usually in the utility category for booking reminders.

Does a button tap reopen the window?

Yes. A quick reply tap is a customer message, so it opens a new 24-hour window.

Should a booking bot use AI for every message?

No. Use structured input for known options and AI for genuinely free-form requests. It is cheaper and more reliable.