Skip to main content
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 to find the snapshot from just before an unwanted edit, and with clay 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.
clay workflows snapshots restore <workflowId> <snapshotId>

Arguments

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

Output

{ "ok": true }
FieldTypeDescription
oktrueConfirms the workflow was restored.

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 restore wf_abc123 snap_xyz
clay workflows snapshots list wf_abc123 | jq -r '.data[0].id' | xargs clay workflows snapshots restore wf_abc123