Graine AI

Flow agents

A voice agent made of steps and the paths between them. What a flow agent is, when it beats a single prompt, and how its parts fit together.

Most agents run on one long prompt. A flow agent splits the call into steps instead, each with one part of the conversation to handle: confirm who picked up, explain why you are calling, agree what happens next, say goodbye. Paths join the steps and decide where the call goes after each turn. You draw the flow on a canvas in the dashboard or send it as JSON through the API; either way it is an ordinary agent that places and answers calls, runs in campaigns and sends your webhooks.

Flow or prompt?

The two kinds of agent share everything outside the conversation: voices, languages, phone numbers, campaigns, webhooks, and the widgets for your website and app. What differs is how you describe the conversation.

Prompt agentFlow agent
What you writeOne prompt that covers the whole call.A briefing every step shares, and steps that each carry their own instructions or exact wording.
What the model reads each turnAll of the prompt.The briefing and the step the call is on, so a long script stays focused.
Wording that must not changeThe model phrases every reply itself.A fixed line is said exactly as written, from audio prepared when you save.
Decisions on data you already holdYou ask the model, in the prompt, to look at it.A rule checks the value directly. No model is asked, so it adds no wait.
Settings for one part of the callOne model, knowledge base and interruption setting for everything.A step can have its own reply model, decision model, knowledge base, tool and interruption setting.
Getting startedWrite the prompt.Start from a template, or lay the steps out on the canvas.

A prompt agent suits open conversations where order doesn't matter: questions about your product, FAQs, a friendly check-in.

A flow agent suits calls with a shape you need to keep:

  • one thing has to happen before another, such as confirming identity before an account is discussed;
  • some sentences have to be said word for word, such as a disclosure or a consent question;
  • the call should go one way or another depending on data you send with it, such as the amount owed, the plan the customer is on or the day of the week where they live;
  • a prompt has grown so long that the agent starts skipping parts of it;
  • you want to see, call by call, which step the conversation was on and why it moved on (see Test and fix a flow).

Starting from a prompt agent

In the agent editor, Convert to a flow agent reads the agent's prompt and drafts steps from it. You review and edit the draft, and a new flow agent is created with the same voice, model and call settings. The agent you started from is left as it was.

How a flow is put together

Steps are the places a call can be. There are three kinds.

KindWhat happens there
AI replyThe AI holds the conversation, following the step's instructions on top of the briefing. It can answer from a knowledge base and use tools, including ending or transferring the call.
Fixed lineThe same words every time, in the caller's language. With no paths out, it can hang up once the words have played.
BranchSays nothing. It picks one of its paths at once, so the caller only ever hears the step it sends them to.

Paths lead from one step to another. Each one has a condition saying when the call should take it.

ConditionThe call takes the path when…
AI decidesthe decision model, reading your description ("The caller agrees to a time") and the conversation, picks it.
Rulethe call's data matches, for example recipient_data.plan is premium.
Alwaysnothing else matched. It is the step's fallback.
Eventyour own server sends that event into the live call, for example demo_booked.

A few settings hold the flow together:

  • Briefing: what every step knows, such as who the agent is, who it is calling and why. Each step's instructions are added after it.
  • First step: where every call starts.
  • Welcome message: said when the call connects, before any step runs.
  • Decision model: the model that chooses between paths the AI decides. It is chosen separately from the model that writes replies.
  • Variables: details such as {customer_name} that each call fills in from its own data, with defaults for when a call doesn't send them.

A flow at a glance

This is the Payment reminder template, one of the flows you can start from:

Welcome message: "Hello, this is a call from {business_name}."

[Check who it is]                AI reply, the first step
 ├─ AI decides: "The caller confirms they are the account holder."
 │    └─► [Check the amount due]  Branch
 │          ├─ Rule: recipient_data.amount_due is above 0
 │          │    └─► [Agree a payment date]  AI reply
 │          │          └─ AI decides: "The caller has given a date…"
 │          │                (collects promise_date) ─► [Goodbye]
 │          └─ Always ─► [Goodbye]
 └─ AI decides: "It's the wrong person…" ─► [Goodbye]

[Goodbye]                        AI reply that ends the call

The branch never speaks. Once the caller confirms who they are, the call passes straight through Check the amount due, and the next thing they hear comes from Agree a payment date, or from Goodbye when nothing is owed.

Where to go next

On this page