Import Source Formats
Section titled “ Import Source Formats”Import brings C4 diagrams into a 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
Mermaid C4
Section titled “ 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
Section titled “Supported Diagram Type Declarations”C4ContextC4ContainerC4ComponentC4DeploymentC4Dynamic
Supported Macros
Section titled “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
Section titled “Supported Directives”title— sets the diagram titleUpdateRelStyle(a, b, $lineStyle="dashed")— draws that relationship dashed; any otherUpdateRelStyleis skipped with a warningUpdateLayoutConfig,UpdateElementStyle— recognized and skipped with a warning (not a parse error)
PlantUML C4
Section titled “ PlantUML C4”
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:
@startumland@endumltags are stripped!includeand!pragmalines are removed- The diagram type is inferred from the C4-PlantUML file the
!includenames:C4_Context,C4_Container,C4_Component,C4_Deployment, orC4_Dynamic(e.g.,!include <C4/C4_Context>or!include C4_Context.puml→C4Context). Without such an include, the diagram is a Container diagram - New 7.13 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, andRel_Rightare read asRel_U,Rel_D,Rel_L, andRel_R; thetitleline becomes the diagram title - 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.
Structurizr DSL
Section titled “ Structurizr DSL”
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, andviewsblockspersonandperson_extsoftwareSystem: with a{ … }block it becomes a boundary around its containers; without one, a SystemcontainerdeploymentEnvironment, nesteddeploymentNode,containerInstance, andsoftwareSystemInstance, imported as a Deployment diagram- Relationships declared as
src -> tgt "Label" "Technology"; New 7.12 the technology is read (and exported) with the Message Type after/ viewdeclarations — 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"orname "Name") fills Diagram Name
Draw.io XML
Section titled “ Draw.io XML”
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 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, 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.
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 Nodinite carries its level |
| Diagram State | Starts at Draft, as for every format; change it if you need to |
Next Steps
Section titled “ Next Steps”- Import – Bring C4 Diagrams from Mermaid, PlantUML, Structurizr DSL, or Draw.io XML
- Shapes and Toolbox