Skip to content

Elements and Relationships

Any .yaml file in a Project folder other than project.yaml can declare Elements under people, systems, services and components, and the Relationships of each under its relationships. The same files also hold Deployment Targets and Deployments and Saved Views, so a Project can keep everything in one file or split it however it likes.

The Kitchen sink declares one of every kind of Element: a Person, an internal System with an app, a datastore and a broker Service, Components, an async Relationship through the broker, an External System, and Services outside any System:

sink/model.yaml
people:
customer:
name: Customer
description: A Person.
relationships:
- to: web
description: Uses
technology: HTTPS
systems:
shop:
name: Shop
description: An internal System with every Service type.
services:
web:
name: Web
description: An app Service.
technology: React
owner: edge
tags: [customer-facing]
links:
- label: Runbook
url: https://wiki.sink.example/runbooks/web
relationships:
- to: api
description: Calls
technology: JSON/HTTPS
api:
name: API
description: |
An app Service with Components. Its description is **Markdown**:
- `orders` takes and charges orders
- `catalogue` searches the catalog
technology: Node.js
repository: https://github.com/sink-example/api
metadata:
tier: 1
on-call: core-oncall
pci-scope: true
components:
orders:
name: Orders
technology: TypeScript module
relationships:
- to: orders-db
description: Stores orders in
technology: SQL
- to: payment-gateway
description: Charges cards through
technology: HTTPS
catalogue:
name: Catalog
technology: TypeScript module
relationships:
- to: search
description: Searches with
technology: HTTPS
orders-db:
name: Orders DB
description: A datastore Service.
type: datastore
technology: PostgreSQL
owner: data
events:
name: Events
description: A broker Service.
type: broker
technology: Kafka
owner: data
mailer:
name: Mailer
description: Subscribes to order events.
technology: Go
relationships:
- to: api
description: Emails a receipt for each order
interaction: async
via: events
channel: orders.placed
payments-provider:
name: Payments Provider
description: An External System.
external: true
owner: edge
services:
search:
name: Search
description: A Service outside any System.
technology: OpenSearch
owner: data
payment-gateway:
name: Payment Gateway
description: An External Service outside any System.
external: true
technology: Stripe API
owner: edge

A Service declared in another file joins a System with in:

sink/reporting.yaml
# A Service declared in a file of its own and placed in a System with `in`.
services:
reports:
name: Reports
description: A Service in Shop, declared outside the System's file.
technology: Python
in: shop
owner: data
relationships:
- to: orders-db
description: Reads order history from
technology: SQL

Every other .yaml file in a Project folder follows one schema. These keys declare its Elements and, under each consumer, its Relationships.

Generated from schemas/model.schema.json, which editors use for completion, validation and these descriptions on hover. In the Field column, <id> stands for a key you choose. A key that isn’t listed here is an error: unknown-field.

In the Type column:

  • id: a lowercase slug of a-z, 0-9 and - that starts with a letter or a digit (^[a-z0-9][a-z0-9-]*$).
  • reference: an id in the same Project, or a Qualified id, project:id, for something in another Project (^([a-z0-9][a-z0-9-]*:)?[a-z0-9][a-z0-9-]*$).
  • URL: a full URL with its scheme, such as https://shop.example.com.
Field Type Required Default Description
people map of id → Person Persons, keyed by id. An id is unique in the Project across all its Elements and Deployment Targets.
people.<id> Person A Person: a human or role that uses a System, such as a shopper or a support agent. A Person is only ever the consumer in a Relationship.

A Person takes only the common Element fields.

Field Type Required Default Description
systems map of id → System Systems, keyed by id, each with its Services nested under services.
systems.<id> System A System: a named grouping of Services that together deliver a business capability. Systems do not nest.
systems.<id>.external boolean false true for a System run outside the organization, such as a payment provider. Nothing inside an External System can declare Components.
systems.<id>.repository URL The full URL of the source code repository the Element is built from. Shown as a link in the viewer.
systems.<id>.services map of id → Service The Services in the System, keyed by id.

A System also takes the common Element fields.

Field Type Required Default Description
services map of id → Service Services declared at the top level, keyed by id: those outside any System, and those that join a System with in.
services.<id> Service A Service: a deployable, addressable unit of software; the thing that has a URL and a Deployment.
services.<id>.type app, datastore or broker app What the Service is; each type is drawn differently. app: an application, the usual case. datastore: a database or other store. broker: a message broker that async Relationships run through, named by their via.
services.<id>.technology string What the Service is built with, such as Go or PostgreSQL. Shown under its name.
services.<id>.repository URL The full URL of the source code repository the Element is built from. Shown as a link in the viewer.
services.<id>.external boolean false true for a Service run outside the organization, such as a payment provider’s API. An External Service can’t declare Components.
services.<id>.in id The System this Service belongs to, as an id in this Project. Only for a Service under the top-level services key, and not allowed for one nested under a System’s services. Without it, a top-level Service stands outside any System.
services.<id>.components map of id → Component The Components inside the Service, keyed by id.

A Service also takes the common Element fields.

Field Type Required Default Description
components map of id → Component Components declared at the top level, keyed by id. Each names its Service with in.
components.<id> Component A Component: a part inside a Service that is not deployed on its own.
components.<id>.technology string What the Component is built with, such as TypeScript module. Shown under its name.
components.<id>.repository URL The full URL of the source code repository the Element is built from. Shown as a link in the viewer.
components.<id>.in id The Service this Component belongs to, as an id in this Project. Required for a Component under the top-level components key, and not allowed for one nested under a Service’s components.

A Component also takes the common Element fields.

Every Person, System, Service and Component takes these fields.

Field Type Required Default Description
name string yes The Element’s display name.
description string What the Element is or does, in a sentence or two.
owner id the Project’s owner The Team that owns the Element: the id of a Team in workspace.yaml. Set it only when it differs from the Project’s; nothing is inherited from the parent Element.
tags list of string Free-form labels. A Saved View’s {tag} selector picks Elements by them.
links list of Link Links to pages about the Element, such as a runbook or a dashboard.
metadata map of key → string or number or boolean Free-form facts about the Element that the Model has no field for, such as tier: 1 or on-call: payments-oncall. Keys are labels, shown as written; values are strings, numbers or booleans. Nothing in the Model reads them: they are shown in the viewer and returned by the MCP server.
relationships list of Relationship The Relationships this Element is the consumer of: what it depends on. A Relationship is never declared under its provider.

A Relationship: a dependency of the Element it is declared under (the consumer) on the Element to names (the provider). Declare it once, under the consumer.

Field Type Required Default Description
to reference yes The provider: the Element this one depends on. An id in this Project, or project:id for an Element in another Project. It can’t be a Person, this Element itself, or an ancestor or descendant of this Element.
id id An id for the Relationship, unique among the Project’s Relationships. Needed only when several Relationships connect the same two Elements, so that a Dynamic View Step can name one.
description string What the consumer uses the provider for, as a verb phrase that reads from consumer to provider, such as Reads prices from.
technology string How the consumer reaches the provider: a protocol, a driver or a format, such as JSON/HTTPS, gRPC or SQL.
interaction sync or async sync sync: a call that waits for an answer. async: an event or message that gets no reply, such as an event through a broker or a webhook.
via reference For an async Relationship only: the broker the events travel through. A Service with type: broker, as an id in this Project or project:id. Leave it out when there is no broker, as with a webhook.
channel string For an async Relationship only: the topic or queue the events travel on, such as orders.placed.
tags list of string Free-form labels for the Relationship.

A link to a page about the thing it is declared on, such as a runbook or a dashboard.

Field Type Required Default Description
label string yes The text of the link, such as Runbook.
url URL yes The page the link opens. A full URL, such as https://wiki.example.com/runbooks/web.

Documents the beta branch at cd98671, ahead of the latest release, v1.4.0.