---
title: L2 Container Diagram Example | Nodinite C4 Diagrams
description: "L2 Container example built on the Order-to-Cash demo data: the Portal's four Services inside its System Boundary, ERP outside as an external System, and Flows that carry O2C Message Types. Copy-paste Mermaid markup, the scope taken from the markup, and what each element binds to."
---

# :fa-container-storage: L2 Container Diagram Example

The L2 Container diagram zooms into **one System** and shows its [Services][] (and [Contracts][]) as Containers, inside the System's boundary, with the neighbouring [Systems][] outside. :new7.12: The boundary is the diagram's **subject boundary**: it is bound to the diagram's [Architectural Scope][Diagram Set Fundamentals], and that binding is read-only in the Designer.

This page is example 3 of the six [Order-to-Cash C4 examples][Hub]. See [Example C4 Diagrams][] for an overview of all diagram types and when to use each.

![The Portal's L2 Container diagram: its four Services inside the Portal System Boundary and the Customer and ERP outside, the Service INT1337-RCV-Order-Incoming, the relationship Forwards the order for entry with XML / O2C.Forwarding/1.0, and the Inside pill opening the L3 Component diagram of INT1337-RCV-Order-Incoming, animated walkthrough (7.12)][Hero]  
*Animated walkthrough: the imported L2 Container, a relationship with its [Message Type][Message Types], and **Inside** to the L3 Component of **INT1337-RCV-Order-Incoming**.*    

>[!INFO]
>**To use this example in :Nodinite:,** copy the Mermaid markup below and follow the [Import Your First C4 Diagram][Import Your First C4 Diagram] walkthrough to create a [C4 Diagram Set][What is a C4 Diagram Set?] and [import][Import] the markup. :new7.12: Container nodes bind to a Service or a Contract, **never a System**: a System is drawn with a System shape, such as `System_Ext` for ERP below.

## Scope for This Example

| Example | Diagram type to pick in the import | Architectural Scope | Subject | When it is set | Needed before Promote |
|---|---|---|---|---|---|
| Portal — L2 Container Diagram | Container | System **Portal** | (the scope) | automatically: taken from the markup's `System_Boundary(portal, "Portal")` (the Scope step shows it as taken from the markup) | ✅ Yes |

:new7.12: The import wizard takes the scope itself from the top-level `System_Boundary` whose name matches a System. The **Scope** step shows **Portal** picked, and in **Review & Resolve** the boundary row reads *Follows the scope: Portal*. The set holds one Active L2 per System; the L2s of ERP, WMS and ERP-Finance come from [Generate from Integration Landscape][]: see [Build the Order-to-Cash C4 set][].

>[!IMPORTANT]
>The [O2C PowerShell demo][Generate O2C Demo Data] generates the Repository entities used in these examples. Do not rename generated Systems, Services, [Endpoints][], [Domains][], or [Message Types][] during import.

## When to Use

* ✅ Planning or reviewing one System's integration architecture  
* ✅ Communicating which Services a System runs and how they hand messages on  
* ✅ Identifying the Flows between Services and to neighbouring Systems, each with its Message Type  
* ⚠️ Does not show what happens inside one Service: that belongs in [L3][L3 Example]  

## Example: Portal — L2 Container Diagram

This example uses the [Order-to-Cash (O2C) demo][O2C Overview] data. The `System_Boundary` **Portal** holds the Portal's four Services, two of them business steps of the O2C [BPM][]. **ERP** stands outside as a `System_Ext`, and the **Customer** drops the order file and gets the confirmation. :new7.12: Each Flow between two Services, or between a Service and ERP, names the sender's Message Type after the `/` in its technology.

<table>
<tr>
<th>:fa-eye: Preview</th>
<th>:fa-code: Mermaid Code</th>
</tr>
<tr>
<td>

```mermaid
C4Container
    title Portal — L2 Container Diagram
    Person(customer, "Customer", "Places orders and receives order confirmations")
    System_Boundary(portal, "Portal") {
    Container(rcv_order, "INT1337-RCV-Order-Incoming", "Integration / JSON", "Picks up the customer's order file. Step 0 — Milestone: Order Received from Customer")
    Container(snd_order, "INT1337-SND-Order-Incoming", "Integration / XML", "Forwards the order to ERP for entry")
    Container(rcv_confirm, "INT1337-RCV-Confirm-Incoming", "Integration / XML", "Receives the order entry ERP returns")
    Container(snd_confirm, "INT1337-SND-Confirm-Outgoing", "Integration / CSV", "Sends the order confirmation. Step 2 — Milestone: Order Confirmation Delivered to Customer")
    }
    System_Ext(erp, "ERP", "Enters orders and schedules production")
    Rel(customer, rcv_order, "Drops the order file", "HTTPS / JSON")
    Rel(rcv_order, snd_order, "Hands the order on", "JSON / O2C.Order.Received/1.0")
    Rel(snd_order, erp, "Forwards the order for entry", "XML / O2C.Forwarding/1.0")
    Rel(erp, rcv_confirm, "Returns the order entry", "XML / O2C.Order.Entry/1.0")
    Rel(rcv_confirm, snd_confirm, "Hands the entry on", "XML / O2C.Forwarding/1.0")
    Rel(snd_confirm, erp, "Sends the confirmation for planning", "CSV / O2C.Order.Confirmation/1.0")
    Rel(snd_confirm, customer, "Delivers the order confirmation", "CSV / O2C.Order.Confirmation/1.0")
```

</td>
<td>

```text
C4Container
title Portal — L2 Container Diagram
Person(customer, "Customer", "Places orders and receives order confirmations")
System_Boundary(portal, "Portal") {
Container(rcv_order, "INT1337-RCV-Order-Incoming", "Integration / JSON", "Picks up the customer's order file. Step 0 — Milestone: Order Received from Customer")
Container(snd_order, "INT1337-SND-Order-Incoming", "Integration / XML", "Forwards the order to ERP for entry")
Container(rcv_confirm, "INT1337-RCV-Confirm-Incoming", "Integration / XML", "Receives the order entry ERP returns")
Container(snd_confirm, "INT1337-SND-Confirm-Outgoing", "Integration / CSV", "Sends the order confirmation. Step 2 — Milestone: Order Confirmation Delivered to Customer")
}
System_Ext(erp, "ERP", "Enters orders and schedules production")
Rel(customer, rcv_order, "Drops the order file", "HTTPS / JSON")
Rel(rcv_order, snd_order, "Hands the order on", "JSON / O2C.Order.Received/1.0")
Rel(snd_order, erp, "Forwards the order for entry", "XML / O2C.Forwarding/1.0")
Rel(erp, rcv_confirm, "Returns the order entry", "XML / O2C.Order.Entry/1.0")
Rel(rcv_confirm, snd_confirm, "Hands the entry on", "XML / O2C.Forwarding/1.0")
Rel(snd_confirm, erp, "Sends the confirmation for planning", "CSV / O2C.Order.Confirmation/1.0")
Rel(snd_confirm, customer, "Delivers the order confirmation", "CSV / O2C.Order.Confirmation/1.0")
```

</td>
</tr>
</table>

## What Each Element Binds To

| Markup element | Macro | Binds to | Status in Review & Resolve |
|---|---|---|---|
| Portal | `System_Boundary` | The [System][Systems] **Portal**: the subject boundary, bound from the scope | *Follows the scope: Portal* |
| INT1337-RCV-Order-Incoming, INT1337-SND-Order-Incoming, INT1337-RCV-Confirm-Incoming, INT1337-SND-Confirm-Outgoing | `Container` | The [Services][] of the same name | Matched |
| ERP | `System_Ext` | The [System][Systems] **ERP** | Matched |
| Customer | `Person` | A [System][Systems] with the C4 Type Person | Matched once the L1 import created it, otherwise New |
| `O2C.Order.Received/1.0`, `O2C.Forwarding/1.0`, `O2C.Order.Entry/1.0`, `O2C.Order.Confirmation/1.0` | text after the `/` in a `Rel` technology | :new7.12: The [Message Types][] of exactly that name, in the **Message Type** column | Resolved |
| `HTTPS / JSON` | technology whose text after the `/` names no Message Type | The Flow's protocol only | Kept as text |

A bound Container takes its icon from the Service's [Component Type][Component Types], and :new7.12: shows the Service's monitoring state. A Container named after a System, such as `Container(erp, "ERP", …)`, would import as an unbound placeholder with the note to draw it as a System shape.

### Navigation From the L2

:new7.12: The pills are inferred when the diagram opens, inside the set, with nothing stored:

* **INT1337-RCV-Order-Incoming** offers **Inside**: the L3 whose subject is that Service ([example 4][L3 Example]).  
* **ERP** offers **Inside** and **Context** for ERP, once the set holds ERP's L2 and L1.  
* The diagram itself offers **Zoom out** to Portal's L1, and **Related view** to the [Deployment][Deployment Example] and the [Dynamic][Dynamic Example] of the set.  

See [Navigation Between C4 Diagrams][] for every pill.

## :fa-hand-point-right: Next Steps

* :fa-cube: [L3: Component Diagram Example][L3 Example] — Zoom into the Service INT1337-RCV-Order-Incoming  
* :fa-hammer: [Build the Order-to-Cash C4 set][]  
* :fa-book: [Order-to-Cash C4 Examples][Hub]  
* :fa-upload: [Import Your First C4 Diagram][]  

## :fa-link-horizontal: Related Topics

* :fa-book: [Example C4 Diagrams][] — Overview of all diagram types  
* :fa-sitemap: [L1: Context Diagram Example][L1 Example] — Zoomed-out view of the Portal  
* :fa-server: [Deployment Diagram Example][Deployment Example] — Where these Services run  
* :fa-diagram-project: [O2C Demo — C4 Architecture Diagrams][O2C C4 Diagrams] — How the O2C log events map to C4 elements  
* :fa-compass: [Navigation Between C4 Diagrams][]  
* :fa-compass: [What is C4 Diagrams?][What is C4 Diagrams?]  

[BPM]:{ndr}/Repository%20Model/BPMs/Overview.md
[Build the Order-to-Cash C4 set]:{ndr}/Repository%20Model/C4%20Diagrams/Getting%20Started/Examples/Order-to-Cash/Build%20the%20Order-to-Cash%20C4%20set.md
[Component Types]:{ndr}/Repository%20Model/Component%20Types/Overview.md
[Contracts]:{ndr}/Getting%20Started/4.%20Repository/Contracts/Overview.md
[Deployment Example]:{ndr}/Repository%20Model/C4%20Diagrams/Getting%20Started/Examples/Order-to-Cash/Deployment%20Diagram%20Example.md
[Diagram Set Fundamentals]:{ndr}/Repository%20Model/C4%20Diagrams/Features/Diagram%20Set%20Fundamentals.md
[Domains]:{ndr}/Repository%20Model/Domains/Overview.md
[Dynamic Example]:{ndr}/Repository%20Model/C4%20Diagrams/Getting%20Started/Examples/Order-to-Cash/Dynamic%20Diagram%20Example.md
[Endpoints]:{ndr}/Repository%20Model/Endpoints/Overview.md
[Example C4 Diagrams]:{ndr}/Repository%20Model/C4%20Diagrams/Getting%20Started/Example%20C4%20Diagrams.md
[Generate from Integration Landscape]:{ndr}/Repository%20Model/C4%20Diagrams/Features/Generate%20from%20Integration%20Landscape.md
[Generate O2C Demo Data]:{ndr}/Repository%20Model/BPMs/Examples/Order-to-Cash/Generate-O2C-Demo-Data.md
[Hero]:{ndm}/Documentation%20Pictures/IM/WebClient/Repository/C4/C4_O2C_L2Container.gif
[Hub]:{ndr}/Repository%20Model/C4%20Diagrams/Getting%20Started/Examples/Order-to-Cash/Overview.md
[Import]:{ndr}/Repository%20Model/C4%20Diagrams/Features/Import.md
[Import Your First C4 Diagram]:{ndr}/Repository%20Model/C4%20Diagrams/Getting%20Started/Import%20Your%20First%20C4%20Diagram.md
[L1 Example]:{ndr}/Repository%20Model/C4%20Diagrams/Getting%20Started/Examples/Order-to-Cash/L1%20Context%20Diagram%20Example.md
[L3 Example]:{ndr}/Repository%20Model/C4%20Diagrams/Getting%20Started/Examples/Order-to-Cash/L3%20Component%20Diagram%20Example.md
[Message Types]:{ndr}/Repository%20Model/Message%20Types/Overview.md
[Navigation Between C4 Diagrams]:{ndr}/Repository%20Model/C4%20Diagrams/Features/Sync.md
[O2C C4 Diagrams]:{ndr}/Repository%20Model/BPMs/Examples/Order-to-Cash/O2C-C4-Diagrams.md
[O2C Overview]:{ndr}/Repository%20Model/BPMs/Examples/Order-to-Cash/Overview.md
[Services]:{ndr}/Repository%20Model/Services/Overview.md
[Systems]:{ndr}/Repository%20Model/Systems/Overview.md
[What is a C4 Diagram Set?]:{ndr}/Repository%20Model/C4%20Diagrams/Features/What%20is%20a%20C4%20Diagram%20Set.md
[What is C4 Diagrams?]:{ndr}/Repository%20Model/C4%20Diagrams/Features/What%20is%20C4%20Diagrams.md