Skip to main content

2 posts tagged with "generate"

View All Tags

Create draw.io diagrams in Claude, ChatGPT, VS Code and Cursor

· 6 min read

When you ask an AI assistant to draw a diagram, use the draw.io connector or plugin for your assistant so it draws fully editable diagrams and shows them directly in your conversation.

  • Zoom, pan, hide or show layers, or open the generated diagram in full screen without leaving your AI chat.
  • Ask your assistant to edit the diagram or change its style.
  • When you are happy with it, either open the diagram in the draw.io editor to continue editing it yourself, or save it as a .drawio file in your preferred location.

This works in Claude, ChatGPT, GitHub Copilot in VS Code, and Cursor.

Claude draws an AWS architecture diagram with draw.io right in the conversation, using the official AWS icons

Add draw.io to your AI assistant​

Then describe the diagram you need, and the diagram will be drawn right inside the conversation. Use the zoom at the bottom of the preview, drag the preview around to pan, or open it in full screen mode.

Example: "Draw an online shop's order process as a diagram: a flowchart with at least two decisions and one retry loop (if the payment fails, retry up to 3 times)"

Claude has drawn a flowchart using draw.io right in the conversation

Note: AI assistants that run in a terminal, such as Claude Code, can't display the diagram in the conversation text. They will answer with a link that opens the diagram in the free online draw.io editor instead.

Use draw.io without an account​

You can use the draw.io editor and connectors inside your AI assistants without an account. draw.io receives only what it needs to draw the diagram. As it doesn't need an account, it can't access your files or the conversation with your AI assistant.

You choose where to save the diagram file. draw.io doesn't store your diagrams.

Read the privacy policy for AI assistants for details.

Draw diagrams of every kind​

Describe what you need in your own words: flowcharts, sequence and class diagrams, entity relationship diagrams, org charts, mind maps, timelines, Gantt charts and more.

When you need to use specific shapes, specify the standard that you want to use, and draw.io will look up the matching symbols in its shape libraries.

There are more than 10,000 shapes in the libraries, covering a wide range of diagramming fields and standards. You can ask your assistant to draw AWS, Azure, Google Cloud, Kubernetes, Cisco, network, electrical, BPMN, UML, Salesforce and process control diagrams, and include popular brand logos and icons.

draw.io lays out the diagram for you and routes connectors neatly around shapes automatically.

Example: "Draw a wireframe of a mobile app login screen: logo, email and password fields, a sign-in button, a forgot-password link and social login buttons."

Claude has drawn a mobile phone app mockup with draw.io shapes as an editable draw.io diagram

Edit and save the diagram in draw.io​

Ask your AI assistant to edit the diagram, add shapes, change the layout, or to make changes to its style. It will only change what you ask it to and keep the rest of the diagram the same.

Ask Claude to remove the frame around the Kubernetes cluster, and Claude shows the updated diagram with the Open in draw.io, Copy and Download buttons below it
  • Click Open in draw.io below the diagram.
    The diagram will open in the draw.io editor in a new tab. Edit it as you would any other diagram, then save it to your device, Google Drive, OneDrive, GitHub or another storage location. If you close the tab before you save, draw.io will remind you that you have unsaved changes.
  • Click Copy to copy the diagram, then paste it into another draw.io diagram. Click the small arrow next to Copy and select Copy as PNG to copy it as an image.
  • Click the Download icon (an arrow pointing down) to save the .drawio diagram file to your device. Click the small arrow next to it to download the diagram as a PNG or SVG image instead.

Change a diagram you already have​

Attach a .drawio file to your message and describe what to change. The assistant will either update the XML directly in the .drawio diagram file and give you the new version to download, or show the updated diagram in the conversation, ready to open in the draw.io editor.

Example: "In the following Sankey .drawio diagram on the first diagram page (Sankey with connectors), please change the orange sketch regions to blue."

Asked Claude to change the orange regions of an uploaded Sankey diagram to blue, and Claude showed the updated diagram with a Fix 6 issues button below it as it found visual problems with the diagram

Tip: If your assistant provides you with the file to download, you can ask it to display it in the conversation instead.

Review existing diagrams for visual problems​

Ask the assistant to review your diagram file for problems and it will identify if there are any overlapping labels, unreadable colours or poor layouts. Click Fix issues beneath the diagram preview to fix the listed issues in the diagram.

Create diagram files in coding assistants​

In Claude Code, Codex CLI and GitHub Copilot CLI, install the draw.io plugin to create .drawio files in your project. Ask for a PNG, SVG or PDF file to export the diagram with the diagram data embedded, so it stays editable in draw.io. In VS Code, the draw.io extension will open these files in the editor.

Updated Generate tool for better AI diagrams

· 5 min read

The Generate tool has been overhauled so that it is more flexible and more customisable via the draw.io configuration dialog.
The updated Generate tool in draw.io with a chat list on the left, generated diagram previews in the middle, and a query text box at the bottom

  • Start a New Chat in the Generate dialog to generate a new or different diagram.
  • Edit the query, or Send a clarification query to make changes to an already generated diagram. Apply those changes to the diagram you had already added to the drawing canvas.
  • Change the default initial LLM instructions, set specific LLM models, and use your own LLM API keys via the draw.io configuration.
Generate a UML sequence diagram from a text description via the diagram generate dialog in draw.io

Which LLM models?​

The most appropriate LLM model for the diagram type you specified in your query will be chosen automatically. The model list that draw.io uses changes frequently - currently, OpenAI, Claude and Gemini are used.

Using multiple AI generators supports a wide range of diagrams, including interface mock-ups, infrastructure diagrams, Mermaid diagrams and more.

You can also set specific instructions and configurations for each action and/or model in the draw.io editor configuration.
customise the AI models used in diagram generation in draw.io via Extras > Configuration

Set specific AI models​

Add your own LLM API keys to choose specific models from the Claude, Gemini and GPT families in the Generate dialog, instead of using the free hosted draw.io backend.

  1. Select Extras > Configuration from the menu.
  2. Enter your API keys in the AI configuration section, then click Apply.
    Add your own LLM API keys in the draw.io configuration to choose specific AI models in the Generate dialog

The model selector in the Generate dialog will list your configured models. Via the configuration options, you can also add new or self-hosted models with compatible APIs, customise the system prompts, or disable the AI features completely.

Tip: The Clipboard backend needs no API key - it copies your request to the clipboard so you can paste it into an external AI tool, then paste the response back into the Generate dialog.

Generate a diagram​

  1. Click on the Generate tool (sparkle button) in the toolbar, or select Arrange > Insert > Generate from the menu.
    Click on the Generate tool in the draw.io toolbar to open the Generate diagram dialog
  2. Describe your diagram, starting with the type of diagram you want, then press Enter or click on Send.
  3. Click + to add the generated diagram to the drawing canvas.
    Insert the generated diagram on the drawing canvas in draw.io

The diagram will be added to the drawing canvas, where you can edit its shapes, connectors, text and styles as in any other draw.io diagram.

Tips: Hover over a diagram in the dialog to see a larger preview, and click on the microphone to dictate your query instead of typing it. Click + Chat to start a new chat for each new diagram - see examples of generated diagrams.

Share your diagram data with the LLM​

Do you want the Generate tool to make changes to an existing diagram, page, or selected shapes and connectors?

Click on the + in the lower left of the query text box and attach the diagram File, the current diagram Page, or just the Selection of shapes and connectors.
Share your draw.io diagram file, the current diagram page or the selected shapes and connectors with the Generate tool via the + in the bottom left of the query text box

The Generate tool will return an updated version of your diagram.

  • Click on the tick to Apply the changes to the diagram on the drawing canvas.
  • Click on the + to Add the new version to the drawing canvas in addition to any existing shapes and connectors.
    Apply the suggested changes to your diagram on the drawing canvas, or add the new version alongside the existing shapes

Note: The Generate tool only has access to the diagram data that it has generated in that chat and anything you have explicitly shared with it. Learn more about AI diagram generation.

Generate diagrams in your AI chats​

If you prefer to work in your AI tool instead, use the draw.io MCP server. The MCP server lets LLMs create draw.io diagrams and open them in the draw.io editor. With AI services that support MCP Apps, such as Claude.ai and VSCode, diagram previews will appear inline in your AI chat.