# Build a bot flow

> Walk customers through a conversation step by step, like checking an order or booking a fitting.

Source: https://docs.soosh.io/guides/chatbot/build-a-bot-flow/

A flow is a series of steps the bot runs when a customer's message contains
one of its trigger words. Flows go first: before keyword replies and AI
answers.

## Before you start

- Owner, admin or manager role in Soosh

## Create the flow

1. Go to [**Automation > Bot flows**](https://app.soosh.io/chatbot/flows) and click **Create flow**.
2. In **Name**, enter what it does, like *Order status*.
3. With no step selected, the panel on the right shows **Flow settings**. In
   **Trigger keywords**, enter the words that start it, separated by commas,
   like *order, track, where is my*.
4. Under **Add node**, click a kind of step to add it. The first one is joined
   to **Start** for you.
5. Click a step to set it up in the panel on the right.
6. Join steps by dragging from the dot under one step to the next step.
7. Click **Save flow**.

   *Picture: The flow builder for Order status: the Add node bar, a Start step joined to a Transfer step, and the Transfer step's settings on the right*

## The kinds of step

- **Text**: sends a message. Set **Expected response** to wait for the
  customer's answer and save it, like an order number, with **Store response
  as**.
- **Buttons**: a message with up to 10 reply buttons; each button leads to its
  own next step. Or link and phone buttons.
- **API**: asks your system, like your order system, and saves parts of the
  answer.
- **WA Flow**: sends a WhatsApp form.
- **Transfer**: hands the chat to a team, or the general queue, with a message
  to the customer and a note for agents.
- **Condition**: goes one way or another, depending on what was saved.
- **Timing**: goes one way in opening hours, another outside them.
- **Go to Flow**: carries on in another flow.
- **End**: ends the flow, with an optional last message.

In any message, `{{contact_name}}` and the names you saved, like
`{{order_number}}`, are filled in.

## Try it

Click **Preview**, then start the preview. A phone shows the conversation, and
you answer as the customer. For **API** steps you enter what your system would
answer.

## Result

With **Enabled** on, the flow runs for every new message that contains a
trigger word. Turn a flow on or off from the **Bot flows** list, too.

## Related

- Guide: [Set up keyword replies](https://docs.soosh.io/guides/chatbot/set-up-keyword-replies/)
- Guide: [Hand chats to agents](https://docs.soosh.io/guides/chatbot/hand-chats-to-agents/)
