Graine AI

How a call moves through a flow

The order things happen in on a flow call, turn by turn. The welcome message, the first step, what happens each time the caller speaks, how a call ends, and what silence, interruptions and languages change.

A flow call is a series of turns. On each one the call may move to another step, and then the step it is on speaks. Knowing the order helps you predict a call before you place it. How a path is chosen is covered in Paths and decisions; this page is about when.

When the call connects

The welcome message plays as soon as the call connects, after the Pause before the welcome message if you set one. It is not a step, and no path is checked while it plays. Its variables come from the call's data, with your defaults filling the gaps: on a phone call it is prepared before the call connects, so give every variable in it a default. With Ignore the caller until the welcome message is said on, nothing the caller says over it cuts it short.

Then the call waits for the caller.

The first turn

Every call starts on the first step, and the first step runs when the caller first speaks. Its paths are checked on that turn as on any other, and then the step the call is on replies. In practice:

  • An AI reply first step whose paths don't match yet answers the caller's first words. This is the usual case.
  • If the caller's first words already satisfy one of its paths ("Yes, I can talk"), the call moves on straight away and the first step never speaks.
  • A first step with an Always path passes the call on as soon as the caller first speaks. Put the opening question in the welcome message instead.
  • A branch as the first step sorts the call on those first words and the data the call was sent, and the step it picks answers them.

Every turn after that

Each time the caller finishes speaking:

  1. A newly reached AI reply step is heard first. If the call has only just arrived at an AI reply step and its first reply hasn't been heard to the end, the call stays and that step answers. A caller who talks over a new step can't skip it.
  2. Otherwise the step's paths are checked: rules, then the decision model, then the fallback (see Which path the call takes). The call moves along one of them or stays.
  3. Branches decide at once. If the call moved to a branch, the branch picks its own path in the same turn, and so on through any chain of branches, until the call reaches a step that speaks. Nothing is said along the way.
  4. The step the call is now on speaks. An AI reply writes and speaks its reply; a fixed line plays its line.

So the caller always hears the step they have just been moved to, never the one they left. Event paths are the exception to all of this: only an event takes them, at any moment (see Events).

How a call ends

From a step. Two kinds of step end the call on purpose:

  • an AI reply whose Uses a tool is End the call: the AI gives its closing message without asking anything, and the call hangs up once the message has played (see End the call from a step);
  • a fixed line with Hang up after this line, which works only on a fixed line with no paths: the line plays, then the call hangs up (see Hang up after the line).

Either way the whole message plays before the call ends, and the agent's Goodbye message isn't said after it. With Let the caller talk over a closing step on, in Settings › On the call, a caller who speaks over the goodbye stops the hang-up: an AI reply answers them, a fixed line says its line again, and then the call ends. An answering machine always hears the whole goodbye. An event can lead to a closing step, which then speaks and hangs up in the same way.

A step with no paths that isn't a closing step does not end the call: the call stays there, and the step keeps answering.

From the agent's settings. In Settings › On the call, as for any agent: End the call after a long silence, Maximum call length, The agent hangs up when the conversation is over (which says the Goodbye message first), and Detect voicemail.

By handing over. A step that uses Transfer the call passes the caller to a person (see Hand the call to a person).

And, of course, the caller can hang up.

Silence

Repeat after silence, on an AI reply or a fixed line, runs the step again when both the caller and the agent have been quiet for that many seconds. A fixed line says its line again. An AI reply is told the caller has gone quiet, and speaks again in its own words.

Each repeat counts as a turn: the step's paths are checked on it, and _silence_repeats counts the repeats on the current step, starting again at 0 whenever the call moves. That gives a quiet caller a way out, for example a rule path where _silence_repeats is at least 2 that leads to a polite close.

Repeats and the silence hang-up

A repeat is the agent speaking, so it restarts the timer of End the call after a long silence. So that a caller who never answers is still hung up, a step repeats at most twice in a row while the caller stays silent, or as many times as a _silence_repeats rule on that step needs, if that is more. After that the timer runs out as usual and the call ends. The count starts again when the caller speaks or acts in your app, or when the call moves to another step. A repeat longer than the timer never happens, because the call ends first. With End the call after a long silence off, the step keeps repeating.

Interruptions

While a step is speaking, the caller cuts in once they have said more words than its words to interrupt: the step's Own words to interrupt if it has one, otherwise the agent's Words before the caller can interrupt (2 by default). A caller who says only a short stop word, such as "stop", "wait" or "hold on", or a Hindi equivalent, can cut in with fewer. At 0 the step can't be interrupted at all, not even by those. The setting changes as the call moves from step to step.

Languages

On an agent that speaks several languages, each AI reply is written in the language the call is in, each fixed line plays that language's line, and detected_language tells rules which language that is. When the call changes language, the voice changes with it.

Next: Test and fix a flow.

On this page