create_snapshot
Save a checkpoint of a workflow's current state before making changes to enable restoration if needed. Enforces plan-based snapshot limits.
Instructions
Create a manual config snapshot of a workflow's current state. Use this to save a checkpoint before making changes, so you can restore later if needed. Enforces plan-based limits (Pro=2, Teams=10, Custom=50). Returns an error with limit info if the snapshot limit is reached — delete old snapshots first to free up space.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workflowId | Yes | The workflow ID to snapshot | |
| label | No | Optional label to identify the snapshot (e.g. "before refactor") |
Implementation Reference
- src/tools/workflows.ts:220-240 (handler)The MCP tool registration for 'create_snapshot', which maps the tool request to the `client.createSnapshot` method.
server.tool( 'create_snapshot', `Create a manual config snapshot of a workflow's current state. Use this to save a checkpoint before making changes, so you can restore later if needed. Enforces plan-based limits (Pro=2, Teams=10, Custom=50). Returns an error with limit info if the snapshot limit is reached — delete old snapshots first to free up space.`, { workflowId: z.string().describe('The workflow ID to snapshot'), label: z.string().optional().describe('Optional label to identify the snapshot (e.g. "before refactor")'), }, async ({ workflowId, label }, extra) => { const client = clientFactory(extra); const result = await client.createSnapshot(workflowId, label); return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2), }], }; } ); - src/client.ts:147-152 (handler)The actual HTTP client implementation of the createSnapshot method that communicates with the API.
async createSnapshot(workflowId: string, label?: string) { return this.request(`/workflows/${workflowId}/snapshots`, { method: 'PUT', body: JSON.stringify({ label }), }); }