Skip to main content

Quickstart

An improv flow is a customer flow you describe instead of script: a brief the simulated customer improvises a fresh call from on every run, graded against your expectations. Define an improv flow in code (recommended), or build it in the dashboard. The happy path needs a persona and an environment; prompt is the brief and openingLine is Customer speaks first.

Create it with the SDK

In the REST API and the SDKs an improv flow has type: 'IMPROV'. The persona and environment are ids: list them with simulationPersona.list() and simulationEnvironment.list().

Overview

An improv flow is a customer flow you describe instead of script. You write a short brief: the situation the caller is in, what they want, what they know and how they react. On every run the simulated customer plays a real person making that call, in its own words, and reacts to whatever your agent says. Choose improv when you care about the outcome more than the exact words: realistic, open-ended conversations, broad behavioral coverage, and agents whose replies you can’t predict. When the call has to go a precise way (an IVR menu, keypad entry, a line your agent must say word for word), use a Scripted flow instead.

The editor

The improv editor has three numbered sections:
  1. Happy path: the brief for the default version of the call, with its Persona, Environment and Hold chips, an optional Customer speaks first line, and Link preceding flow to open the call with a scripted flow (see Composing flows).
  2. Edge cases: variations of the call that inherit the happy path and change only what differs.
  3. Grading: the agents this flow tests (at least one), the expectations every call is graded against, and the flow’s metrics.
The top of the improv editor for a Book an appointment flow (3 variants, 2 expectations). Under 01 Happy path, the brief reads: You are {{customerName}}, calling Bright Smile Dental to book a teeth cleaning on {{appointmentDate}}. Ask for a morning slot. Accept the first time the agent offers, confirm the time back, thank them and say goodbye. The variables show as green chips, Link preceding flow sits above the brief, and Add variable, Hand over and Caller cue sit in its footer with a 35 words count. Below: Customer speaks first set to Hi, I need to book a cleaning., and the chips Persona Jordan Ellis, Environment Quiet room and Hold Custom.
The brief’s footer inserts the three things a brief can carry besides plain text: Add variable, Hand over and Caller cue.

Writing a good brief

The brief becomes the caller’s goal for the call: “this is what you are calling about and how you should behave”. The caller is told it is a real person on a real phone call with no script, so it pursues that goal in its own natural words. Two rules follow from how it is used:
  • The caller never invents facts. When your agent asks for something the brief, the persona or a variable doesn’t give (an account number, a date, an address), the caller says it doesn’t have it or doesn’t remember and asks a short question. It never makes one up. So every fact your agent will ask for belongs in the brief.
  • Who the caller is comes from the persona. Language, accent, voice, pace, baseline mood and background noise are read from the persona and the environment, never from the brief. Writing “is angry”, “speaks Spanish” or “is calling from a noisy cafe” into a brief changes nothing. The brief is the situation on this call.
Put in:
  • The situation and the goal: what happened and what the caller wants out of this call.
  • The facts the caller knows: names, dates, reference numbers, amounts, usually as variables.
  • How they react: what they accept, what they push back on, what they do when refused.
  • When they’re done: the caller ends the call once its goal is achieved, so say what “achieved” means.
Leave out:
  • Persona traits (language, accent, mood): set them on the persona, or change them mid-call with a caller cue.
  • Your agent’s lines: the brief describes the caller, not the conversation. To hold your agent to exact lines, use a scripted flow.
  • Anything about testing or simulation: the caller plays a real customer.
The weak brief leaves the caller without a name, a date of birth or an existing appointment to move, so it can only say it doesn’t know when your agent asks. The strong one gives every fact up front, says what to accept and refuse, and says when the call is done.

Variables in the brief

Write {{name}} for a flow variable and {{persona.name}} for a persona property. Click Add variable in the brief’s footer to insert one with autocomplete. Before the call starts, each token is replaced with its value, so the caller hears BSD-10482, not {{accountNumber}}.
The brief only names the variable. Its value comes from the run plan that attaches the flow (or from a flow sequence’s customer), and any left blank are asked for when the run starts. See Variables. The Customer speaks first line is plain text and can’t hold variables.

Who speaks first

By default the caller waits for your agent to answer and speak. Fill Customer speaks first with a line, for example “Hi, this is Maria.”, and the caller says it word for word as soon as the call connects. An edge case uses the happy path’s line unless it sets its own. When the variant has a Link preceding flow, the scripted flow opens the call and this line isn’t used.

Waiting on hold

The Hold chip says what the caller does when your agent asks it to wait, for example while it looks something up:
  • Default: Roark’s hold rules. The caller waits when the agent asks for a moment, and never in place of answering a question.
  • Custom: your own hold rules. Write Hold instructions that say when to wait, in your own words. Picking Custom fills them in with Roark’s rules as a starting point.
  • Never: the caller answers as soon as the agent stops talking, even while the agent is still working.
With Default or Custom, the caller waits until the agent speaks again, for at most the Longest wait in seconds, then takes the turn back. An edge case shows Same as happy path and follows the happy path’s hold unless it picks its own. In config as code these are holdMode (DEFAULT, CUSTOM or NEVER), holdInstructions and holdMaxSeconds.
The Hold chip open on a happy path, reading Hold Custom beside the Persona Jordan Ellis and Environment Quiet room chips. The Waiting on hold panel has Default, Custom and Never with Custom selected, Hold instructions reading Wait while the agent checks the calendar, then ask if a slot was found., and Longest wait set to 60 seconds, with the hint Then the caller takes the turn back.

Edge cases

An edge case starts from the happy path. With no brief of its own it runs with the happy path’s brief (click Edit brief to start from a copy), and it keeps the happy path’s persona, environment, hold and opening line unless you change them. When an edge case has its own brief, the caller gets both: the edge case’s brief is its goal, and the happy path’s brief is background for anything the edge case doesn’t spell out. Any specific detail in the edge case’s brief (a reference number, a name, a date) replaces the happy path’s version of it.
The 02 Edge cases section with No slots that day open and Asks for a specific hygienist collapsed below it, above Add another edge case. No slots that day has its own brief: You are {{customerName}} and want a cleaning on {{appointmentDate}}. When the agent says that day is full, ask for the nearest day with a morning slot and book it. Its Customer speaks first field shows the line inherited from the happy path, its chips read Persona Sarah Bennett, Environment Quiet room and Hold Same as happy path, and under Additional expectations the Include 2 customer flow expectations switch is on, above Add expectation.
Change only what differs. For example:
  • An angry caller. Pick a persona with an angry base emotion for the edge case, or add a caller cue such as #{emotion:angry} at the point the caller loses patience. Writing “you’re furious” in the brief does nothing.
  • A wrong account number. Give the edge case a brief that names an account number your agent won’t find, and say what the caller does when told it doesn’t exist (read it again, then offer their postcode instead). That number replaces the happy path’s.
  • A switch of language. Pick a persona that speaks the other language, or add #{language:es} where the caller switches partway through the call.
Each edge case can also add its own expectations, which apply on top of the flow’s. Turn off Include customer flow expectations on an edge case to grade it on its own expectations only (includeFlowExpectations: false in config as code).

Hand-overs and caller cues

  • Hand over (or type @) hands the phone to another persona partway through the call, such as a caregiver who takes over from a patient. The sentences around the mention say when, and whether the phone comes back. See Multiple callers.
  • Caller cue (or type #) changes how the caller feels, what language it speaks or where it is from that point in the call, or makes it cut in while your agent is talking. See Caller cues.

How the caller improvises

Every run of the same variant is a new conversation: the same goal and facts, different words, reacting to what your agent actually says. That is what makes improv good at finding behavior you didn’t script, and it also means one call can pass where the next fails. To tell a real problem from one unlucky conversation, run each variant more than once with the plan’s Iterations (see Iterations and concurrency) and look at how often a check fails, not whether one call failed. The caller ends the call on its own once its goal is achieved, saying goodbye at most once. It also hangs up if your agent stays silent for 10 seconds, and after politely trying once to break a loop where your agent keeps asking the same question. The run plan’s end-call phrases and end-call reasons end the call too, and the call never runs past the plan’s maximum duration.
Improv flows run as voice calls. They don’t run as chat simulations.

How improv calls are graded

Improv calls are graded on outcomes, not on exact wording. The editor’s Grading section holds the agents the flow tests, its expectations and its metrics:
The 03 Grading section. Agents lists Bright Smile Dental with Add agent below. Expectations lists The agent confirms the date and time of the booking before ending the call. and The agent asks for the patient's name before booking., with Add expectation. Metrics lists Task Completion with a Set threshold control, and Edit metrics.
  • Agent expectations on the flow are checked against every call’s transcript, pass or fail per expectation. An edge case adds its own on top. Write them as specific, checkable statements: “Agent offers a callback when the customer declines to hold”, not “Agent is helpful”. See Agent expectations.
  • Metrics on the flow, and any the run plan adds on top, score every call the same way they score scripted calls. Set a threshold on a metric to score it as a pass/fail check.
The Flow adherence template runs your flows and grades every call against them, and is the usual place to start.

In config as code and the SDK

The Quickstart above shows a complete improv flow in config as code and the SDK. See Flows in config as code for every field.

Next steps

Scripted flows

Author the conversation step by step when it has to go a precise way

Flow sequences

Run several flows in order for the same customer

Personas

Set who is calling: language, voice, pace and mood

Caller cues

Change the caller’s mood, language or surroundings mid-call