Skip to main content
Fetch a single snapshot’s full workflow graph, including nodes, edges, agent prompts, and code. Get a snapshot id from clay 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.
clay workflows snapshots get <workflowId> <snapshotId> [--node-id <id>]

Arguments

ArgumentDescription
workflowIdWorkflow id, e.g. wf_abc123. Required.
snapshotIdSnapshot id, from snapshots list. Required.

Flags

FlagDescription
--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.
{
  "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" }
    }
  ]
}
FieldTypeDescription
idstringSnapshot id.
workflowIdstringWorkflow the snapshot belongs to.
hashstringContent-addressed hash of the captured graph.
createdAtstringWhen the snapshot was taken.
containsCyclesbooleanWhether the captured graph contains cycles.
nodes[].idstringNode id.
nodes[].namestringNode name.
nodes[].descriptionstring | nullNode description, or null.
nodes[].nodeTypestringNode type (see enum below).
nodes[].isInitialbooleanWhether the node is an entry point.
nodes[].isTerminalbooleanWhether the node is a terminal node.
nodes[].toolsarrayTools configured on the node.
nodes[].positionobjectCanvas position, { "x": <number>, "y": <number> }.
edges[].idstringEdge id.
edges[].sourceNodeIdstringSource node id.
edges[].targetNodeIdstringTarget node id.
edges[].metadataobject | nullEdge metadata. conditionalSourceHandle names the branch handle on a conditional source node, identifying which branch the edge routes from.
Node type values:
nodeTypeDescription
agentClaygent (LLM) node.
codePython code node.
toolSingle-tool action node.
conditionalBranches on a condition expression.
forkSplits execution into parallel branches.
joinMerges parallel branches.
mapFans out over a list.
reduceAggregates map results.
collectCollects streamed outputs into a list.
triggerWorkflow entry-point node.

Errors

CodeExitNotes
validation_error2workflowId and snapshotId arguments are required.
not_found6No workflow or snapshot with that id.
auth_forbidden3The API key lacks permission for this command.

Examples

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'