Skip to main content
Glama

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
NameRequiredDescriptionDefault
workflowIdYesThe workflow ID to export

Implementation Reference

  • 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),
                    }],
                };
            }
  • The underlying client method that performs the API request to export the workflow.
    async exportWorkflow(id: string) {
        return this.request(`/workflows/${id}/export`);
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Agentled/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server