> ## 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 get

> Fetch one snapshot's full workflow graph — nodes, edges, agent prompts, and code.

Fetch a single snapshot's full workflow graph, including nodes, edges, agent prompts, and code. Get a snapshot id from [`clay workflows snapshots list`](/cli/reference/workflows-snapshots-list). There is no built-in diff — compare two `snapshots get` outputs with `jq`. Once you find the graph you want, roll back with [`clay workflows snapshots restore`](/cli/reference/workflows-snapshots-restore).

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
clay workflows snapshots get <workflowId> <snapshotId> [--node-id <id>]
```

## Arguments

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

## Flags

| Flag             | Description                                                                                                                                 |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| `--node-id <id>` | Only include the node with this id in `nodes`; edges are left intact. A non-matching id yields `"nodes": []` with exit 0, and full `edges`. |

## Output

The `nodes` and `edges` arrays hold the captured graph and are stable for diffing. The shapes below show the documented fields; individual node objects carry additional optional fields (`nodeConfig`, `retryConfig`, `scriptVersionId`, `currentScriptVersion`, `claygentSnapshot`) that are present only when set. `claygentSnapshot` holds the agent prompt and model/tool settings on agent nodes.

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "id": "snap_xyz",
  "workflowId": "wf_abc123",
  "hash": "a1b2c3d4",
  "createdAt": "2026-06-01T12:00:00Z",
  "containsCycles": false,
  "nodes": [
    {
      "id": "node_1",
      "name": "Enrich company",
      "description": null,
      "nodeType": "agent",
      "isInitial": true,
      "isTerminal": false,
      "tools": [],
      "position": { "x": 0, "y": 0 }
    }
  ],
  "edges": [
    {
      "id": "edge_1",
      "sourceNodeId": "node_1",
      "targetNodeId": "node_2",
      "metadata": { "conditionalSourceHandle": "true" }
    }
  ]
}
```

| Field                  | Type           | Description                                                                                                                                     |
| ---------------------- | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`                   | string         | Snapshot id.                                                                                                                                    |
| `workflowId`           | string         | Workflow the snapshot belongs to.                                                                                                               |
| `hash`                 | string         | Content-addressed hash of the captured graph.                                                                                                   |
| `createdAt`            | string         | When the snapshot was taken.                                                                                                                    |
| `containsCycles`       | boolean        | Whether the captured graph contains cycles.                                                                                                     |
| `nodes[].id`           | string         | Node id.                                                                                                                                        |
| `nodes[].name`         | string         | Node name.                                                                                                                                      |
| `nodes[].description`  | string \| null | Node description, or `null`.                                                                                                                    |
| `nodes[].nodeType`     | string         | Node type (see enum below).                                                                                                                     |
| `nodes[].isInitial`    | boolean        | Whether the node is an entry point.                                                                                                             |
| `nodes[].isTerminal`   | boolean        | Whether the node is a terminal node.                                                                                                            |
| `nodes[].tools`        | array          | Tools configured on the node.                                                                                                                   |
| `nodes[].position`     | object         | Canvas position, `{ "x": <number>, "y": <number> }`.                                                                                            |
| `edges[].id`           | string         | Edge id.                                                                                                                                        |
| `edges[].sourceNodeId` | string         | Source node id.                                                                                                                                 |
| `edges[].targetNodeId` | string         | Target node id.                                                                                                                                 |
| `edges[].metadata`     | object \| null | Edge metadata. `conditionalSourceHandle` names the branch handle on a `conditional` source node, identifying which branch the edge routes from. |

Node type values:

| `nodeType`    | Description                              |
| ------------- | ---------------------------------------- |
| `agent`       | Claygent (LLM) node.                     |
| `code`        | Python code node.                        |
| `tool`        | Single-tool action node.                 |
| `conditional` | Branches on a condition expression.      |
| `fork`        | Splits execution into parallel branches. |
| `join`        | Merges parallel branches.                |
| `map`         | Fans out over a list.                    |
| `reduce`      | Aggregates map results.                  |
| `collect`     | Collects streamed outputs into a list.   |
| `trigger`     | Workflow entry-point node.               |

## 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 get wf_abc123 snap_xyz
clay workflows snapshots get wf_abc123 snap_xyz --node-id node_3 | jq '.nodes[0]'
clay workflows snapshots get wf_abc123 snap_xyz | jq -r '.nodes[].name'
```
