# Flows and replays

> Save a clean take as a flow and re-shoot it for a new build, language or device with no agent.

Source: https://showtake.app/docs/flows

A **flow** is the list of steps of a take, saved as YAML. Replaying it re-shoots the same demo without an agent and without tokens: for the next build, another language or another device.

## Save a flow

After a clean take the agent calls `save_flow` with the take's id and a short name. The file lands in `~/Movies/ShowTake/<project>/flows/<name>.yaml`:

```yaml
version: 1
name: add-and-check-todos
source_take: take-20261111-093410
target: { kind: ios, project: Todos.xcodeproj, scheme: Todos, device: "iPhone 17 Pro" }
environment: { status_bar: "9:41", appearance: light, locale: en_US, launch_args: ["-demoMode", "YES"] }
steps:
  - { action: wait_for, id: todos.list, timeout_ms: 8000 }
  - { action: tap, id: todos.add, caption: "Add a new todo" }
  - { action: type_text, target: { value: "Untitled Todo" }, text: "Pack the camera", caption: "Name it" }
  - { action: tap, label: "Pack the camera", role: Cell, caption: "Check it off" }
```

Steps record the most durable selector the element had: accessibility id first, then label and role, then value. You can edit captions or waits by hand.

## Replay

Ask the agent ("replay add-and-check-todos") or call the tool yourself:

```json
{ "name": "add-and-check-todos", "locales": ["en_US", "de_DE", "ja_JP"] }
```

`replay_flow` prepares the target, launches the app fresh, runs every step with deterministic waits and records a new take. Its answer says how each step matched the original take, so a changed screen is caught before you publish the video.

- **Several locales or devices** in one call need Pro; the free version replays one at a time.
- `retake` re-shoots an existing take with the same target and environment.

## When a replay fails

A step fails when its element is gone (`element_not_found`) or a wait runs out (`timeout`). Usually the UI changed: ask the agent to film the flow again and save it under the same name.
