Creating Your First C4 Diagram
C4 Diagrams is part of experimental builds. To access this capability, contact your sales representative.
This guide walks you through creating a complete C4 Container diagram from scratch using existing Repository data. The full workflow takes about 10 minutes once your Repository entities have the correct C4 properties set.
Before You Begin
C4 Diagrams use existing Repository entities — there is no separate data source. Before designing your first diagram, ensure relevant entities have their C4 properties configured.
Step 1 — Set C4 Properties on Systems
Open each System you want to include in your diagram and set the C4Type property:
C4Type value |
When to use |
|---|---|
Person |
A human user, customer, or staff role (e.g., "Mobile User", "Finance Analyst") |
InternalSystem |
An internal application or platform you own (e.g., ERP hosted on your infrastructure) |
ExternalSystem |
A third-party system, SaaS, or partner system outside your boundary |
None |
Not used in C4 diagrams (default — will not appear in C4 toolbox) |
Optionally set:
C4PersonRole— A subtitle for Person types (e.g., "Customer", "Administrator")C4PositionHint—Topto place above lanes by default,Bottomto place below
These are global properties on the System entity. They apply across all diagrams.
Step 2 — Set C4 Properties on Services
Open each Service you want to include and set:
| Property | What to enter | Example |
|---|---|---|
C4ContainerType |
The architectural role of this service | RestApi, Database, MessageBus, WebApp, BatchJob |
C4Technology |
The technology stack or platform | "ASP.NET Core", "PostgreSQL", "Azure Service Bus" |
C4ContainerTypedrives the icon shown on the canvas node and the correct MermaidContainer(...)label.C4Technologyappears as the technology subtitle in the node and in the generated Mermaid markup.
Step 3 — Create a New C4 Diagram
- Navigate to Repository → C4 Diagrams
- Click New Diagram
- Enter a Name (e.g., "API-Led Architecture – Order-to-Cash")
- Optionally enter a Description
- Select the C4 Level: Context (L1) or Container (L2)
- Set IsShared if you want other Repository users to see this diagram
- Click Create
The C4 designer opens automatically for the new empty diagram.
Step 4 — Add Domain Swimlanes
The designer canvas starts empty. Add Domain swimlanes to represent your architectural layers:
- Click + Add Lane in the lanes toolbar (or right-click the canvas background)
- In the Domain picker, select a Domain (e.g., "Experience APIs")
- The lane appears as a horizontal swimlane
- Repeat for each architectural tier you want to show (e.g., Process APIs, System APIs)
- Drag lanes up/down to reorder them — the new order is saved automatically
The Domain picker shows all Domains in the Repository, including empty ones. This lets you document future-state architecture even before Services exist in a Domain.
Step 5 — Place Services into Lanes
- Open the Services panel on the left toolbox ()
- Search or browse for a Service
- Drag the Service into the appropriate Domain swimlane
- The Service node appears as a rectangle with its
C4ContainerTypeicon andC4Technologysubtitle - Drag the node left/right within the lane to position it at the desired X coordinate
Repeat for all Services you want to include. Services appear in their lane grouped by Domain.
If a Service Is Already in Another Lane
If you drag a Service that is already placed in a different lane in this diagram, you will see:
"Service is already placed in lane within this diagram. It will appear in both lanes."
This is non-blocking — the same Service can intentionally appear in multiple lanes (matching how BPM handles cross-domain services).
Step 6 — Add System Actors
- Open the Actors panel on the left toolbox ()
- Search or browse for a System
- Drag a Person-type System above the lane stack — it appears in the Persons row at the top
- Drag an ExternalSystem-type System below the lane stack — it appears in the External Systems row at the bottom
- Adjust positions by dragging actors left/right
Systems with
C4Type = Nonecan also be dragged onto the canvas. Use the Properties sidebar to set theirC4Typeif you did not do so in Step 1.
Step 7 — Draw Connectors
- Open the Connectors panel on the left toolbox ()
- Select a connector type:
- Solid arrow — synchronous call
- Double-headed arrow — bidirectional
- Dashed arrow — asynchronous / event-driven
- Click the source node, then click the target node to draw the connector
- The Properties sidebar opens automatically — enter:
- Label: e.g., "Sends purchase order" (appears on the arrow)
- Protocol: e.g., "REST/HTTPS", "AMQP 1.0", "SFTP" (appears as subtitle)
- Click Save in the sidebar
Repeat for all relationships you want to document.
Step 8 — Preview the Mermaid Output
Click Split View () in the toolbar to show the Syncfusion canvas on the left and the live Mermaid C4 preview on the right. The Mermaid output updates automatically as you:
- Add or remove nodes
- Move nodes between lanes
- Add or edit connectors
- Change C4 types or technology labels
This preview shows exactly what will be emitted by the C4MermaidGenerator when someone accesses the Mermaid View URL or export endpoint.
Step 9 — Share or Export
Once satisfied with your diagram:
- Share the viewer URL: Copy
/repository/c4diagrams/{id}/viewand send to stakeholders - Copy Mermaid markup: Navigate to
/repository/c4diagrams/{id}/mermaidand click Copy - Export as PNG: Use the Export dropdown → PNG
- Export as Draw.io: Use the Export dropdown → Draw.io for diagram.net
See Export and Sharing for full details on embedding options.
Checklist
Before publishing your first C4 diagram, verify:
- All Systems included have a
C4Typeset (notNone) - All Services included have a
C4ContainerTypeset - All Services included have a
C4Technologyvalue (the Mermaid$technparameter) - All Domain lanes are in the correct order
- All connectors have a
Labeland aProtocolvalue - The diagram
IsSharedflag is set correctly for your audience - The Mermaid preview renders correctly in Split View mode