> ## Documentation Index
> Fetch the complete documentation index at: https://www.voiceflow.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Scripted turns

> A scripted conversation is an ordered sequence of User turn and Agent turn elements. You write the user’s message; the agent generates its response when the test runs.

## Overview

<a id="how-it-works" />

<a id="when-to-use-it" />

A scripted conversation is an ordered sequence of **User turn** and **Agent turn** elements. You write the user’s message; the agent generates its response when the test runs.

<a id="use"></a>

## When to use it

Check behavior at a specific point in a known message sequence.

Use scripted turns for a known regression, a required phrase, or a sequence whose routing or tool use must be checked at a specific point.

<a id="model"></a>

## How it works

Pair exact user messages with checks on generated agent turns.

| Element | Authored content | Runtime behavior |
| --- | --- | --- |
| User turn | The exact message the user sends. | Sends that message to the agent. |
| Agent turn | Checks for the agent’s response, route, or tool use. | Waits for the agent’s generated behavior and evaluates its checks. |
| Simulation | A scenario, success criteria, and turn cap. | Lets AI play the user for that segment. |

The editor preserves the sequence you arrange. Checks belong to an agent turn, not to the preceding user message. Scripted and simulated segments can appear in the same saved test.

Use the editor’s bottom controls to add a **User turn**, **Agent turn**, or **Simulation** to the conversation.

<a id="example"></a>

## Example

Check returns routing and tool use at the relevant turns.

A scripted return conversation can send “I want to return my order,” then check the next agent turn for the returns route. A second user turn can supply the order number and a later agent turn can check the lookup tool. Each check is placed where its expected behavior belongs.

### Next steps

- [Response checks](/docs/platform/rehearsal/tests/response-checks)
- [Routing checks](/docs/platform/rehearsal/tests/routing-checks)
- [Tool-call checks](/docs/platform/rehearsal/tests/tool-call-checks)
- [Simulated conversation segments](/docs/platform/rehearsal/simulations/editor)
