--- title: "Export workflow as Agent Spec JSON" description: "Convert a FlowDrop workflow to Agent Spec format and return it.\n\nThe conversion:\n- Maps FlowDrop node types to Agent Spec component types\n- Splits unified edges into control_flow_connections and data_flow_connections\n- Stores FlowDrop-specific data (positions, dynamic ports) in metadata extensions\n- Validates the workflow for Agent Spec compatibility before export\n\nThis is the Agent Spec counterpart of the FlowDrop-native\n`GET /workflows/{id}/export` under **Import and Export**.\n" source: https://flowdrop.io/docs/api/agent-spec/exportWorkflowAsAgentSpec site: FlowDrop documentation --- # Export workflow as Agent Spec JSON `GET /workflows/{id}/export/agentspec` Convert a FlowDrop workflow to Agent Spec format and return it. The conversion: - Maps FlowDrop node types to Agent Spec component types - Splits unified edges into control_flow_connections and data_flow_connections - Stores FlowDrop-specific data (positions, dynamic ports) in metadata extensions - Validates the workflow for Agent Spec compatibility before export This is the Agent Spec counterpart of the FlowDrop-native `GET /workflows/{id}/export` under **Import and Export**. ## Parameters - `id` · in path · string · required — Workflow UUID - `format` · in query · string (flow | document) — Output format (document wraps flow with agent/tools/LLM config) ## Responses - `200` — Agent Spec JSON exported successfully (`application/json`: object) - `404` — Resource not found (`application/json`: ErrorResponse) - `422` — Workflow cannot be exported as Agent Spec (`application/json`: AgentSpecValidationResult) - `500` — Internal server error (`application/json`: ErrorResponse) *Tags: Agent Spec*