Building a Flow
Overview#
This walks through one flow end to end — a customer renewing an insurance policy — and then covers what the editor warns you about and how to test what you built.
Creating the flow#
- Open the agent in the builder and go to Flows.
- Choose New flow and give it a Flow name. Names must be unique within the agent — the editor says so if you reuse one, because flows refer to each other by name.
- Fill in Starts when:
the customer wants to renew their policy.
Laying out the steps#
A renewal flow, in order:
- Send a message — "Happy to help with your renewal." Carry on.
- Ask a question — "What's your policy number?" with a checked answer: the pattern for a policy number, and a retry message that gives an example.
- Call a tool — look the policy up.
- It worked → continue to step 4.
- It didn't → a message apologising, then Hand off to a person.
- Send a message — confirm what was found.
- Ask a question — "Shall I start the renewal?" with options: Yes, No.
- Yes → the step that starts it.
- No → a message, then End the flow.
- Anything else → back to the question.
Build the unhappy paths as you go
It is tempting to lay out the path where everything works and fill in the rest later. The rest is where customers end up — a wrong policy number, an API that is down, a "no" at the end. Build each branch as you create it, while you still remember what it was for.
What the editor warns you about#
The editor marks problems as you work. The common ones:
| Warning | What it means |
|---|---|
| This flow has no start | No starting condition, so nothing will ever enter the flow. |
| Add the first step | A start, but nothing to do. |
| Nothing leads to this step | An orphan — usually left behind after rearranging. |
| Nothing happens after the call | A tool step whose branches go nowhere. |
| An Ask step has no question | A question step that does not ask anything. |
| Add the options the answer must be one of | An options answer with no options. |
| The answer format isn't a valid pattern | A checked answer whose pattern cannot be read. |
| Another flow already has this name | Two flows sharing a name, so references between them are ambiguous. |
None of these are style notes. Each one is a way the flow can leave a customer stuck.
Testing it#
Test the flow in the Playground, as a customer would meet it: start a conversation that should trigger it and go through to the end.
Try the wrong answers too — a policy number in the wrong format, an option that is not on the list, a flat "no". A flow that only works when the customer cooperates is not finished.
The header shows Ready once the flow has no outstanding problems, which is a useful check before you leave the editor.
Habits worth having#
- One flow, one task. Flows that try to handle three things are hard to follow and harder to change.
- Share endings rather than copying them. If three flows finish by booking a callback, make that a flow of its own and point the others at it.
- Say something before anything slow. A message before a tool call costs nothing and stops the conversation feeling stuck.
- Re-read it aloud. Branch names are written as outcomes for a reason — if reading the flow aloud does not make sense, neither will the conversation.