Operational DNA describes what an organization is and what it does, independent of the product built on it and the technology it runs on. It is one layer, written in two vocabularies.
- Structure (
structure/v1): Domain, Entity, Attribute, Relationship. - Behaviour (
behaviour/v1): Behaviour, Action, Operation, Workflow, Condition, Policy. A behaviour document names the domain it describes and does not change that domain.
Product and Technology are the layers that follow. Their reference is not published yet. Coming soon on the docs landing says what each one is.
Every section below is generated from the core schemas and the stability ledgers. A definition added under definitions/structure or definitions/behaviour shows up on the next build.
Structure
What the organization is: vocabularies, the kinds of things in them, the facts those things hold, and the edges between them.
DomainStable
A vocabulary: the entities and relationships of one subject, versioned together. uses names other domains whose entities this one may refer to. It names a vocabulary, never an organization. Three firms in one deal share a parties vocabulary and differ by instances of organization. A domain is not a tenant and not a database. Actions, rules, effects, and workflows are not part of this schema.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
| $schema | string | — | |
| dna | "structure/v1" | yes | The structure vocabulary this document is written in. |
| id | string | yes | Stable id of this vocabulary. Other domains name it from uses. |
| name | string | yes | |
| description | string | yes | |
| uses | string[] | — | Other domains whose entities this one refers to. Each item is a domain id. An organization is an instance in a parties domain, not an entry here. |
| entities | Entity[] | — | The kinds of thing in this vocabulary. |
| relationships | Relationship[] | — | The edges between those entities, including edges into domains named by uses. |
Example
From examples/structure/domain/parties.json
{
"dna": "structure/v1",
"id": "parties",
"name": "Parties",
"description": "The vocabulary of organizations and people. Buyer, target, and advisor are instances of organization inside this one domain. The domain is the vocabulary they share. It is not any one of the firms.",
"entities": [
{
"id": "organization",
"name": "Organization",
"description": "A firm. Three instances cover the three sides of a deal.",
"attributes": [
{
"name": "legalName",
"type": "string",
"description": "The firm's legal name."
}
],
"instances": [
{
"id": "harbor-buyer",
"name": "Harbor",
"values": {
"legalName": "Harbor Holdings"
}
},
{
"id": "northline-target",
"name": "Northline",
"values": {
"legalName": "Northline Inc."
}
},
{
"id": "vale-advisors",
"name": "Vale",
"values": {
"legalName": "Vale Advisors"
}
}
]
}
]
}
Related: Entity · Attribute · Relationship
EntityStable
A kind of thing a domain knows about. It owns its attributes and its named instances. A shopper, a borrower, and an advisor are instances of person. A merchant, a processor, a lender, a buyer, a target, and an advisory firm are instances of organization. They are not separate entities, and they are not domains. A connection that carries data of its own, such as a cart line, a loan condition, a citation, or a membership, is an entity too. Actions this entity can take are behavior and are not part of this schema.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | yes | Stable id of this kind of thing. |
| name | string | yes | |
| description | string | yes | |
| attributes | Attribute[] | — | Facts each instance of this entity can hold. |
| instances | instance[] | — | Named particulars of this entity. Buyer, target, and advisor are three instances of one organization entity. |
Example
From examples/structure/entity/organization.json
{
"id": "organization",
"name": "Organization",
"description": "A firm. Buyer, target, and advisor are three instances of this one entity. They are not three entities, and they are not domains."
}
Related: Domain · Attribute · Relationship
AttributeStable
One fact an entity can hold. Money is two attributes, an amount and a currency, never one attribute with a unit folded in. A confidentiality tier is an enum. A deadline is a datetime. A state attribute names the states an entity can be in; movement between those states is behavior and is not part of this schema. A reference names the entity it points at. An enum lists its values.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | yes | camelCase. Unique among the entity's attributes. |
| type | "string" | "number" | "integer" | "boolean" | "datetime" | "enum" | "reference" | "state" | yes | What a value of this attribute is. datetime is a deadline or a moment. enum is a closed tier. state is the set of states, not the transition that moves between them. |
| description | string | — | |
| required | boolean | — | Whether a value is required. Defaults to true when omitted. |
| many | boolean | — | A list of values rather than one. |
| values | string[] | — | The closed set, present only when type is enum. |
| entity | string | — | The entity a reference points at. Present only when type is reference. |
| states | string[] | — | The states of a state attribute. Present only when type is state. |
| initial | string | — | The state a new instance starts in. One of states. |
Example
From examples/structure/attribute/deadline.json
{
"name": "due",
"description": "A deadline is a datetime."
}
Related: Domain · Entity · Relationship
RelationshipStable
A named edge between two entities, read as from, name, to. A relationship has no attributes of its own. When the connection carries data of its own — a cart line's variant and quantity, a loan condition's wording, a citation's page, a membership's role — that connection is an entity, and relationships join it to the things it connects. Two relationships may join the same pair: an order ships to an address and is billed to an address. The edge is the fact. The optional attribute names the reference attribute that stores the edge, on one end, pointing at the other.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | yes | Kebab-case. Never changes once written. |
| name | string | yes | What the edge reads as between its ends: owns, ships to, refinanced by. |
| description | string | yes | |
| from | string | yes | The entity the edge is read from. |
| to | string | yes | The entity the edge is read to. |
| cardinality | "one-to-one" | "one-to-many" | "many-to-one" | "many-to-many" | — | How many of each end. one-to-many is one from to many to. Omit it when nobody stated it. |
| attribute | string | — | The reference attribute that stores this edge. It sits on one end and points at the other. Omit it when the edge is not stored on either end. |
Example
From examples/structure/relationship/ships-to.json
{
"id": "order-ships-to-address",
"name": "ships to",
"description": "The address an order is shipped to. Billing is a second relationship from the same order entity to the same address entity."
}
Behaviour
What the organization does with that structure: actions, who performs them, the workflows that sequence them, and the policies that decide them.
BehaviourStable
What a business does with the structure one domain describes: its Actions, the Operations that say who performs them on what, the workflows that sequence those Operations, and the policies that decide them. It names its domain and never changes it, so a business can be modelled structure first and given behaviour later. A set holds at most one behaviour document per domain.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
| $schema | string | — | |
| dna | "behaviour/v1" | yes | The behaviour vocabulary this document is written in. |
| id | string | yes | Kebab-case. Unique among the documents of a set. |
| name | string | yes | |
| description | string | yes | |
| domain | string | yes | The structure domain this document describes. |
| uses | string[] | — | Other behaviour documents whose Actions this one refers to. |
| actions | Action[] | — | |
| operations | Operation[] | — | |
| workflows | Workflow[] | — | |
| policies | Policy[] | — |
Example
From examples/behaviour/behaviour/commerce.json
{
"dna": "behaviour/v1",
"id": "commerce-behaviour",
"name": "Commerce behaviour",
"description": "How an order placed from a cart is accepted, fulfilled or cancelled, against checkout v2's commerce domain.",
"domain": "commerce",
"actions": [
{
"id": "accept",
"entity": "order",
"name": "Accept",
"description": "The merchant accepts a submitted order and commits to fulfilling it.",
"transition": {
"from": [
"submitted"
],
"to": "accepted"
}
}
]
}
ActionStable
One capability of one entity: what it takes, what it returns, whether it changes anything, whether it reaches outside DNA, and the state change it makes, if any. An Action is complete enough to be a tool, so every surface that calls it (an agent, a person, an HTTP client, a test) is derived from it and none is written by hand. Its input and output fields are attributes, never states. A read-only Action has no transition.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | yes | Kebab-case. Unique among the Actions of its behaviour document. |
| entity | string | yes | The entity this is a capability of. |
| name | string | yes | |
| description | string | yes | What the Action does and when to use it. A derived tool's description is this text. |
| input | Attribute[] | — | The arguments the Action takes. |
| output | Attribute[] | — | What the Action returns. |
| readOnly | boolean | — | Changes nothing. Defaults to false. |
| external | boolean | — | Reaches outside DNA: a payment, a message, a webhook, a third party. Refused before a sandbox is claimed. Defaults to false. |
| transition | object | — | The state change the Action makes on its entity's state attribute. Without from, the Action creates an instance in to. |
Example
From examples/behaviour/action/accept.json
{
"id": "accept",
"name": "Accept",
"description": "The merchant accepts a submitted order and commits to fulfilling it."
}
Related: Behaviour · Operation · Workflow · Condition · Policy
OperationStable
One Action, performed by one actor on one target. It inherits the Action's contract. A workflow is written over Operations, so the same Action can appear in it twice with different performers.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | yes | Kebab-case. Unique among the Operations of its behaviour document. all is reserved. |
| name | string | yes | |
| description | string | yes | |
| action | string | yes | The Action performed. |
| actor | party | yes | Who performs it. |
| target | party | — | What it is performed on. Defaults to the Action's entity. |
Example
From examples/behaviour/operation/merchant-accepts.json
{
"id": "merchant-accepts",
"name": "Merchant accepts",
"description": "Juniper & Pine accepts the order."
}
WorkflowStable
A state machine over Operations. A run starts in initial. In each state, its Operations may run any number of times; only a transition moves the run, when the Operation it names completes or fails, optionally guarded by a value in that Operation's output or by the final state a sub-workflow ended in. A final state ends the run and has no transitions.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | yes | Kebab-case. Unique among the workflows of its behaviour document. all is reserved. |
| name | string | yes | |
| description | string | yes | |
| initial | string | yes | The state a run starts in. One of states. |
| states | state[] | yes |
Example
From examples/behaviour/workflow/order-lifecycle.json
{
"id": "order-lifecycle",
"name": "Order lifecycle",
"description": "From a submitted order to fulfilled or cancelled."
}
Related: Behaviour · Action · Operation · Condition · Policy
ConditionStable
A test a policy applies: one predicate, or predicates composed with allOf, anyOf and not. A predicate reads a path off one subject and compares it with a value. The grammar is closed. It has no expressions, scripts or queries, and nothing in it names a business. target is the resource acted on, actor is who is acting, context is the time and environment supplied to the evaluator, and input is the arguments the Action was called with.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
| subject | "target" | "actor" | "context" | "input" | yes | Which subject the path is read from. |
| path | string | yes | A dotted property path, such as debtToIncome or groups. |
| op | "lt" | "lte" | "gt" | "gte" | "eq" | "neq" | "in" | "notIn" | yes | The comparison. in and notIn compare against a list. |
| value | number | string | number | string[] | yes | |
| allOf | any[] | yes | |
| anyOf | any[] | yes | |
| not | any | yes |
Example
From examples/behaviour/condition/capture-above-limit.json
{
"subject": "input",
"path": "amount",
"op": "gt",
"value": 10000
}
PolicyStable
A decision about the Actions it names: allow, deny, route the work to another performer, or require someone else's approval, when its condition holds or always when it has none. A rule on an Action's input is a policy whose condition reads input, so permissions and business rules are written in one grammar.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | yes | Kebab-case. Unique among the policies of its behaviour document. |
| description | string | yes | What the policy decides and why. A refusal cites it. |
| actions | string[] | yes | The Actions it governs: in this behaviour document, or behaviour/action for one in a document this one uses. |
| when | Condition | — | When the effect applies. Without it, the effect always applies. |
| effect | object | object | yes |
Example
From examples/behaviour/policy/capture-limit.json
{
"id": "capture-limit",
"description": "A capture above 10000 is routed to an agent for review rather than performed.",
"actions": [
"capture"
]
}
Related: Behaviour · Action · Operation · Workflow · Condition