---
title: Import Source Formats - Mermaid, PlantUML, Structurizr DSL and Draw.io XML for C4
description: "The source formats Nodinite C4 Import accepts: Mermaid C4 with its diagram types, macros and directives, PlantUML C4 normalization, the Structurizr DSL subset, and Draw.io XML with the metadata you confirm yourself."
---

# <i class="fal fa-file-code" aria-hidden="true"></i> Import Source Formats

[Import][] brings C4 diagrams into a [Diagram Set][What is a C4 Diagram Set] from four source formats. This page lists what each format may contain. The wizard, the entity matching and the resolution choices are on the [Import][] page.

* ✅ **Mermaid C4**, the native format  
* ✅ **PlantUML C4**, normalized to Mermaid before parsing  
* ✅ **Structurizr DSL**, a C4-focused subset  
* ✅ **Draw.io XML**, with the metadata you confirm yourself  

## <i class="fal fa-code" aria-hidden="true"></i> Mermaid C4

Mermaid is the native format. Paste standard Mermaid C4 markup with a top-level diagram type declaration. Blank lines and `%%` comments before it are skipped.

### Supported Diagram Type Declarations

* `C4Context`
* `C4Container`
* `C4Component`
* `C4Deployment`
* `C4Dynamic`

### Supported Macros

| Category | Macros |
|---|---|
| Person nodes | `Person`, `Person_Ext` |
| System nodes | `System`, `System_Ext`, `SystemDb`, `SystemDb_Ext`, `SystemQueue`, `SystemQueue_Ext` |
| Container nodes | `Container`, `ContainerDb`, `ContainerQueue`, `Component`, `ComponentDb`, `ComponentQueue`, `Container_Instance` (and `_Ext` variants) |
| Boundaries | `Container_Boundary`, `System_Boundary`, `Enterprise_Boundary`, `Boundary`, `Deployment_Node` |
| Relationships | `Rel`, `Rel_D`, `Rel_U`, `Rel_L`, `Rel_R`, `Rel_Back`, `Rel_Neighbor`, `BiRel` |

For the shape each macro produces per diagram type, see [Shapes and Toolbox][].

### Supported Directives

* `title` — sets the diagram title
* `UpdateRelStyle(a, b, $lineStyle="dashed")` — draws that relationship dashed; any other `UpdateRelStyle` is skipped with a warning
* `UpdateLayoutConfig`, `UpdateElementStyle` — recognized and skipped with a warning (not a parse error)

<aside aria-label="Warning" class="nodinite-note nodinite-note--warning">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-triangle-exclamation"></i> Warning</p>
<div class="nodinite-note__content"><p>A line that calls a macro not in the table above, such as <code>MyMacro(…)</code>, produces a parse error. Remove custom macros before importing.</p></div>
</aside>

## <i class="fal fa-leaf" aria-hidden="true"></i> PlantUML C4

![Import a C4-PlantUML source of the Order-to-Cash context into a C4 Diagram Set: PlantUML, paste, Level filled from the include, Scope Portal, Resolve All, Import, and open the diagram, animated walkthrough (7.13)][1]  
*Animated walkthrough: a PlantUML source goes through the same wizard as Mermaid. The preview shows the Mermaid the server made of it.*  

PlantUML C4 is accepted and normalized automatically before parsing:

1. `@startuml` and `@enduml` tags are stripped
2. `!include` and `!pragma` lines are removed
3. The diagram type is inferred from the C4-PlantUML file the `!include` names: `C4_Context`, `C4_Container`, `C4_Component`, `C4_Deployment`, or `C4_Dynamic` (e.g., `!include <C4/C4_Context>` or `!include C4_Context.puml` → `C4Context`). Without such an include, the diagram is a Container diagram
4. <sup><span class="nodinite-new-badge">New 7.13</span></sup> Layout and legend macros (`LAYOUT_…`, `SHOW_…`, `HIDE_…`) are removed; tag and style macros (`AddElementTag`, `AddRelTag`, `UpdateBoundaryStyle`, `UpdateLegendTitle`, `Set…`) are removed with a warning; `Rel_Up`, `Rel_Down`, `Rel_Left`, and `Rel_Right` are read as `Rel_U`, `Rel_D`, `Rel_L`, and `Rel_R`; the `title` line becomes the diagram title
5. Mermaid-equivalent C4 keyword is prepended, then the standard Mermaid parser processes the result

**Standard C4-PlantUML macros** (`Person`, `System`, `Container`, `Boundary`, `Rel`) work as-is after normalization. Non-C4 PlantUML constructs outside this normalization path may fail to parse.

## <i class="fal fa-cubes" aria-hidden="true"></i> Structurizr DSL

![Import a Structurizr DSL workspace of the Order-to-Cash context into a C4 Diagram Set: Structurizr DSL, paste, Level filled from the view, Scope Portal, Resolve All, Import, and open the diagram, animated walkthrough (7.13)][2]  
*Animated walkthrough: the same import from a Structurizr DSL workspace. The workspace name fills **Diagram Name**.*  

A C4-focused subset of Structurizr DSL is supported:

* `workspace`, `model`, and `views` blocks
* `person` and `person_ext`
* `softwareSystem`: with a `{ … }` block it becomes a boundary around its containers; without one, a [System][Systems]
* `container`
* `deploymentEnvironment`, nested `deploymentNode`, `containerInstance`, and `softwareSystemInstance`, imported as a Deployment diagram
* Relationships declared as `src -> tgt "Label" "Technology"`; <sup><span class="nodinite-new-badge">New 7.12</span></sup> the technology is read (and exported) with the [Message Type][Message Types] after ` / `
* `view` declarations — used to infer the diagram type: `systemLandscape`, `systemContext`, `container`, `component`, `deployment`, `dynamic`. With several views, the most detailed wins (Component, then Deployment, Dynamic, Container, Context, System Landscape); without one, the diagram is a Container diagram
* The workspace name (`workspace "Name"` or `name "Name"`) fills **Diagram Name**

<aside aria-label="Tip" class="nodinite-note nodinite-note--tip">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-lightbulb"></i> Tip</p>
<div class="nodinite-note__content"><p>The Structurizr parser covers typical system and container model definitions. <sup><span class="nodinite-new-badge">New 7.13</span></sup> Blocks it doesn't read, such as themes, documentation embeds, styles, tags, properties, and a container's components, are skipped without cutting off the rest of the workspace, and the elements inside a <code>group</code> are imported. Relationships inside a <code>dynamic</code> view are not read.</p></div>
</aside>

## <i class="fal fa-pen-ruler" aria-hidden="true"></i> Draw.io XML

![Import a Draw.io file of the Order-to-Cash context into a C4 Diagram Set: Draw.io XML, paste, pick the Level Context by hand, Scope Portal, Resolve All, Import, and open the diagram, animated walkthrough (7.13)][3]  
*Animated walkthrough: the Diagram Name comes from the page name, and **Next** waits until you pick a **Level**.*  

Draw.io XML from [draw.io / diagrams.net](https://www.drawio.com/)<sup><i class="fal fa-arrow-up-right-from-square" aria-hidden="true"></i></sup> is supported as an import source. The importer reads labels, shapes, boundaries, and connectors from the XML and feeds them into the same validation and entity-resolution flow used for the text-based formats:

* A shape's label holds the name on the first line, the type on the second (System, Person, Container, Component, [Service][Services], External System, and a set of Azure and partner labels), and a description after that. An unknown type becomes a System, with a warning.
* Boundaries come from nesting, or from large shapes that contain others.
* Only the first page is read, and the root must be `<mxfile>`. Compressed pages are read.
* Draw.io-only options: **Preserve original positions and sizes from Draw.io** (off by default) and **Split flow labels into separate relationships** on a new line (on by default), a comma, or a semicolon.

<aside aria-label="Important" class="nodinite-note nodinite-note--important">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-message-exclamation"></i> Important</p>
<div class="nodinite-note__content"><p>Draw.io is a general-purpose diagram format, not a C4-specific language. The importer can extract structure from the canvas, but it cannot reliably infer all <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> metadata from the XML alone.</p></div>
</aside>

Before continuing from the **Draw.io XML** tab, review these fields:

| Field | Why you review it |
|---|---|
| **Diagram Name** | Filled from the page name (`<diagram name="…">`), which may only be a tab label |
| **Level / Diagram Type** | Draw.io XML does not encode C4 intent, so the Level stays empty and **Next** stays disabled until you pick L0, L1, L2, L3, Dynamic, or Deployment. A file exported from <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> carries its level |
| **Diagram State** | Starts at Draft, as for every format; change it if you need to |

<aside aria-label="Warning" class="nodinite-note nodinite-note--warning">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-triangle-exclamation"></i> Warning</p>
<div class="nodinite-note__content"><p>Treat Draw.io import as a structured starting point, not a lossless semantic import. Always review the suggested metadata and entity matches before Apply.</p></div>
</aside>

## <i class="fal fa-hand-point-right" aria-hidden="true"></i> Next Steps

* <i class="fal fa-file-import" aria-hidden="true"></i> [Import – Bring C4 Diagrams from Mermaid, PlantUML, Structurizr DSL, or Draw.io XML][Import]  
* <i class="fal fa-toolbox" aria-hidden="true"></i> [Shapes and Toolbox][]  

## <i class="fal fa-link-horizontal" aria-hidden="true"></i> Related Topics

* <i class="fal fa-share-nodes" aria-hidden="true"></i> [Export and Sharing][]  
* <i class="fal fa-code" aria-hidden="true"></i> [Mermaid View – Read-Only Rendering][Mermaid View]  
* <i class="fal fa-folder" aria-hidden="true"></i> [What is a C4 Diagram Set?][What is a C4 Diagram Set]  

[1]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Repository/C4/Import/C4Import_PlantUml.gif
[2]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Repository/C4/Import/C4Import_Structurizr.gif
[3]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Repository/C4/Import/C4Import_DrawIo.gif

[Export and Sharing]:https://docs.nodinite.com/repository-model/c4-diagrams/features/export-and-sharing/
[Import]:https://docs.nodinite.com/repository-model/c4-diagrams/features/import/
[Mermaid View]:https://docs.nodinite.com/repository-model/c4-diagrams/features/mermaid-view/
[Message Types]:https://docs.nodinite.com/repository-model/message-types/overview/
[Services]:https://docs.nodinite.com/repository-model/services/overview/
[Shapes and Toolbox]:https://docs.nodinite.com/repository-model/c4-diagrams/features/shapes-and-toolbox/
[Systems]:https://docs.nodinite.com/repository-model/systems/overview/
[What is a C4 Diagram Set]:https://docs.nodinite.com/repository-model/c4-diagrams/features/what-is-a-c4-diagram-set/