# Flow Layout

> Sequential left-to-right pipeline with optional step numbering, highlights, and animated return arrows.

Use `flow` for an ordered sequence of stages (2–6 steps) with an optional rollback or feedback loop underneath.

## Live Interactive Example

Click any stage to inspect its CLI command, or press **Play** to step through:

```diagram
type: flow
label: "OpenShip turns a feature branch into a reviewed, CI-green draft PR."
eyebrow: OpenShip · Powered by PraisonAI
numbered: true
steps:
  - title: praisonai ship
    note: "Secret guard, AI PR text, draft PR"
    description: "Scans staged changes for secrets, drafts a PR summary, and opens a draft PR."
    code: "praisonai ship --draft"
  - title: Self-Review
    note: "Lockfile-filtered diff, typed findings"
    description: "Filters lockfiles and runs structured reviewer agents emitting typed findings."
    code: "praisonai ship review"
  - title: PR Steward
    note: "Fix CI, conflicts & threads (3-try cap)"
    description: "Watches failing checks and applies bounded automated fixes up to 3 tries."
    code: "praisonai ship steward --max-tries 3"
    highlight: true
  - title: Approvals & Merge
    note: ".praisonai/approvals.yml; human merges"
    description: "Automation stops before merge — a human always approves and merges."
    fallback: true
back: { from: 4, to: 3, label: "changes requested" }
```

## Step-by-Step Guide

1. **Declare `type: flow` and a 1-sentence `label`** (used for screen readers and the toolbar).
2. **Add `steps`** — each item can be a plain string or `{ title, note, description, code, href, highlight, fallback }`.
3. **Turn on `numbered: true`** to prefix cards with `01`, `02`, `03` automatically.
4. **Add an optional `back` return arc** (`{ from: 4, to: 3, label: "changes requested" }`) using 1-based step indices.

## YAML Source

```yaml
type: flow
label: "OpenShip turns a feature branch into a reviewed, CI-green draft PR."
eyebrow: OpenShip · Powered by PraisonAI
numbered: true
steps:
  - title: praisonai ship
    note: "Secret guard, AI PR text, draft PR"
    code: "praisonai ship --draft"
  - title: Self-Review
    note: "Lockfile-filtered diff, typed findings"
  - title: PR Steward
    note: "Fix CI, conflicts & threads (3-try cap)"
    highlight: true
  - title: Approvals & Merge
    note: ".praisonai/approvals.yml; human merges"
    fallback: true
back: { from: 4, to: 3, label: "changes requested" }
```

## Field Reference

| Field | Required | Description |
|---|---|---|
| `type` | Yes | Must be `flow` |
| `label` | Yes | Accessible 1-sentence summary |
| `steps` | Yes | List of 2–6 steps (string or item object) |
| `eyebrow` | No | Uppercase header over the pipeline |
| `numbered` | No | `true` prefixes steps with `01`, `02`, ... |
| `back` | No | Return arc `{ from, to, label }` (1-based indices) |
| `width` | No | Canvas width (`480`–`1600`, default `880`) |

## Related pages

- [Stack Layout](https://diagram.praison.ai/docs/layouts/stack.md)
- [Sequence Layout](https://diagram.praison.ai/docs/layouts/sequence.md)
- [Loop Layout](https://diagram.praison.ai/docs/layouts/loop.md)
