Modeling C4 relationships

Model directional C4 relationships with descriptions, technologies, protocols, interaction modes, tags, and attachment points.

AAL C4 v0.2 — Level-Aware Semantics
Getting Started
Sign in

Use C4 AI Instructions with an external AI assistant, then copy its generated AAL into a new C4 Architecture project. Inspect diagnostics and explicitly Save.

Independent project copies
Use Clone to cloud or Clone to local from a project card’s menu. The copy includes the last saved source and layout; future changes do not sync. Duplicate keeps the same location. Cloning is available only on the Projects page. At three cloud projects, delete one to make room; existing cloud projects can still be saved.

Relationships

Relationships connect two elements by their ID using the arrow operator. Relationship modes are level-independent — they may be used between Systems, Containers, or Components.

Example
MobileApp -> API "Requests services"

Relationships can include a metadata block:

Example
AccountService -> AccountRepository "Retrieves account data" {
    technology "Spring Data JPA"
    mode synchronous
}

Technology

technology specifies the implementation technology or framework. Technology is metadata, not structure — do not create semantic types for specific technologies.

Example
component PolicyRepository "Policy Repository" repository {
    technology "Spring Data JPA"
}

Here repository is the architectural role; Spring Data JPA is the implementation technology.

Protocol

protocol specifies the communication protocol. Protocol is a controlled vocabulary — it is not free text. Values are matched case-insensitively and canonicalized to lowercase. Unknown values produce a validation error with a "did you mean" suggestion.

Example
API -> IdentityProvider "Validates identity" {
    protocol oidc
}

75 protocols across 12 categories:

Web & API

http
HTTP
Hypertext Transfer Protocol — unencrypted web requests.
https
HTTPS
HTTP over TLS — encrypted web requests.
rest
REST
RESTful HTTP API using resources and verbs.
graphql
GraphQL
GraphQL query language over HTTP.
grpc
gRPC
Google RPC over HTTP/2 using Protocol Buffers.
grpc-web
gRPC-Web
gRPC accessible from browsers via HTTP/1.1 proxies.
graphql-subscription
GraphQL Subscription
GraphQL real-time subscriptions over WebSocket.
soap
SOAP
SOAP over HTTP/HTTPS with XML envelopes (WSDL).
jsonrpc
JSON-RPC
JSON Remote Procedure Call over HTTP or WebSocket.
xmlrpc
XML-RPC
XML Remote Procedure Call over HTTP.
thrift
Apache Thrift
Binary RPC with pluggable transports (Apache Thrift).
webhook
Webhook
Outbound HTTP callback delivering event notifications.
openapi
OpenAPI
API described by the OpenAPI Specification over HTTP.

Real-Time & Streaming

websocket
WebSocket
Full-duplex persistent connection over TCP.
sse
SSE
Server-Sent Events — one-way streaming over HTTP.
webrtc
WebRTC
Peer-to-peer real-time audio, video, and data.
mqtt
MQTT
Lightweight publish/subscribe for IoT and mobile.
coap
CoAP
Constrained Application Protocol for constrained IoT devices.

Messaging & Events

amqp
AMQP
Advanced Message Queuing Protocol (RabbitMQ, ActiveMQ).
jms
JMS
Java Message Service API over a broker.
stomp
STOMP
Simple Text-Oriented Messaging Protocol.
nats
NATS
High-performance messaging and streaming protocol.
kafka
Apache Kafka
Kafka wire protocol for partitioned event streams.
pulsar
Apache Pulsar
Pulsar binary protocol for pub/sub messaging.
redis-pubsub
Redis Pub/Sub
Redis publish/subscribe channel protocol.

File Transfer

ftp
FTP
File Transfer Protocol — unencrypted file exchange.
sftp
SFTP
SSH File Transfer Protocol.
ftps
FTPS
FTP over TLS/SSL.
as2
AS2
Applicability Statement 2 for B2B EDI over HTTPS.
as4
AS4
OASIS ebMS 4 profile for B2B messaging.
scp
SCP
Secure Copy Protocol over SSH.

Data & Database

jdbc
JDBC
Java Database Connectivity API.
odbc
ODBC
Open Database Connectivity API.
sql
SQL
Structured Query Language over a database wire protocol.
postgres
PostgreSQL Wire
PostgreSQL frontend/backend wire protocol.
mysql
MySQL Wire
MySQL client/server wire protocol.
mongo
MongoDB Wire
MongoDB wire protocol over TCP.
redis
RESP (Redis)
Redis Serialization Protocol (RESP).
cassandra
Cassandra Native
Cassandra native binary protocol.

Email

smtp
SMTP
Simple Mail Transfer Protocol for sending email.
imap
IMAP
Internet Message Access Protocol for reading email.
pop3
POP3
Post Office Protocol v3 for retrieving email.
ews
EWS
Exchange Web Services for Microsoft Exchange.

Identity & Security

ldap
LDAP
Lightweight Directory Access Protocol.
ldaps
LDAPS
LDAP over TLS/SSL.
oauth2
OAuth 2.0
OAuth 2.0 authorization framework.
oidc
OpenID Connect
OpenID Connect identity layer over OAuth 2.0.
saml
SAML
Security Assertion Markup Language for SSO.
kerberos
Kerberos
Kerberos network authentication protocol.
scim
SCIM
System for Cross-domain Identity Management.

AI & Agent

mcp
MCP
Model Context Protocol — tool/context exchange for AI.
a2a
A2A
Agent-to-Agent protocol for inter-agent collaboration.
lsp
LSP
Language Server Protocol for code intelligence.
openai-api
OpenAI API
OpenAI HTTP API for chat, embeddings, and assistants.
anthropic-api
Anthropic API
Anthropic HTTP API for Claude models.

Industrial & IoT

opc-ua
OPC-UA
OPC Unified Architecture for industrial automation.
modbus
Modbus
Modbus industrial communication protocol.
dds
DDS
Data Distribution Service for real-time pub/sub.
can
CAN
Controller Area Network bus protocol.
bacnet
BACnet
Building Automation and Control networking protocol.

Industry Standards

hl7
HL7
Health Level Seven messaging for healthcare.
fhir
FHIR
Fast Healthcare Interoperability Resources over REST.
fix
FIX
Financial Information eXchange protocol for trading.
swift
SWIFT
SWIFT messaging for interbank financial transactions.
iso8583
ISO 8583
ISO 8583 message standard for card payments.
edi
EDI
Electronic Data Interchange for B2B transactions.
x12
ANSI X12
ANSI X12 EDI standard for North American B2B.
edifact
EDIFACT
UN/EDIFACT EDI standard for international B2B.

Legacy & RPC

corba
CORBA
Common Object Request Broker Architecture (IIOP).
dcom
DCOM
Distributed Component Object Model.
rmi
RMI
Java Remote Method Invocation.
ejb
EJB
Enterprise JavaBeans remote invocation.

Transport

tcp
TCP
Transmission Control Protocol — reliable stream transport.
udp
UDP
User Datagram Protocol — datagram transport.
tls
TLS
Transport Layer Security encryption layer.

Interaction Mode

AAL C4 v0.2 semantic relationship mode. Mode describes architectural interaction semantics — it is independent of visual edge style and level-independent.

synchronous
SYNC
A blocking request-response interaction. The caller waits for the callee to complete.
asynchronous
ASYNC
A non-blocking interaction. The caller sends a message and continues without waiting for a response.
event
EVENT
A publish-subscribe event interaction. The producer emits an event; consumers react independently.
stream
STREAM
A continuous data stream interaction (Kafka, Kinesis, Pulsar topics).
batch
BATCH
A batch data transfer or scheduled bulk processing interaction.
file
FILE
A file-based data exchange (SFTP, shared file system, MFT).
tool
TOOL
An AI tool-call interaction where an agent invokes a tool or function (MCP, function calling).
a2a
A2A
An agent-to-agent interaction where autonomous agents collaborate, delegate, or negotiate.
realtime
RT
A continuous real-time interaction over a persistent connection (WebSocket, SSE, WebRTC).
Example
AccountService -> AccountRepository "Retrieves account data" {
    mode synchronous
}

TransactionPublisher -> EventBus "Publishes transaction event" {
    mode event
}

Tags

tags are comma-separated string labels for additional characteristics beyond the primary semantic type:

Example
container API "Customer API" api {
    tags "Cloud", "Critical", "Customer Facing"
}

Only one primary semantic type is allowed in positional shorthand. Use tags for additional characteristics.

Connector Attachment Points

Each object has four logical connection points: Top, Right, Bottom, and Left. You can reposition the endpoint of an existing connector between these attachment points.

Attachment sides are View Layout Metadata — they are NOT part of AAL. The architecture relationship (source → destination) does not change; only the visual connection side changes.

To reattach an endpoint:

  • Select a relationship on the canvas.
  • Drag the source or target endpoint to a different side of the same object.
  • Alternatively, use the Source Side and Target Side dropdowns in the Inspector.

Attachment sides are independent of edge style (Orthogonal / Curved / Straight). They persist across save/reload and are preserved in export.