Write prompts for diagrams in AI assistants
How your AI assistant turns a prompt into a draw.io diagram, and how to steer it.
The two formats
The assistant writes each diagram in one of two formats. It picks one by itself, and you can ask for the other.
| Mermaid | draw.io XML | |
|---|---|---|
| What the assistant writes | A short text description: Order --> Payment | Every shape with its position, size and style |
| Layout | Automatic | Placed by the assistant, following a pattern for each diagram type |
| Typical time | 10–20 s | 35–60 s |
| Output tokens | About 1,500 | About 7,500 |
| Styles | Colours by role | Any draw.io style: colour themes, fonts, shadows, hand-drawn, gradients |
| Icons | None from the draw.io libraries | More than 10,000 draw.io shapes: AWS, Azure, Google Cloud, Cisco, Kubernetes, P&ID and more |
| Diagram types | 28, including sequence diagrams, Gantt charts and charts | Anything made of shapes and connectors |
| After Open in draw.io | Keeps its Mermaid text: double-click the diagram to edit the text | Native draw.io shapes, each editable on its own |
Which format the assistant uses
draw.io XML: for diagrams of boxes and lines up to about 30 shapes. These are flowcharts, decision trees, swimlane processes, org charts, ER diagrams, UML class, state and use case diagrams, mind maps, timelines, and architecture, cloud and network diagrams.
Mermaid: for the diagram types only Mermaid draws, and for large flowcharts. These are sequence diagrams, Gantt charts, pie, XY, quadrant and Sankey charts, git graphs, kanban boards, user journeys and the other Mermaid types, and flowcharts with more than about 30 shapes, which get an automatic layout.
A quick diagram: only when you ask for a quick flowchart or swimlane diagram. The assistant lists the steps, and the draw.io server lays out the diagram.
Ask for a format
| You want | Add to your prompt |
|---|---|
| A quick flowchart or swimlane diagram | "Quickly draw…" · "A rough sketch is fine." · "Use few tokens." |
| A faster result, or a diagram you edit as text later | "Use Mermaid." |
| Your own styling, exact placement or icons | "Use draw.io shapes, not Mermaid." |
| Official icons | "Use AWS icons." · "Use Cisco shapes." · "Use Kubernetes icons." |
For example, a 20-step insurance claim process placed as draw.io XML took 4–7 minutes. The same prompt ending in "Use Mermaid." took 15 seconds.
Ask for a quick diagram
Ask for a quick diagram when you need a flowchart or a swimlane diagram fast, for example a first draft. Use words such as "quickly", "a rough sketch", "a draft", "with little effort" or "use few tokens", in any language. In German, for example, "schnell", "Skizze" or "sparsam".
Quickly draw a flowchart of returning a book at a library self-service kiosk.
Draw a swimlane diagram of requesting a new laptop, with the employee, the manager and IT. Just a rough sketch is fine.
The assistant only lists the steps, the lanes, the connections and roughly where each step goes. The draw.io server then lays out the diagram and routes the connectors.
| Quick diagram | Usual diagram | |
|---|---|---|
| Time to the diagram, Claude Sonnet 5.5 | 14 s | 46 s |
| Time to the diagram, Claude Opus 5.5 | 27 s | 108 s |
| Output tokens, Claude Sonnet 5.5 | About 3,500 | About 7,600 |
| Colours | The calm colours only | Any colour theme or style |
| Diagram types | Flowcharts and swimlane diagrams | All |
The times are for six flowcharts and swimlane diagrams. The quick diagrams were as good as the usual ones in most of them. In some flowcharts without lanes, connectors crossed or took a detour.
- Other diagram types: A quick request for another diagram type, such as an ER or architecture diagram, will be drawn as usual.
- Large flowcharts: A flowchart without lanes with more than 24 steps will be drawn as usual. Swimlane diagrams have no limit.
- Colours and icons: For a colour theme, icons or a particular look, leave out the words for speed and name the theme or icons instead.
- Changes: Ask for the change in the same chat. The steps you don't change stay in place.
Note: Quick diagrams are the fast mode of the draw.io MCP App Server, which shows diagrams in the chat. The MCP Tool Server and the draw.io skill in the plugins don't draw them. See the draw.io MCP server.
Choose a model
| Model | Result |
|---|---|
| Claude Sonnet 5.5 | Recommended. Unless a table names another model, the times above are for this model. |
| Claude Opus 5.5 | The best layouts and the most complete content, in about twice the time (draw.io XML: 115 s). |
| Claude Haiku 5.5 | Not faster: it wrote 2–3 times as many tokens (draw.io XML: 75 s), and chose the wrong format in 2 of 10 runs. |
| Other models, such as GPT and Gemini | They use the same drawing guide, but weren't measured. |
Write the prompt
- Name the diagram type: "a swimlane process", "an ER diagram", "a sequence diagram".
- List the content: the steps, components, tables or people. The assistant adds what is obviously missing, such as the start and end or error paths, but your list decides what appears.
- Say what connects to what where it matters: "the API gateway calls the order and payment services".
- Say where the diagram goes: "for a board slide" gets a corporate look, "for the whiteboard" a hand-drawn one. See colour themes.
- Name the icon set when you want icons: AWS, Azure, Google Cloud, Cisco, Kubernetes, P&ID.
- Write in any language: the labels will be in the same language.
When the result is off
Ask for the change in the same chat. The assistant sees the diagram as it is shown, and changes only what you name:
Make it left to right.
Add a Redis cache between the application servers and the database.
Highlight the photo upload path in orange and label each connector with what it carries.
Specific requests work better than "try again". For many small changes, click Open in draw.io and edit the diagram in the draw.io editor.
Related
- Diagram types and examples for AI assistants.
- Change and style a diagram in an AI assistant.
- Write better queries for AI generated diagrams in the draw.io Generate dialog.