CodeWords raises $9M seed round
BlogResources

How to build multi-stage conversation flows for WhatsApp bots

Learn how to build multi-stage WhatsApp conversation flows — booking, lead qualification, and more — with AI memory and plain-English agent descriptions.

Rebecca PearsonRebecca Pearson6 min read
How to build multi-stage conversation flows for WhatsApp bots

A single-turn WhatsApp bot answers one question. A multi-stage WhatsApp conversation flow guides a customer through a complete process — asking the right questions in the right order, remembering what they said, and finishing with a confirmed action.

The difference is the difference between a bot that says "our hours are 9–5" and a bot that books an appointment, collects a deposit, and sends a confirmation — all in one conversation.

TL;DR

  • Multi-stage flows guide customers through multiple steps — question, follow-up, confirmation — in a single coherent conversation.
  • Conversation memory is what makes this possible. Without it, each message arrives without context and the flow breaks.
  • You can describe multi-stage flows to Cody in plain English — no flowchart builder or node editor required.

What "multi-stage" means

A multi-stage conversation flow is one where the bot needs more than one exchange to complete a task. The bot asks something, the user responds, the bot asks a follow-up, the user responds again, and so on until the task is done.

This is how most real-world business interactions work. A booking doesn't happen in one message. A sales qualification takes several questions. Even a basic support request usually requires the bot to clarify what kind of issue it is before it can help.

The challenge is that WhatsApp messages arrive independently — each one is a separate event with no built-in link to previous messages. Without an explicit memory layer, the bot treats every message as a fresh start, which makes multi-stage flows impossible.

With Redis-backed conversation memory (which CodeWords includes by default), the bot retrieves the full conversation history on every message and maintains context across the entire exchange.

Designing a multi-stage flow

Every good multi-stage flow has the same structure:

Opening: the bot acknowledges the customer's intent and sets expectations. "I can help you book an appointment. I just need a few details."

Qualification/data collection: the bot asks its questions one at a time. Asking everything at once overwhelms people. One question per message feels like a conversation, not a form.

Confirmation: before taking any action, the bot repeats back what it understood and asks the customer to confirm. "So that's a 45-minute facial on Thursday the 18th at 2pm — does that look right?"

Action and follow-up: the bot takes the action (creates a booking, updates a CRM record, sends an invoice), then confirms it to the customer and tells them what happens next.

Escalation: if something goes wrong, or the customer asks something outside the bot's scope, it knows when to hand off to a human. "Let me pass you to a member of the team for that one."

Keeping state across messages

The bot knows where it is in a multi-step flow because the conversation history is included in every AI prompt. The AI model reads the history, understands what's already been collected, and knows what to ask next.

For example, in a booking flow, the conversation history might show:

  • Bot asked for preferred date → customer said "next Thursday"
  • Bot asked for preferred time → customer said "early afternoon"
  • Bot now needs to confirm the specific slot

The AI reads all of this in the prompt and asks the natural next question: "I have 1pm and 2pm available on Thursday the 17th — which works best for you?"

This is why the AI model choice matters. More capable models (like GPT-5 or Claude Sonnet 4.6, both included in CodeWords) are better at following complex multi-step instructions and maintaining context reliably over long conversations.

Example flow 1: appointment booking

Here's how a booking flow looks in practice:

Customer: "Hi, I'd like to book a haircut"

Bot: "Great, I'd love to help. What day works best for you?"

Customer: "Saturday"

Bot: "I have 10am, 12pm, and 3pm available this Saturday. Which would you prefer?"

Customer: "12 sounds good"

Bot: "And what's your name, so I can put the booking under your details?"

Customer: "Emma"

Bot: "Thanks Emma. Just to confirm — a haircut on Saturday at 12pm. Is that right?"

Customer: "Yes"

Bot: "Booked. You'll get a reminder on Friday morning. See you Saturday."

Each step is one question. The bot doesn't ask for the name and preferred time in the same message. It doesn't ask for payment details before confirming the slot. It moves through the stages naturally, like a human receptionist would.

Example flow 2: lead qualification

Here's a lead qualification flow for a B2B software product:

Customer: "I'm interested in your platform for my team"

Bot: "Great to hear. How large is your team — roughly how many people would be using it?"

Customer: "About 15"

Bot: "And are you currently using any tools for this, or would this be starting from scratch?"

Customer: "We use spreadsheets mostly"

Bot: "Got it. What's the main thing you're hoping to improve — is it speed, accuracy, reporting, or something else?"

Customer: "Mainly reporting and visibility"

Bot: "Thanks — that's really helpful. One last thing: are you looking to get something in place in the next month or two, or is this more of a longer-term evaluation?"

Customer: "We'd like to move soon"

Bot: "This sounds like a great fit. I'm going to pass your details to our team with a summary — someone will reach out within a few hours to arrange a demo. Is that okay?"

At this point, the bot has collected company size, current solution, primary pain point, and urgency. It pushes all of this to the CRM with a lead score and hands off to a human rep.

How to describe multi-stage flows to Cody

When you build with CodeWords, you describe the flow you want in plain English. You don't draw a flowchart. You don't configure state machines. You just explain the conversation to Cody (the AI automation assistant).

A good description for a booking flow might be:

"When someone asks to book an appointment, guide them through booking in the following order: preferred day, preferred time from available slots, their name, and a confirmation. Once confirmed, create a booking in Calendly and send them a confirmation message. If they ask anything unrelated to booking, tell them you can help with bookings and offer to pass them to a human for other questions."

That's enough for Cody to build a working multi-stage booking flow. You can add detail as needed — specific available times, what to do when someone cancels, how long before the appointment to send a reminder.

For a deeper look at how memory works under the hood, read how to add AI memory to your WhatsApp chatbot. If you want to see the full CodeWords setup process, how to build WhatsApp AI agents with CodeWords walks through every step from account setup to going live.

Build your first multi-stage flow on CodeWords — describe the conversation to Cody and it'll handle the rest.

Get started today

Your first agent is free to build.

Describe what you need. Cody handles the build, the connections, and the deployment.