Flow.Documentation

Test cases for an agent

6 steps± 4 minVideoVerified 22 Oct 2026
  1. Step 1 · Open your development environment
  2. Step 2 · Try the agent and keep it as a test case
  3. Step 3 · Say what the answer must contain
  4. Step 4 · Add a second case
  5. Step 5 · Run all test cases
  6. Step 6 · Publish

An agent that answers well today must do so tomorrow too — also after a new instruction or another model. Test cases record what the agent must do: an input, and what the answer must contain or which outcome you expect. Once an agent has test cases, you can only publish it when they all pass.

Watch the whole guide as a video6 steps in one film
Step 1 / 6

Open your development environment

In the portal, under Environments, click Development, and there Open. Flow opens in a new tab and you are signed in straight away.

  1. Click Development
Open your development environment · Click Development
  1. Click Open ↗
Open your development environment · Click Open ↗
Step 2 / 6

Try the agent and keep it as a test case

Open the agent and try it under Try. If you are happy with the answer, click Keep as test case: the input and the outcome become the first test case.

  1. Click Agents
Try the agent and keep it as a test case · Click Agents
  1. Click the agent ‘Returns adviser’
Try the agent and keep it as a test case · Click the agent ‘Returns adviser’
  1. Click Try
Try the agent and keep it as a test case · Click Try
  1. In Input, type {"question": "Within how many days can I return a bike bell?"}
Try the agent and keep it as a test case · In Input, type {"question": "Within how many days can I return a bike bell?"}
  1. Click ▶ Try
Try the agent and keep it as a test case · Click ▶ Try
Try the agent and keep it as a test case · The agent's answer.
  1. Click + Keep as test case
Try the agent and keep it as a test case · Click + Keep as test case
Try the agent and keep it as a test case · The first case is under Test cases.
Step 3 / 6

Say what the answer must contain

An outcome alone says little. Under Answer contains, fill in what must be in the answer: here the period of 14 days. Give the case a name that says what it checks.

  1. In Name, type Return period for accessories
  2. In Answer contains, type 14
Say what the answer must contain · In Name, type Return period for accessories; In Answer contains, type 14
Step 4 / 6

Add a second case

+ Test case adds a case; under Input you put the question. Also record what the agent must not say or must refuse: that way you notice at once when a change breaks something.

  1. Click + Test case
Add a second case · Click + Test case
  1. In Name, type Exchanging a bike after a test ride
  2. In Input, type {"question": "May I exchange my bike after a test ride?"}
  3. In Answer contains, type do not exchange
Add a second case · In Name, type Exchanging a bike after a test ride; In Input, type {"question": "May I exchange my bike after a test ride?"}; In Answer contains, type do not exchange
Step 5 / 6

Run all test cases

Save the test cases and click Run all. Every case runs as a real test, within the agent's guard rails and budget. Green has passed; for red you see why.

  1. Click Save test cases
Run all test cases · Click Save test cases
  1. Click ▶ Run all
Run all test cases · Click ▶ Run all
Run all test cases · Both test cases passed.
Step 6 / 6

Publish

Now that all test cases pass, you can publish. If you change the instructions later, run all cases again: only when they pass again can the new version go live.

  1. Click Publish
Publish · Click Publish
Publish · Version 1 is available.

This guide was carried out step by step on 22 Oct 2026 by an automated test on Flow (version 3e563176).