# How to build a WhatsApp chatbot without code (step by step)

> Build a WhatsApp chatbot in On-chat's visual flow builder by creating a flow, adding messages and a wait-for-response split, then calling a webhook for live data. Finish with a ticket for human handoff, test every path in the simulator and launch it with a keyword trigger.

URL: https://on-chat.live/guides/how-to-build-a-whatsapp-chatbot/
Last updated: 2026-10-27

A good WhatsApp chatbot does more than reply with a menu. It understands what the customer chose, remembers their details, looks things up in your systems and knows when to bring in a person. In this tutorial you'll build exactly that in On-chat's [visual flow builder](https://on-chat.live/flow-builder/), without writing code.

By the end you'll have a working order-support bot that:

- greets the customer by name,
- asks what they need and branches on the answer,
- looks up a live order status from your system,
- hands the chat to an agent when needed.

## What you need before you start

You need an On-chat workspace, a WhatsApp Business Platform number and about 30 minutes.

1. **An On-chat workspace.** [Start a free 30-day trial](https://on-chat.live/org/signup/) if you don't have one.
2. **A WhatsApp Business Platform number** connected as a channel. If you haven't set one up yet, follow our guide on [getting the WhatsApp Business API](https://on-chat.live/guides/whatsapp-business-api-setup/) first.
3. **About 30 minutes.**

You can build and test the whole flow in the simulator before your WhatsApp number is connected, so don't wait on approval to start designing.

## Step 1: Plan the conversation on paper

Five minutes of planning saves an hour of rebuilding. Write down:

- **The goal.** For this bot: "Resolve order questions without an agent where possible."
- **The entry point.** Customers will start by sending a keyword such as `order`, or any message if this is your main number.
- **The decisions.** Track an order, change delivery, or talk to someone.
- **The exits.** Every path should end with the customer helped, or handed to a person.

A simple sketch is enough:

```
Greeting → What do you need?
   ├─ Track order → Ask order number → Look up status → Send status
   ├─ Change delivery → Ask order number → Open ticket for the delivery team
   └─ Talk to someone → Open ticket
```

## Step 2: Create a flow

Create a new Messaging flow in On-chat and open it in the visual editor.

1. Go to **Flows** and create a new flow.
2. Name it something clear, like `Order support`, and choose the **Messaging** flow type.
3. The editor opens with an empty canvas. Every flow is built from two kinds of blocks:
   - **Actions** do something, such as *Send the contact a message*, *Update the contact* or *Open a ticket with a human agent*.
   - **Splits** decide where to go next, such as *Wait for the contact to respond*, *Split by a custom expression* or *Call a webhook*.

## Step 3: Greet the customer and ask what they need

Add a **Send the contact a message** action:

> Hi @contact.first_name 👋 Welcome to Nile Store support. What can I help you with?

`@contact.first_name` is an **expression**. When the message is sent, it's replaced with the customer's first name from their WhatsApp profile or your contact data. Expressions are what make a flow dynamic, and you'll use more of them below.

Add **quick replies** to the same message so customers can tap instead of type:

- `Track my order`
- `Change delivery`
- `Talk to someone`

## Step 4: Wait for the answer and branch

Connect the message to a **Wait for the contact to respond** split. Add one rule per path:

| Rule | Value | Category |
|---|---|---|
| has any of the words | track, status, where | Track |
| has any of the words | change, delivery, reschedule | Change |
| has any of the words | agent, someone, human | Agent |

Customers who type something unexpected land in **Other**. Don't leave it empty. Send a short "Sorry, I didn't catch that" and loop back to the question, or route it to an agent after the second miss.

Give the result a name such as `need` using **Save as**. You can then use `@results.need` anywhere later in the flow, and it appears as a column when you export results.

## Step 5: Ask for the order number

On the **Track** path, send:

> Sure. What's your order number?

Then add another **Wait for the contact to respond** with the rule **has a number** and save the result as `order_number`. If the customer replies with text, the **Other** branch can ask again: "Please send just the number on your receipt, like 48213."

## Step 6: Look up live data with a webhook

This is where your chatbot stops being a script. Add a **Call a webhook** split:

- **Method:** `GET`
- **URL:** `https://api.your-store.com/orders/@results.order_number`

When the flow reaches this step, On-chat calls your API and stores the JSON response. If your API returns:

```json
{ "status": "shipped", "eta": "2026-11-02", "courier": "Aramex" }
```

then the next message can read:

> Your order @results.order_number has @webhook.status with @webhook.courier and should arrive on @(format_date(webhook.eta)).

The webhook split has **Success** and **Failure** exits. Always connect **Failure** to something useful, such as "I couldn't find that order. Let me connect you to the team," followed by a ticket.

Want to branch on the status itself? Add a **Split by a custom expression** on `@webhook.status`, with rules for `shipped`, `processing` and `delivered`, and a different message for each. Our guide to [dynamic chatbots with webhooks](https://on-chat.live/guides/dynamic-chatbot-webhooks/) covers this in depth.

## Step 7: Hand off to a human

On the **Change** and **Agent** paths, add **Open a ticket with a human agent**:

- **Topic:** Delivery (or General)
- **Body:** `Order @results.order_number, wants: @results.need`

Then send a message so the customer knows what's happening:

> Thanks! I've passed this to our delivery team. Someone will reply right here shortly.

The ticket appears in the agent workspace with the full conversation. An agent accepts it, which locks it to them, and replies from the same WhatsApp thread. See [live chat ticketing](https://on-chat.live/live-chat-ticketing/) for how agents work with tickets.

## Step 8: Test every path in the simulator

Open the **Simulator** and play the customer:

1. Tap each quick reply and check you reach the right branch.
2. Type something random to test **Other**.
3. Enter a valid and an invalid order number to test both webhook exits.

Fix anything that feels slow or confusing. A good rule: no customer should need more than three messages to reach the answer or a person.

## Step 9: Go live with a trigger

Flows start from **triggers**. For this bot:

- Create a **Keyword Trigger** for `order` so customers can start it any time.
- If this is your main support number, add a **Catch All** trigger so any message that doesn't match another keyword starts the flow.

Watch the first conversations come in. The editor shows how many contacts took each path, which quickly reveals where people get stuck.

## What to build next

Once the bot works, make it more personal, more reusable and multilingual.

- **Personalise more.** Save the order number to a contact field so returning customers aren't asked again.
- **Reuse steps.** Move "ask for order number" into its own flow and enter it from other flows with **Enter another flow**.
- **Speak their language.** Translate the flow once and each contact automatically gets their own language.

Read [chatbot flow design best practices](https://on-chat.live/guides/chatbot-flow-design-best-practices/) before you build your second flow, or [start building for free](https://on-chat.live/org/signup/).

## Put this guide into practice

- [Visual flow builder](https://on-chat.live/flow-builder/): Build dynamic conversation flows without code: branch on answers, use live data from your systems and run one flow on WhatsApp, SMS and voice.
- [WhatsApp chatbot](https://on-chat.live/whatsapp-chatbot/): Build a WhatsApp Business chatbot without code. Answer FAQs, take orders, send template messages and hand chats to live agents. Free 30-day trial.

## Keep reading

- [Build a Lead Qualification Chatbot Flow](https://on-chat.live/guides/lead-qualification-chatbot-flow/): Qualify leads automatically on WhatsApp and SMS. A ready-to-build chatbot flow that scores leads, routes hot ones to sales and nurtures the rest.
- [How to Get the WhatsApp Business API](https://on-chat.live/guides/whatsapp-business-api-setup/): What you need to get WhatsApp Business API access, how to set it up step by step, and how to connect it to your chatbot flows.
- [Chatbot Flow Design: 12 Best Practices](https://on-chat.live/guides/chatbot-flow-design-best-practices/): Practical rules for designing chatbot conversation flows that customers finish: branching, fallbacks, personalisation, handoff and testing.
