# Flows you write

> Describe the journey step by step and score every session against it.

A flow file lists the journey you want checked, step by step. It scripts nothing: each prospect still decides for itself, and afterwards every step is scored as reached or not.

## The file

Put it in `flows/<id>.yaml`, or `runs/<site>/flows/` for one site (that one wins on the same id). A step is a string, or a name plus `expect`: page text that proves the step.

```
name: Signup to first project
intent: sign up with email and reach the first empty project

steps:
  - found the signup form
  - name: submitted email and password
    expect: "Check your inbox"
  - received the verification email
  - name: saw the dashboard
    expect: "New project"

# end the session COMPLETED as soon as step 4's text is on screen
stop_after: 4
```

stop_after

The step it names must have `expect`. The moment that text shows, the session ends as completed and the step counts as reached, before any more steps are spent.

## Validate and run

Check the file first, then run it, with or without a goal.

```
leakdown --validate-flow flows/signup.yaml   # no browser; exits 1 on errors  ✓ flows/signup.yaml — "Signup to first project", 4 step(s), stops after step 4

```

## Let Leakdown draft one

No file yet? Describe the journey and Leakdown drafts the checkpoints for you to review, then shapes the prospects around it.

```
leakdown your-site.com --flow "signup through to the dashboard"   # writes runs//FLOW.md
```

---
Source: https://docs.leakdown.dev/flows
