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

# workflows snapshots restore

> Roll a workflow back to a previous snapshot, replacing its current graph.

Restore a workflow to a previous snapshot, overwriting its current graph with the snapshot's. This is the undo action — pair it with [`clay workflows snapshots list`](/cli/reference/workflows-snapshots-list) to find the snapshot from just before an unwanted edit, and with [`clay workflows snapshots get`](/cli/reference/workflows-snapshots-get) to inspect a snapshot before restoring it.

Restore is destructive and does not itself take a snapshot of the current graph. The pre-restore state is recoverable only if it was already captured — snapshots are taken automatically before each edit and at run start. Check `snapshots list` first if you might need the current graph back.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
clay workflows snapshots restore <workflowId> <snapshotId>
```

## Arguments

| Argument     | Description                                                 |
| ------------ | ----------------------------------------------------------- |
| `workflowId` | Workflow id, e.g. `wf_abc123`. Required.                    |
| `snapshotId` | Snapshot id to restore to, from `snapshots list`. Required. |

## Output

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{ "ok": true }
```

| Field | Type   | Description                         |
| ----- | ------ | ----------------------------------- |
| `ok`  | `true` | Confirms the workflow was restored. |

## Errors

| Code               | Exit | Notes                                                 |
| ------------------ | ---- | ----------------------------------------------------- |
| `validation_error` | 2    | `workflowId` and `snapshotId` arguments are required. |
| `not_found`        | 6    | No workflow or snapshot with that id.                 |
| `auth_forbidden`   | 3    | The API key lacks permission for this command.        |

## Examples

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
clay workflows snapshots restore wf_abc123 snap_xyz
clay workflows snapshots list wf_abc123 | jq -r '.data[0].id' | xargs clay workflows snapshots restore wf_abc123
```
