Skip to main content

Generate diagrams in draw.io

  1. Open the Generate dialog.
    • Click on the Generate tool (sparkle button) in the Classic or Atlas toolbar.
    • Alternatively, select + > Generate from the toolbar or Arrange > Insert > Generate from the menu.
    • Or, type your search query in the shapes panel and select Generate from the search tools list.
  2. Write a query describing your diagram and generate a diagram based on your description, and press Enter to generate a diagram.
    The generate diagram tool in draw.io

The Generate tool uses multiple AI generators to support a wide range of diagrams, including interface mock-ups, infrastructure diagrams, Mermaid diagrams and more.

This tool is available in all the draw.io editor themes including in the Atlassian draw.io apps and our online editor.

You can also generate a diagram in the template library dialog, but you can't edit these queries as easily, or pass the generation tool any parts of your diagram on the drawing canvas, unlike if you use the Generate dialog.

Generate a diagram

Make sure you write the type of diagram you want at the start of the query - this is what decides which AI generator is chosen, as each generator is good at only a small subset of diagrams.

  1. Open the Generate dialog - click on the sparkle button in the toolbar if you are using the Classic editor theme. In the other themes, click + > Generate in the toolbar, or select Arrange > Insert > Generate.
    Click on the Generate tool in the draw.io toolbar to open the Generate diagram dialog
  2. Describe the diagram you want to generate, then press Enter or click on Send.
    Write a description of your diagram and send your query in the draw.io Generate tool
  3. Your query will be sent to the AI tools to analyse and generate a preview of a diagram - this may take a little time. If the result doesn't match your query, you will need to refine it. Click the Edit pencil to copy any query into the text box where you can edit and resend to regenerate a different version of the diagram - keep in mind that AI tools may not return sensible results.
    Refresh to regenerate a different version of your diagram
  4. Click + to add the diagram to the drawing canvas.
    Insert the generated diagram on the drawing canvas in draw.io
  5. Online draw.io editor only: To open the diagram in a new browser tab and new diagram instead of inserting it on the current diagram page click on Open in New Window.
    Open a generated diagram in a new draw.io to generate a new or updated version of the diagram

Once the diagram has appeared on the drawing canvas, you can edit the diagram shapes, connectors, text and styles as any other draw.io diagram.

Tips:

  • Hover over the diagram in the Generate dialog to see a larger preview.
  • Click on the microphone to dictate your query instead of typing it.
    Dictate your query instead of typing it in the Generate tool in draw.io

Keep your queries short

The small character counter encourages you to write short to-the-point queries. If you reach the limit, you'll see an error when you send the next query. Editing a diagram and adding for information to a query to generate new versions is ineffecient and expensive with LLM tokens.
Keep your queries as short as possible and avoid editing them.

Learn more about writing good queries for AI diagram generation

Start a new chat for a new diagram

Start a new chat to generate a new diagram - click + Chat in the left of the Generate dialog.
Click on + Chat to generate a new diagram

These chats stay unless you delete them - click the trash icon to the right of the Generate diagram chat you want to delete.

Describe your diagram directly in the search field above the Scratchpad and select Generate from the search actions.
Generate diagrams of many different types from a text description via the search field in draw.io

The colours in generated diagrams may not be optimised for draw.io's adaptive colours feature that automatically adjusts for dark and light modes. You may need to tweak shape and diagram styles after inserting the generated diagram on the drawing canvas. In the example below, the generated diagram was much easier to see in dark mode.

Edit your diagram generation query in draw.io to generate a new or updated version of the diagram

Some diagrams, like the Gantt chart above, will be generated in Mermaid code instead of being converted to native draw.io shapes. Hover over the diagram on the drawing canvas to see this Mermaid code, and double click on it to edit it.
Edit the generated mermaid diagram in draw.io

Tip: If you want to ensure the generator uses Mermaid, write that in your query, either before or directly after the diagram type.

Preview the generated diagram

Hover over the diagram in the Generate dialog for a small preview, and to see a larger preview, click on the Preview magnifying glass.
Hover over the generated diagram to see a small preview in draw.io

Edit your query

  1. Click on Edit (pen icon) to paste that query text in the description box.
  2. Refine the query and click Send to generate an updated diagram.
    Edit your diagram generation query in draw.io to generate a new or updated version of the diagram

The edited queries do not overwrite the earlier generated diagrams.

  • 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.
    You can insert each of the generated diagrams - or click Apply to add the suggested changes to the drawing canvas

Tip: To copy just the text of your query to the clipboard, click the Copy icon.

You can also share your current diagram or selected shapes and connectors from the drawing canvas with the Generate tool, much like you can share files from your desktop with LLM tools.

Click on the + in the lower left of the query text box and add the diagram File, the diagram data for the current diagram Page, or just the Selection of shapes and connectors in the current page.
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

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 via the + option when you send a query. Learn more about AI diagram generation.

Delete a query

  • Click Delete (rubbish bin) next to a Chat in the left panel of the Generate dialog to delete a query and all of its diagrams.
  • To clear the dialog completely of all generated diagrams, delete all Chats.
    Click on the Remove trash can icon to remove a query from the draw.io generate diagram tool

Generate a template diagram

  1. Create a new diagram - go to our online diagram editor - or click on + in the toolbar and select Template to insert a generated diagram, or select Arrange > Insert > Template.
  2. Click on the Generate box in the template library.
    Generate diagrams of many different types from a text description via the template library in draw.io
  3. Enter a basic description of your diagram in the text field, and press Enter or click OK.
    Generate diagrams of many different types from a text description via the template library in draw.io
  4. Click Insert or Create to add it to the drawing canvas.
    Generate diagrams of many different types from a text description via the template library in draw.io

Make sure you write what type of diagram you want to generate at the start of the prompt. In this example, the prompt was:
sequence diagram - a customer purchases a product from a web store

For Atlassian administrators

Enable smart templates in draw.io for Confluence Cloud.