Test and fix a flow
Tests a graph with simulated calls, reviews what happened, fixes what the review found and tests the fix. Nothing is saved. It answers 202 straight away with a job that usually finishes in 2–6 minutes: poll Get a flow test.
What to test with: simulate invented callers written from your brief (2 by default), examples (your real calls, each caller replayed against the graph), calls (transcripts of test calls you made), or a mix. rounds is the most revisions to make (1–3), and verify tests each revision again. variables are test values for the call variables. agent_id links the job to an agent so you can find it later.
Simulated calls are text only: no phone rings and no tool runs. This charges your wallet once, when the job ends, for every model call it made. 10 per workspace per hour.
Authorizations
Body
The graph to test and what to test it with: calls (test calls you made), simulate (simulated calls), or both. At least one test: with neither, 400 invalid_request.
Optional: 1-5 transcripts of test calls you made with this flow, one AGENT:/CALLER: turn per line (POST /v2/agents/flow/transcribe turns a recording into one). The review reads them as real calls (speech recognition errors are not held against the flow); a revision is verified by replaying each call's caller against it.
1 - 5 elementsOptional: transcripts of the business's real calls (2-10, together at most 200,000 characters), as given to generate. Their callers are replayed against the flow (simulate), and the review checks each replay against its original: coverage, order and what the original agent did well.
2 - 10 elementsOptional language code or name for the spoken lines (for example hi, gu, en or Hinglish). Without it the language is read from the brief, the example calls and the flow under test and your test calls (the Indian script they are written in, a language they name, or a language they are typed in with English letters), plain English text with no Indian words reads as English, and with nothing to go on no language is set and the brief decides, as before. Every Indian language is written in its own script (Gujarati in Gujarati script, Hindi and Marathi in Devanagari, and so on), English words in Latin letters, never romanized: text-to-speech reads Latin letters with English sounds.
32The model that reviews the test calls and revises the graph: gemini-3.8-flash (Gemini 3.8 Flash), claude-opus-5.5 (Claude Opus 5.5) or gpt-6-sol (GPT-6 Sol). Omitted: gemini-3.8-flash. Simulated calls do not run on it: both sides run on the model your tier's live calls run on (falling back to gemini-3.8-flash when that is unavailable).
gemini-3.8-flash, claude-opus-5.5, gpt-6-sol Simulated calls in the first round. With examples they are REPLAYS of the examples (the original callers played again against this flow): by default every example up to 5, the most different first, and never more than there are examples. Without examples they are invented callers: 2 by default. With calls the default is 0 (the calls are the test). Every later round runs the same callers again, so before and after are comparable.
0 <= x <= 5Response
Started
What the job costs: every simulated turn on the live-call model at the text channel's LLM rates (₹15 / ₹55 per million input / output tokens, the LLM API's rates), every hosted call (the callers, a fallback, the reviews and revisions) at the provider's reported cost × ₹88 × 1.2 (its per-token rates when none is reported), rounded up once to a paisa. So far while running; once finished (succeeded, failed or canceled), the amount charged to the wallet in one flow_generation transaction described "Flow test · · … tokens".
The example calls the job was given, as it used them, in order: a replay's tests[].source.index (kind example) points into this list, so a client can show each replay beside its original, and resending them with the current flow tests the same calls again. Kept with the job (24 hours), readable only by its workspace; never logged.
10The model simulated calls run on: the LLM your tier's live calls run on, as that stack names it (for example voice-agent), or gemini-3.8-flash when that model was unavailable, switched off or failed during the job (the job then falls back for good; each test names its model).
The language the flow's lines are written in, as a code (hi, gu, en, ta, …): while running, the one the job tests and revises in (the request's, else read from the brief, the calls and the flow; absent when they say nothing); once succeeded, the one the final flow's greetings and quoted lines are in. Absent on jobs started before it existed.