- 5 minutes to read

L2 Container Diagram Example

The L2 Container diagram zooms into a system and reveals its domain structure, integration services, databases, and message queues — including the technology choices and communication protocols.

See Example C4 Diagrams for an overview of all diagram types and when to use each.

Info

To use this example in Nodinite, copy the Mermaid markup below and follow the Creating Your First C4 Diagram import walkthrough to create a Diagram Set, import the markup, and bind nodes to your Repository. Container nodes bind to either Services or Systems — use the import wizard to choose the correct entity type for each node.

When to Use

  • Planning or reviewing a system's internal architecture
  • Communicating technology choices to technical teams
  • Identifying integration points and data flows between domains
  • Does not show code-level detail — that belongs in L3

Example: O2C Four-Domain Container View

This example uses the Order-to-Cash (O2C) demo data and reveals the four domain boundaries (Sales, Planning, Logistics, Finance) with their integration services. Beyond the standard O2C services, the diagram adds external container variants (Container_Ext, ContainerDb_Ext, ContainerQueue_Ext) and an Enterprise_Boundary to exercise all shape types available at L2. The BiRel connector between ERP and the external EDI gateway demonstrates bidirectional document exchange.

Preview Mermaid Code
C4Container title Order-to-Cash (O2C) — L2 Container Diagram Person(customer, "Customer", "Places orders and receives confirmations") Person_Ext(finance_officer, "Finance Officer", "Reviews invoices in ERP-Finance") Person_Ext(auditor, "External Auditor", "Reviews financial compliance records") Enterprise_Boundary(o2c_enterprise, "Nodinite O2C Enterprise") { Boundary(sales, "Sales", "Domain") { Container(portal, "Portal", "Customer Web App", "Receives orders and delivers confirmations to customers") Container(rcv_order, "INT1337-RCV-Order-Incoming", "Integration / JSON", "Receives inbound order from Portal. Step 0 — Milestone: Order Received from Customer") Container(snd_confirm, "INT1337-SND-Confirm-Outgoing", "Integration / CSV", "Sends order confirmation back to customer. Step 2 — Milestone: Order Confirmation Delivered") ContainerDb(order_store, "Order Store", "SQL Server", "Persists inbound order records for deduplication and retry") } Boundary(planning, "Planning", "Domain") { Container(erp, "ERP", "Enterprise Resource Planning", "Order entry, inventory management, and production scheduling") Container(ent_order, "INT1337-ENT-Order-Entry", "Integration / XML", "Creates order entry record in ERP. Step 1 — Milestone: Order Entry in ERP Finished") Container(pln_scheduled, "INT1337-PLN-Order-Scheduled", "Integration / JSON", "Publishes production schedule confirmation. Step 3 — Milestone: Production Scheduled") ContainerQueue(planning_bus, "Planning Event Bus", "Azure Service Bus", "Async event queue for production schedule notifications") } Boundary(logistics, "Logistics", "Domain") { Container(wms, "WMS", "Warehouse Management System", "Warehouse packing and delivery operations") Container(pkg_packed, "INT1337-PKG-Order-Packed", "Integration / XML", "Confirms order is packed and ready for transport. Step 4 — Milestone: Order Completed for Transport") Container(dlv_delivered, "INT1337-RCV-Order-Delivered", "Integration / PSV", "Records final delivery confirmation. Step 5 — Milestone: Order Delivered") } Boundary(finance, "Finance", "Domain") { Container(erp_finance, "ERP-Finance", "Finance Module", "Invoice generation and revenue recognition") Container(inv_invoiced, "INT1337-INV-Order-Invoiced", "Integration / JSON", "Issues final invoice upon delivery. Step 6 — Milestone: Order Invoiced") } } Container_Ext(payment_gateway, "Payment Gateway", "External REST API", "Processes customer credit card payments") ContainerDb_Ext(carrier_tracking, "Carrier Tracking DB", "External Database", "Provides real-time parcel tracking and delivery confirmation data") ContainerQueue_Ext(edi_gateway, "EDI Gateway", "External Message Queue", "B2B queue for trading partner order and invoice document exchange") Rel(customer, portal, "Places order", "HTTPS / JSON") Rel(portal, rcv_order, "Drops order file", "JSON / O2C.Order.Received/1.0") Rel(rcv_order, order_store, "Persists order for processing", "SQL") Rel(rcv_order, ent_order, "Forwards to ERP", "XML / O2C.Order.Entry/1.0") Rel(ent_order, erp, "Enters order record", "ERP API") Rel(ent_order, snd_confirm, "Triggers confirmation", "CSV") Rel(snd_confirm, portal, "Delivers confirmation", "CSV / O2C.Order.Confirmation/1.0") Rel(erp, planning_bus, "Publishes schedule event", "AMQP") Rel(planning_bus, pln_scheduled, "Delivers schedule event", "AMQP") Rel(pln_scheduled, pkg_packed, "Triggers packing", "XML / O2C.Order.Ready/1.0") Rel(pkg_packed, wms, "Updates WMS state", "WMS API") Rel(wms, dlv_delivered, "Confirms delivery", "PSV / O2C.Order.Delivered/1.0") Rel(dlv_delivered, inv_invoiced, "Triggers invoicing", "JSON") Rel(inv_invoiced, erp_finance, "Creates invoice", "JSON / O2C.Order.Invoice/1.0") Rel(finance_officer, erp_finance, "Reviews invoices", "Web") Rel(portal, payment_gateway, "Processes payment at order placement", "REST / HTTPS") Rel(wms, carrier_tracking, "Reads delivery confirmation", "REST API") BiRel(erp_finance, edi_gateway, "Exchanges invoice and order documents", "AS2") Rel(auditor, carrier_tracking, "Audits delivery records", "REST API")
C4Container
    title Order-to-Cash (O2C) — L2 Container Diagram

    Person(customer, "Customer", "Places orders and receives confirmations")
    Person_Ext(finance_officer, "Finance Officer", "Reviews invoices in ERP-Finance")
    Person_Ext(auditor, "External Auditor", "Reviews financial compliance records")

    Enterprise_Boundary(o2c_enterprise, "Nodinite O2C Enterprise") {

        Boundary(sales, "Sales", "Domain") {
            Container(portal, "Portal", "Customer Web App", "Receives orders and delivers confirmations to customers")
            Container(rcv_order, "INT1337-RCV-Order-Incoming", "Integration / JSON", "Receives inbound order from Portal. Step 0 — Milestone: Order Received from Customer")
            Container(snd_confirm, "INT1337-SND-Confirm-Outgoing", "Integration / CSV", "Sends order confirmation back to customer. Step 2 — Milestone: Order Confirmation Delivered")
            ContainerDb(order_store, "Order Store", "SQL Server", "Persists inbound order records for deduplication and retry")
        }

        Boundary(planning, "Planning", "Domain") {
            Container(erp, "ERP", "Enterprise Resource Planning", "Order entry, inventory management, and production scheduling")
            Container(ent_order, "INT1337-ENT-Order-Entry", "Integration / XML", "Creates order entry record in ERP. Step 1 — Milestone: Order Entry in ERP Finished")
            Container(pln_scheduled, "INT1337-PLN-Order-Scheduled", "Integration / JSON", "Publishes production schedule confirmation. Step 3 — Milestone: Production Scheduled")
            ContainerQueue(planning_bus, "Planning Event Bus", "Azure Service Bus", "Async event queue for production schedule notifications")
        }

        Boundary(logistics, "Logistics", "Domain") {
            Container(wms, "WMS", "Warehouse Management System", "Warehouse packing and delivery operations")
            Container(pkg_packed, "INT1337-PKG-Order-Packed", "Integration / XML", "Confirms order is packed and ready for transport. Step 4 — Milestone: Order Completed for Transport")
            Container(dlv_delivered, "INT1337-RCV-Order-Delivered", "Integration / PSV", "Records final delivery confirmation. Step 5 — Milestone: Order Delivered")
        }

        Boundary(finance, "Finance", "Domain") {
            Container(erp_finance, "ERP-Finance", "Finance Module", "Invoice generation and revenue recognition")
            Container(inv_invoiced, "INT1337-INV-Order-Invoiced", "Integration / JSON", "Issues final invoice upon delivery. Step 6 — Milestone: Order Invoiced")
        }

    }

    Container_Ext(payment_gateway, "Payment Gateway", "External REST API", "Processes customer credit card payments")
    ContainerDb_Ext(carrier_tracking, "Carrier Tracking DB", "External Database", "Provides real-time parcel tracking and delivery confirmation data")
    ContainerQueue_Ext(edi_gateway, "EDI Gateway", "External Message Queue", "B2B queue for trading partner order and invoice document exchange")

    Rel(customer, portal, "Places order", "HTTPS / JSON")
    Rel(portal, rcv_order, "Drops order file", "JSON / O2C.Order.Received/1.0")
    Rel(rcv_order, order_store, "Persists order for processing", "SQL")
    Rel(rcv_order, ent_order, "Forwards to ERP", "XML / O2C.Order.Entry/1.0")
    Rel(ent_order, erp, "Enters order record", "ERP API")
    Rel(ent_order, snd_confirm, "Triggers confirmation", "CSV")
    Rel(snd_confirm, portal, "Delivers confirmation", "CSV / O2C.Order.Confirmation/1.0")
    Rel(erp, planning_bus, "Publishes schedule event", "AMQP")
    Rel(planning_bus, pln_scheduled, "Delivers schedule event", "AMQP")
    Rel(pln_scheduled, pkg_packed, "Triggers packing", "XML / O2C.Order.Ready/1.0")
    Rel(pkg_packed, wms, "Updates WMS state", "WMS API")
    Rel(wms, dlv_delivered, "Confirms delivery", "PSV / O2C.Order.Delivered/1.0")
    Rel(dlv_delivered, inv_invoiced, "Triggers invoicing", "JSON")
    Rel(inv_invoiced, erp_finance, "Creates invoice", "JSON / O2C.Order.Invoice/1.0")
    Rel(finance_officer, erp_finance, "Reviews invoices", "Web")
    Rel(portal, payment_gateway, "Processes payment at order placement", "REST / HTTPS")
    Rel(wms, carrier_tracking, "Reads delivery confirmation", "REST API")
    BiRel(erp_finance, edi_gateway, "Exchanges invoice and order documents", "AS2")
    Rel(auditor, carrier_tracking, "Audits delivery records", "REST API")

Shape Coverage

This example exercises the following L2 shape vocabulary from the toolbox plan:

Shape used Macro Notes
Person (internal) Person Customer
Person (external) Person_Ext Finance Officer, External Auditor
Container (generic) Container Portal, ERP, WMS, ERP-Finance, integration services
Container Database ContainerDb Order Store (SQL Server)
Container Queue ContainerQueue Planning Event Bus (Azure Service Bus)
Container (external) Container_Ext Payment Gateway
Container Database (external) ContainerDb_Ext Carrier Tracking DB
Container Queue (external) ContainerQueue_Ext EDI Gateway
Generic boundary Boundary Four O2C domain boundaries
Enterprise boundary Enterprise_Boundary Wraps all O2C domains
Bidirectional connector BiRel ERP-Finance ↔ EDI Gateway document exchange

Next Step

Zoom into the Sales domain with the L3: Component Diagram Example to see its internal integration components.