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 hastype: 'IMPROV'. The persona and environment are ids: list them with simulationPersona.list() and simulationEnvironment.list().
- Node
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:- 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).
- Edge cases: variations of the call that inherit the happy path and change only what differs.
- Grading: the agents this flow tests (at least one), the expectations every call is graded against, and the flow’s metrics.

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.
- 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.
- 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.
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}}.
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.
holdMode (DEFAULT, CUSTOM or NEVER), holdInstructions and holdMaxSeconds.

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.
- 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.
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:
- 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.
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