A search for a draw.io architecture diagram as code usually points at a file you can keep: a .drawio or .xml source, sometimes Mermaid text, sometimes a prompt that an assistant turns into native shapes. Those are documented features of draw.io. They give me a source I can store and open again in draw.io. They do not, by themselves, give me a page I can play. I still build that walkthrough in ByteDiagram. ByteDiagram does not open .drawio files, and I do not claim a ByteDiagram as-code format.
I built ByteDiagram, which is the tool we publish. draw.io and ByteDiagram are not affiliated. This page is not a guide to the Generate tool's still picture, and it is not a rebuild how-to. Those jobs have their own articles: why a generated architecture page can remain a static picture, and How to Rebuild a draw.io Architecture Diagram So It Can Play. This page stays on the comparison: what "as code" gives me in draw.io, and what I still build as a playable canvas.
What draw.io documents as a source you can keep
The export manual, checked on 16 November 2026, is plain about the source file: .drawio and .xml save formats "contain your full diagram, and can be opened in draw.io." In the same manual's comparison table, XML (.drawio) is described as "full source," and the suggested uses are backups, version control, and hand-off between tools. The caveat in that row is equally plain: the format is "only useful inside draw.io" and is "not viewable as an image." That is the core of "as code" in draw.io's own wording. It is a complete file you can keep next to a service, not a picture of the page.
The same manual also notes that you can embed a copy of the diagram in a PNG, an SVG, or a PDF so draw.io can open the file again. The warning that some third-party tools strip embedded XML, and that pasting into Office strips it, is written there against "SVG with embedded XML." This article does not apply that warning to PNG. A file with an embedded copy is still an image-plus-source bundle for draw.io, not a walkthrough format. Those facts are why I treat the draw.io file as the map I keep. I do not need to move it into a different editor for the map to remain useful. The gap I care about is narrower: a complete source file can still leave the order of a request implied by arrows, rather than playable on a page of its own.
Where Mermaid and a generate result sit in that source story
draw.io can also keep a diagram as Mermaid text. The official Mermaid manual, checked on 17 November 2026, describes Mermaid as a Markdown-inspired syntax for describing a diagram in text, and it documents an insert path: Arrange, then Insert, then Mermaid. The source can be turned into native draw.io shapes inside a Mermaid container group, or generated as a single non-editable SVG image. If you convert the source to shapes, you can style them in the format panel; those styles persist over later edits to the Mermaid source. Layout changes inside the container can be overridden if you edit the source and regenerate. That is still a source-and-diagram relationship inside draw.io. It is not a playable walkthrough in another tool.
The Generate tool sits next to that story, not in place of it. The generate manual, also checked on 16 November 2026, says the tool supports a range of diagrams, "including interface mock-ups, infrastructure diagrams, Mermaid diagrams and more." Some results, "like the Gantt chart" in their example, "will be generated in Mermaid code instead of being converted to native draw.io shapes." If you want the generator to use Mermaid, the same page says to write that in the query, "either before or directly after the diagram type." Once the result is on the canvas, it is edited like any other draw.io diagram. That is a useful way to arrive at a source. Whether a generated page already plays a sequence belongs to the still-picture piece linked above. A repository can hold a .drawio file, a Mermaid file, or both; none of those facts is a claim that ByteDiagram reads either format.
What the official MCP adds
draw.io also documents an official path for AI assistants. The "draw.io for AI assistants" page, checked on 16 November 2026, says you can describe a diagram in Claude, ChatGPT, GitHub Copilot or Cursor and receive a diagram file that draw.io can open for editing. The hosted MCP App Server lives at mcp.draw.io. The page states there is no installation and no sign-in for that hosted server. A separate skills-and-plugins path can create .drawio files in a project, and can export them to PNG, SVG or PDF; draw.io Desktop must be installed to export those images. Two sentences on that page matter for this comparison. First: "The model of your assistant writes the diagram as text. The draw.io server turns this into a draw.io diagram using native shapes." That is text-in, native-file-out. Second, under privacy and security: the hosted server "doesn't store your diagram data, and we don't use your data to train any AI models." It receives only what the assistant sends to draw a diagram, and "never receives your conversation content." Architecture, cloud and network diagrams are among the listed types.
I am describing that public documentation, not a session I recorded for this article. I am not attaching a timing, a success rate, or a verdict about any one assistant. The documented result is a native draw.io file, or a link that opens one. ByteDiagram does not open that file, and the walkthrough I want still has to be built as its own page.
The walkthrough I still build on a different page
The example I use for that second page is a short webhook path, drawn for this article, not copied from a customer's system and not measured against a real queue. The boxes are labelled Producer, HTTPS endpoint, App service, Queue, and Worker. The five steps stay small on purpose:
- The producer sends the webhook to the HTTPS endpoint.
- The endpoint forwards it to the application service.
- The application service accepts the payload and writes it to the queue.
- The worker reads the queue.
- The worker processes the job.
I do not invent retries, lag, or throughput. If a label cannot be verified, it does not belong on the teaching page. What travels is the method: pick the systems on the path, write the steps, and let the new page play them. The detail diagram below is that walkthrough. It is not a screenshot of a .drawio file, and it is not a claim that the file was imported.
ByteDiagram, which is ours, has only a few checked controls for this work. The control labelled "Start from a template" loads a stored layout if an empty canvas would only delay the work. The canvas has an Auto-arrange button. Bars on a timeline set the moment each element appears, and Play or Pause runs the list. Animated flow is on the edge toolbar (checked 23 Oct 2026). I name those controls as they appear in the product. I am not narrating a click-by-click session recorded for this article.
A check of the guest canvas on 12 November 2026 recorded Templates, Auto-arrange, Timeline and Play, and a top bar reading Local only. You can edit there without an account. When the walkthrough is ready to leave the editor, its Export menu includes PNG, SVG and Animated GIF (checked 19 Oct 2026). A static PNG or SVG may accompany the original .drawio or Mermaid source. An Animated GIF can take the played sequence to readers who will not open the editor. I am not saying the walkthrough is quicker to produce than the source file, and I am not saying draw.io is the wrong place to keep the map.
What this comparison does not claim
It does not claim that ByteDiagram opens, imports, or converts a .drawio file, a Mermaid file, or an MCP result. It does not claim a ByteDiagram as-code format, a command-line source, or a JSON round-trip. It does not invent a hands-on test of draw.io's Generate tool or of the official MCP. It does not attach times, scores, or prices to either product. If the original draw.io page already plays the path clearly enough for the review, there is no second page to build.
Where each one fits, briefly
I keep draw.io when the job is the source: a .drawio or .xml file in version control, a Mermaid insert on that page, or a native file an assistant produced through the documented MCP. Those are the jobs draw.io already documents well. I wrote a longer evaluation of when draw.io is the better choice in when draw.io is still the better choice. This article does not repeat that review.
I still build a ByteDiagram page when the job is the walkthrough: the five steps on one sheet, a timeline that can be played, and an export that can leave as a still image or as an Animated GIF. The two pages can sit in the same pack. The source file stays the source. The walkthrough stays the walkthrough. A sister comparison of those representations, including Mermaid as its own file, is A draw.io Page, a Mermaid File, and a ByteDiagram You Can Play.
The origin story of why I built the tool at all lives in why I built ByteDiagram after years of fighting draw.io. It is a different article. The point here is narrower, and that is what keeps it honest: "as code" in draw.io is a documented way to keep a complete source. The page I still build is the one that plays the order.
FAQ
Does ByteDiagram open a .drawio file or treat it as code?
No. ByteDiagram does not open .drawio or .xml files, and I do not claim a ByteDiagram as-code format. The draw.io export manual, checked on 16 November 2026, calls those formats the complete source, to be opened in draw.io. I keep that file as the source, and I build a separate walkthrough when the review needs the order of steps.
What does "draw.io as code" mean in draw.io's own docs?
In the export manual, .drawio and .xml are the complete source, suggested for backups, version control and hand-off, and useful inside draw.io rather than as an image. Mermaid can be inserted and edited as text, including as native shapes or as a non-editable SVG. The official MCP page says an assistant writes the diagram as text and the draw.io server turns that text into native shapes.
Is this the same article as generating a diagram with AI?
No. Generate and the official MCP are part of the source story here, because they can produce Mermaid or a native file. Whether a generated page is still a still picture is a different question, and it has its own article. This page compares a keepable source with a playable walkthrough.
Can I keep the .drawio file and still use ByteDiagram?
Yes. The two pages do different jobs. Keep the source file in draw.io. Build the walkthrough on a ByteDiagram canvas if the review needs to play the steps. There is no import step between them, and this article does not describe one.
Sources
- Supported export formats, draw.io manual, checked 16 November 2026: https://www.drawio.com/docs/manual/export/export-diagram/
- Insert and edit a Mermaid diagram, draw.io manual, checked 17 November 2026: https://www.drawio.com/docs/manual/mermaid/
- Generate diagrams in draw.io, checked 16 November 2026: https://www.drawio.com/docs/manual/generate/
- draw.io for AI assistants, checked 16 November 2026: https://www.drawio.com/mcp/
- ByteDiagram team: https://bytediagram.com/team
- ByteDiagram guest canvas: https://bytediagram.com/canvas/guest-demo. Templates, Auto-arrange, Timeline and Play, and "Local only," checked 12 November 2026. Animated flow, checked 23 October 2026. Export menu includes PNG, SVG and Animated GIF, checked 19 October 2026 (menu observed only).
Keep the source file, and build the walkthrough
A draw.io architecture diagram as code is a real, documented artefact: a complete file, sometimes Mermaid text, sometimes a native page an assistant produced from text. I keep that source where it belongs. The page I still build is the webhook path that can be played, exported as a still image or as an Animated GIF, and placed beside the file rather than forced into it.
Keep the source file, and build the walkthrough
Use ByteDiagram, the tool we built, to place a five-box webhook path on one sheet, add a timeline for the steps, and export a still PNG or an Animated GIF to sit beside the original source file.
Visit ByteDiagram