# Loop Layout

> Continuous circular workflow with an orbiting dot and numbered stages around a central invariant.

Use `loop` to show a repeating cycle — such as an autonomous agent turn, feedback loop, or continuous improvement process.

## Live Interactive Example

```diagram
type: loop
label: "Every turn runs Plan, Act, Observe, and Reflect in a continuous cycle."
center_eyebrow: Every turn
center: [Plan, then, verify]
nodes:
  - title: Plan
    note: "Decompose goal"
    description: "Selects the next minimal action from current memory and constraints."
  - title: Act
    note: "Invoke tools"
    description: "Executes shell, file, or MCP tool calls inside the sandbox."
    highlight: true
  - title: Observe
    note: "Inspect output"
    description: "Reads stdout, exit codes, and test results."
  - title: Reflect
    note: "Update memory"
    description: "Records facts learned or triggers rollback on regression."
    fallback: true
```

## Step-by-Step Guide

1. **Set `type: loop`** and a concise `label`.
2. **Set `center`** (1–3 short lines) and optional `center_eyebrow` for the invariant inside the ring.
3. **List 2–8 `nodes`** in clockwise order starting at 12 o'clock.
4. **Mark key stages** with `highlight: true` (accent ring) or `fallback: true` (dashed recovery ring).

## YAML Source

```yaml
type: loop
label: "Every turn runs Plan, Act, Observe, and Reflect in a continuous cycle."
center_eyebrow: Every turn
center: [Plan, then, verify]
nodes:
  - { title: Plan, note: "Decompose goal" }
  - { title: Act, note: "Invoke tools", highlight: true }
  - { title: Observe, note: "Inspect output" }
  - { title: Reflect, note: "Update memory", fallback: true }
```

## Field Reference

| Field | Required | Description |
|---|---|---|
| `type` | Yes | Must be `loop` |
| `label` | Yes | Accessible 1-sentence summary |
| `nodes` | Yes | 2–8 stages arranged clockwise from top |
| `center` | No | 1–3 short lines shown inside the orbit |
| `center_eyebrow` | No | Small uppercase eyebrow above `center` |
| `radius` | No | Optional orbit radius in px |

## Related pages

- [Flow Layout](https://diagram.praison.ai/docs/layouts/flow.md)
- [Stack Layout](https://diagram.praison.ai/docs/layouts/stack.md)
- [Map Layout](https://diagram.praison.ai/docs/layouts/map.md)
