export_workflow
Export workflows as portable JSON for cross-environment transfer, stripping workspace-specific identifiers to enable movement between environments like sandbox and production.
Instructions
Export a workflow as portable JSON for cross-environment transfer. Returns a self-contained WorkflowExport object with all steps, context, metadata, and pages. Workspace-specific identifiers (workspaceId, agentIds) are stripped so the export can be imported into any workspace.
Use this together with import_workflow to move workflows between environments (e.g. sandbox → prod).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workflowId | Yes | The workflow ID to export |
Implementation Reference
- src/tools/workflows.ts:342-361 (handler)The tool registration and handler implementation for 'export_workflow'. It calls the client's exportWorkflow method and formats the result as JSON.
server.tool( 'export_workflow', `Export a workflow as portable JSON for cross-environment transfer. Returns a self-contained WorkflowExport object with all steps, context, metadata, and pages. Workspace-specific identifiers (workspaceId, agentIds) are stripped so the export can be imported into any workspace. Use this together with import_workflow to move workflows between environments (e.g. sandbox → prod).`, { workflowId: z.string().describe('The workflow ID to export'), }, async ({ workflowId }, extra) => { const client = clientFactory(extra); const result = await client.exportWorkflow(workflowId); return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2), }], }; } - src/client.ts:289-291 (helper)The underlying client method that performs the API request to export the workflow.
async exportWorkflow(id: string) { return this.request(`/workflows/${id}/export`); }