Import and export graphs
Move Agent graphs through JSON, Mermaid, LangGraph Python, and LangGraph TypeScript formats.
Export an Agent graph for backup, review, visualization, or further implementation, and import a version 1 JSON definition back into the canvas. JSON is the round-trip format; Mermaid and LangGraph exports are generated artifacts and cannot be imported into Agent Studio.
Before you begin
Open the graph you want to move and confirm that its displayed nodes and edges are current. You need write access to the destination canvas to import JSON. Store exported files according to your organization's rules because graph definitions and generated code can include prompts, endpoint URLs, headers, and other workflow configuration.
Choose a format
The Export Graph dialog groups formats by visual, code, and data.
| Format | File | Best use | Round-trip import |
|---|---|---|---|
| JSON Schema | agent-graph.json | Preserve the version 1 graph definition. | Yes |
| Mermaid.js | agent-graph.md | Review the topology as a left-to-right flowchart. | No |
| LangGraph Python | agent_graph.py | Start a Python StateGraph implementation. | No |
| LangGraph TypeScript | agentGraph.ts | Start a TypeScript StateGraph implementation. | No |
| PNG Image, SVG Vector, PDF Document | Image or document | Share a visual rendering. | No |
Export and import
Confirm that the canvas contains the intended version, terminal nodes, connections, branch labels, and node configuration. Export uses the graph currently displayed; it does not repair invalid structure.
For a portable backup that Agent Studio can read later, choose JSON. For documentation, choose Mermaid. Choose a LangGraph format only when you plan to finish and maintain the generated program outside the canvas.
Select EXPORT… in the canvas portability toolbar. The Export Graph dialog opens on the visual category.
Select code to access Mermaid.js, LangGraph Python, and LangGraph TypeScript, or select data to access JSON Schema.
Select the format card. Agent Studio generates and downloads the file, then closes the dialog.
For JSON, the output contains version, nodes, and edges with two-space indentation. Mermaid uses graph LR, converts node IDs to Mermaid-safe identifiers, preserves edge labels, and adds visual classes for notes and frames.
If you selected Python or TypeScript, inspect the generated file before installing dependencies or executing it. The exports create graph state, node functions, edges, and a compiled graph, but several integrations contain comments or placeholders that require implementation.
Replace example model configuration as appropriate, restore any prompt content omitted after 200 characters, and wire tool and MCP calls to your runtime. Skill nodes call the Agent Studio executions endpoint using AGENT_STUDIO_API_URL; when that variable is absent, generated code falls back to http://localhost:3000. Configure authentication required by your Agent Studio deployment rather than embedding credentials in the file.
On the destination canvas, select Import Graph JSON and choose the exported .json file. Agent Studio accepts a parsed object only when version is 1 and both nodes and edges are arrays. The file must also contain at least one node for the canvas import to proceed.
On success, the canvas replaces its displayed nodes and edges and reports Graph imported with both counts. Importing does not merge the file with the existing canvas.
Inspect node prompts, tool references, routes, and any environment-specific endpoints. Confirm that START and END are present and all connections point to existing nodes.
Run a ghost preview with synthetic input. The preview applies structural and skill-input checks that the JSON import's basic shape check does not perform.
Verify portability
COMPLETED.For Mermaid, render the downloaded file in a Mermaid-compatible viewer and compare every node and labeled branch with the canvas. For LangGraph, review and test the finished program in a controlled development environment; a successful download alone does not validate runtime equivalence.
Troubleshooting
After moving the graph, use Graph nodes and validation reference to check its supported surface, then preview and debug it before creating a persisted execution.