Skip to main content
Some things your agent handles take more than one conversation. A customer books an appointment, calls back to move it, then calls again to cancel. To test that, the second call has to start after the first one has ended, and come from the same customer. The flows on a run plan can’t promise that. Each flow is its own test case and they run in no particular order, so with iterations and concurrency the “move my appointment” call can start before that customer’s booking exists. A flow sequence runs its flows in order, for one simulated customer at a time.

When to use one

Use a flow sequence when a later conversation depends on what an earlier one left behind in your systems: a booking, a ticket, an order, a change to an account.
  • Book, move, cancel an appointment
  • Open a support ticket, then follow up on it
  • Place an order, then ask where it is, then return it
When the conversations stand on their own, attach the flows as usual. A plan can hold both: plain flows and flow sequences run side by side in the same run.

Building a sequence in the app

Sequences live in the Flows section of the create-run page and the plan editor, next to the flows you attach. A sequence shows as a card tagged SEQUENCE, with its flows in order and a one-line summary of its customers, wait and what happens if a flow doesn’t complete.
The Flows section of a run plan, 2 attached: an Opening hours flow card with its happy path, and a collapsed Book, reschedule, cancel card tagged SEQUENCE with 3 flows in order and the summary line Book an appointment, Reschedule the appointment, Cancel the appointment, 3 customers, 30 s between flows, stops if a flow does not complete. Below them are the Add or remove flows and Add a sequence of flows buttons.
1

Pick the flows, in order

Click + Add a sequence of flows. The picker opens as New sequence of flows: tick the flows in the order one customer goes through them, and the tick boxes number them as you go. A tick runs the flow’s happy path; open a row to pick one of its edge cases instead. Click Add sequence once you have at least two.
The New sequence of flows picker with the hint Pick flows in the order one customer goes through them. Book an appointment, Reschedule the appointment and Cancel the appointment are ticked and numbered 1, 2 and 3, each running its happy path; Opening hours is unticked. The footer reads 3 flows in order. Customers and the wait are set on the sequence, with an Add sequence button.
2

Name it and add the customers

The new sequence opens expanded. Give it a name, then add the customers who go through it. Each customer is a Persona and their own values for the flows’ {{variables}}, such as an account number. Calls from shows the number the customer calls from: the persona’s own number, or Pool number, kept for the sequence.
3

Set the wait and what happens when a flow doesn't complete

Wait between flows is the pause, in seconds, between one call ending and the next one starting: time for your systems to save what the last call changed. The rail shows it between the flows (“then, 30 s after this call ends”). If a flow does not complete chooses Stop this sequence (the default) or Carry on. You can reorder the flows with the arrows or by dragging, and swap a flow’s variant from its menu.
An expanded Book, reschedule, cancel sequence: three flows on a numbered rail, each on its happy path, with then, 30 s after this call ends between them. The Customers table lists Sarah Bennett, Jordan Ellis and Arjun Mehta, each calling from a pool number kept for the sequence, with their own preferredDay and accountNumber values. Below are Wait between flows set to 30 seconds, If a flow does not complete set to Stop this sequence, and the line 3 customers × 1 run × 3 flows = 9 calls. Up to 2 sequences at a time.
On the Flow adherence and Conversation quality templates, the flows sit in the template’s own panel (Expected flows on Flow adherence). A sequence there is a ticked row tagged SEQUENCE at the top of the list that opens to the same settings. Untick it to leave it out of this run without losing its setup.
The Expected flows panel of the Flow adherence template: a ticked Book, reschedule, cancel row tagged SEQUENCE, reading 3 flows in order, 3 customers, 30 s between flows, sits above four unticked flows. At the bottom are the Add a sequence of flows and Define a new flow buttons.
The run settings count the calls a plan places, sequences included, for example “40 calls planned: 36 in sequences, 4 from 1 single flow”. The plan won’t save until every sequence has a name, at least two flows and a persona for each customer.
Sequences are available on the Blank, Flow adherence and Conversation quality templates. They can’t be combined with a property sweep.

How a sequence runs

Each customer going through the sequence once is one sequence run. Within a sequence run:
  • Flows run in order. Each flow is its own call, and it starts only after the one before it has ended and the wait has passed. Nothing overtakes it: not another flow, not a retry, not a later iteration of the same customer.
  • One caller number. Every call in a sequence run comes from the same number, so your agent sees the same customer calling back. A persona with its own number always uses it. Otherwise the first call takes a number from Roark’s pool and the sequence run keeps it; if that number is busy, the next call waits for it rather than switching. A later iteration may call from a different number.
  • One persona and one set of values. The customer’s persona plays every flow, with that customer’s values.
  • A failed check never stops a sequence. Checks grade a call after it ends, and a booking can succeed on a call that fails a tone check, so the sequence carries on.
  • A flow that doesn’t complete stops the sequence by default. “Doesn’t complete” means the call didn’t properly happen: no answer, busy, declined, your agent never spoke, the call hit its maximum duration, or it was invalidated, timed out or cancelled. Under Stop this sequence the remaining flows are skipped for that customer and never dial; other customers carry on. Under Carry on they still run, which suits flows that don’t depend on each other.
Concurrency counts sequence runs, not calls. At a concurrency of 2, at most two customers are part-way through a sequence at once, whatever flow each is on. Different customers run in parallel, and one customer’s sequence runs never overlap. Iterations repeat each customer’s whole sequence. A customer’s iterations don’t have to finish in order (iteration 4 can end before iteration 2 starts), but each one runs its flows in order. A sequence adds customers × flows × iterations test cases for each agent you test. Flows skipped after a stop place no call, so a run can place fewer calls than it has test cases. If the plan retries calls where your agent never spoke, a retried flow places one more call before the sequence moves on.

Rules and limits

  • Variables layer. A customer’s value wins over a value set on the flow in the sequence, both win over the plan’s, and values given when the run starts win over all of them.
  • A flow can appear more than once in the same sequence, for example to check the booking at the start and again at the end.
  • A sequence can set its own iteration count over the API or in config as code. Otherwise it follows the plan’s.

Reading the results

While the run is going

Live now nests a sequence under one header with its name, the customer and the iteration, and lists its flows on a numbered rail. The flow on a call shows that call’s live line. Flows that ran show their result and call time, a flow that just ended shows Collecting metrics, and later ones read Waiting or Next. A flow waiting out the time between flows counts down (“Starts in 0:18”).
Live now during a run with two Book, reschedule, cancel sequences. Sarah Bennett, iteration 2 of 4: Book an appointment completed in 2m 04s, Reschedule the appointment in call at 01:46, Cancel the appointment waiting. Arjun Mehta, iteration 2 of 4: Book an appointment completed, Reschedule the appointment collecting metrics, Cancel the appointment next.

The calls list

In All calls, each sequence run is one row: the sequence name, the customer, the iteration, a trail with a dot per flow, and one result: Passed, Failed checks, Completed, or Stopped at step N with the reason underneath. Open the row to see its calls in order. The flow that didn’t complete is marked with a red X, and a skipped flow stays in its place, dimmed, and opens nothing. Filter by sequence, or by Single flows for the plain ones.
All calls with the summary 3 sequence runs: 1 completed, 2 stopped. 3 steps were skipped and not billed. Filters include one for the Book, reschedule, cancel sequence and one for Single flows. Arjun Mehta's sequence run is open and Stopped at step 2: Book an appointment completed, Reschedule the appointment timed out at its maximum duration and is marked with a red X, and Cancel the appointment is dimmed as Skipped. Below are a plain Opening hours call, Sarah Bennett's run Stopped at step 1, and Jordan Ellis's run Completed, open to its three completed calls.
A line under All calls sums it up, for example “3 sequence runs: 1 completed, 2 stopped. 3 steps were skipped and not billed.”
A stopped sequence shows in the run even without checks. With checks on the plan, a stopped sequence fails the run’s coverage, because the skipped flows still count as expected calls. A run whose every sequence stopped, and which has no plain flows, ends as Failed.

Config as code

Declare sequences on a kind: simulationPlan under flowSequences. Flows and personas are named the way the rest of your config names them, and a step runs the flow’s happy path unless edgeCase names one of its edge cases.
That plan has 12 test cases: 2 customers × 3 flows × 2 iterations. Sarah’s and Jordan’s sequences run side by side. Each reschedule call starts 30 seconds after that customer’s booking call ends, from the same number. If Jordan’s reschedule call isn’t answered, that customer’s cancel call is skipped, and their second iteration still runs. To run a flow’s edge case instead of its happy path, add edgeCase with the edge case’s name.

API

POST /v1/simulation/plan takes flowSequences, as does the inline plan of POST /v1/simulation/run. A plan needs flows, flowSequences, or both. Each step names its flow by id (or a Roark flow by slug), with an optional edgeCase by id or slug.
Read testCaseCount on the created plan before you start it. Updating. GET /v1/simulation/plan/{planId} always returns flowSequences ([] when there are none). PUT /v1/simulation/plan/{planId} replaces the whole list: leave flowSequences out to keep the sequences, send [] to remove them all, and send each sequence you keep back with the id the read gave it. A sequence sent without an id is created as a new one. Results. GET /v1/simulation/plan/job/{jobId} and GET /v1/simulation/plan/job/{jobId}/results return flowSequenceRuns (one entry per sequence run, with its status, stoppedAtStep, stopReason and each step’s simulationJobId and outcome) and flowSequenceSummary:
A step’s outcome is WAITING, IN_PROGRESS, COMPLETED (the call happened, whatever its checks scored), DID_NOT_COMPLETE or SKIPPED. A skipped step is a simulation job with status CANCELLED and flowSequence.skipped: true, and it placed no call, so don’t count it as a call that failed or that someone cancelled. Every job’s flowSequence gives its flowSequenceRunId and step, or null outside a sequence. Errors to handle:

Next steps

Run Plans

Everything else a plan holds, and how to run it

Customer Flows

Author the flows a sequence runs

Variables

Give each customer their own values

Running Simulations

Watch runs live and read the report when they settle