> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ellomas.com/llms.txt
> Use this file to discover all available pages before exploring further.

# replay validate

> Validate a workflow file without executing it.

# `replay validate`

Check that a workflow file is syntactically and structurally valid without running it.

## Usage

```bash theme={null}
replay validate <workflow.yaml>
```

## Example

```bash theme={null}
replay validate workflow.yaml
```

### Valid Output

```
✓ valid workflow: my-workflow (5 steps)
✓ no cycles detected

execution plan:
  1. [http] fetch-users
  2. [if] condition=[authenticated, ==, true]
       then:
         3. [call] → verify.yaml
       else:
         4. [print] reject
  5. [loop] foreach=users, user
      6. [print] process-user
```

### Cycle Detected

```
✗ cycle detected: main-workflow → main-workflow
```

### Invalid YAML

```
steps[0].type: must be one of: http, db, shell, print, loop, call, if
```

## What It Checks

* **Required fields** — `name`, step `type`, step `name` uniqueness
* **Step type-specific fields** — HTTP needs `request` block, shell needs `command`, etc.
* **Mutually exclusive fields** — e.g., `query` and `command` on DB steps, `request` and `db` on HTTP steps
* **Timeout formats** — Validates duration strings like `30s`, `5m`
* **Loop `foreach` format** — Must be `list, item`
* **If `condition` format** — Must be `[path, op, value]` (3 elements)
* **Assert/Extract** — Checks for empty keys and paths
* **Unknown fields** — Rejects YAML keys that do not match the schema

## Exit Codes

| Code | Meaning                 |
| ---- | ----------------------- |
| `0`  | Workflow is valid       |
| `1`  | Validation errors found |
