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

# Testing Your Flow

> Check conversation behavior and save tests for future changes.

Use tests to check that your agent asks the right questions, collects the right information, and follows the right path.

## Review Flow Studio's checks

Flow Studio can check individual step objectives and branching conditions, simulate complete conversations, and rerun saved tests after edits. Read its summary to see which checks actually ran and what passed or failed.

| Check | What it tells you |
| - | - |
| **Validation** | Whether the flow's structure and connections are valid. |
| **Objective or condition check** | Whether a sample conversation completes a step or selects the expected path. |
| **Conversation test** | How the agent responds across multiple turns and whether the expected outcomes are met. |

> [!NOTE]
>
> Saved conversation tests simulate **SMS or email**. They do not simulate a live voice call. Review voice behavior and call configuration separately before deploying.

## Ask Flow Studio to test a scenario

> Test an interested lead who answers every question. Check that the flow collects their needs and timeline before offering a call with our team.

> Test someone who is unsure about their timeline. Make sure the agent does not get stuck repeating the question.

Flow Studio saves the conversation scenarios it tests so you can run them again from the profile's **Tests** tab.

## Create and rerun saved tests

**1. Open Tests**

In the profile editor, select **Tests**. Enter edit mode to create, edit, or run tests.

![Tests tab in the profile editor](https://mintcdn.com/apten/JI8eReJi3tOBYBIM/images/flow-studio/tests-tab.png?fit=max\&auto=format\&n=JI8eReJi3tOBYBIM\&q=85\&s=a8fcbb5ecc14651db8c78a06944f5f18)

**2. Choose a starting point**

Click **New test**, or **Create test** if the list is empty. Choose a starting template or start from scratch.

![Test templates for happy paths, uncertain users, off-topic users, human requests, skipped steps, and starting blank](https://mintcdn.com/apten/JI8eReJi3tOBYBIM/images/flow-studio/test-templates.png?fit=max\&auto=format\&n=JI8eReJi3tOBYBIM\&q=85\&s=bc2ff11363a6f1417c947b5e0c4b96d1)

**3. Describe the scenario**

Give the test a name, choose **SMS** or **Email**, and describe the simulated lead in **Persona**. Add an initial message and starting variables when relevant.

> You are a lead comparing options. You want more information before deciding and are unsure about your timeline.

> **Set starting conditions (optional)**
>
> Set **Initial user message** to choose how the conversation starts, or leave it blank to let the simulated lead begin. Use **Initial variables** for information the agent already knows, such as the lead's name. **Max turns** limits how many user turns the simulation can take.
>
> ![Test editor fields for the initial user message, initial variables, and maximum conversation turns](https://mintcdn.com/apten/JI8eReJi3tOBYBIM/images/flow-studio/test-starting-conditions.png?fit=max\&auto=format\&n=JI8eReJi3tOBYBIM\&q=85\&s=1af5f957044918fce513fa0c138ad6ad)

**4. Set the expected outcomes**

Add **Assertions** for what should happen: visiting a step, collecting a variable, keeping the conversation within a turn limit, or meeting a written requirement.

Use **AI judgment (natural language)** to describe a successful outcome in plain language. For example: **“The agent asks about the lead's needs before offering a call.”** Every assertion must pass for the test to pass.

![AI judgment assertion with fields for the success criterion, transcript scope, and optional notes](https://mintcdn.com/apten/JI8eReJi3tOBYBIM/images/flow-studio/test-assertions.png?fit=max\&auto=format\&n=JI8eReJi3tOBYBIM\&q=85\&s=9da652c9ffe99ed422027aec772fcf49)

Click **Create test** to save it.

**5. Run and inspect**

Run an individual test or click **Run all**. Open its results to review the assertions, simulated transcript, and flow activity.

![Run all and New test controls in the Tests tab](https://mintcdn.com/apten/JI8eReJi3tOBYBIM/images/flow-studio/saved-tests.png?fit=max\&auto=format\&n=JI8eReJi3tOBYBIM\&q=85\&s=443ab24137d4683abaa16b1a6f718765)

## Refine a failing flow

Send the failed scenario and the expected behavior back to Flow Studio, then rerun the same test after the change.

> The uncertain-timeline test is failing. Let the lead give an approximate timeline, keep the other questions, and rerun that test.

Rerun relevant saved tests after manual edits too. A previous passing result does not check changes made since that run.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.