Skip to main content

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.

Mermaiddraw.io XML
What the assistant writesA short text description: Order --> PaymentEvery shape with its position, size and style
LayoutAutomaticPlaced by the assistant, following a pattern for each diagram type
Typical time10–20 s35–60 s
Output tokensAbout 1,500About 7,500
StylesColours by roleAny draw.io style: colour themes, fonts, shadows, hand-drawn, gradients
IconsNone from the draw.io librariesMore than 10,000 draw.io shapes: AWS, Azure, Google Cloud, Cisco, Kubernetes, P&ID and more
Diagram types28, including sequence diagrams, Gantt charts and chartsAnything made of shapes and connectors
After Open in draw.ioKeeps its Mermaid text: double-click the diagram to edit the textNative 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 wantAdd 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 diagramUsual diagram
Time to the diagram, Claude Sonnet 5.514 s46 s
Time to the diagram, Claude Opus 5.527 s108 s
Output tokens, Claude Sonnet 5.5About 3,500About 7,600
ColoursThe calm colours onlyAny colour theme or style
Diagram typesFlowcharts and swimlane diagramsAll

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​

ModelResult
Claude Sonnet 5.5Recommended. Unless a table names another model, the times above are for this model.
Claude Opus 5.5The best layouts and the most complete content, in about twice the time (draw.io XML: 115 s).
Claude Haiku 5.5Not 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 GeminiThey 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.