Docs menu

Operational

What an organization is and what it does, written as structure and behaviour.

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.

Stability:Experimentalshape may change without noticeBetastabilizing; minor changes possibleStablesafe to build on; changes follow semverDeprecatedslated for removal; migrate off

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

FieldTypeRequiredDescription
$schemastring—
dna"structure/v1"yesThe structure vocabulary this document is written in.
idstringyesStable id of this vocabulary. Other domains name it from uses.
namestringyes
descriptionstringyes
usesstring[]—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.
entitiesEntity[]—The kinds of thing in this vocabulary.
relationshipsRelationship[]—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

FieldTypeRequiredDescription
idstringyesStable id of this kind of thing.
namestringyes
descriptionstringyes
attributesAttribute[]—Facts each instance of this entity can hold.
instancesinstance[]—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

FieldTypeRequiredDescription
namestringyescamelCase. Unique among the entity's attributes.
type"string" | "number" | "integer" | "boolean" | "datetime" | "enum" | "reference" | "state"yesWhat 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.
descriptionstring—
requiredboolean—Whether a value is required. Defaults to true when omitted.
manyboolean—A list of values rather than one.
valuesstring[]—The closed set, present only when type is enum.
entitystring—The entity a reference points at. Present only when type is reference.
statesstring[]—The states of a state attribute. Present only when type is state.
initialstring—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

FieldTypeRequiredDescription
idstringyesKebab-case. Never changes once written.
namestringyesWhat the edge reads as between its ends: owns, ships to, refinanced by.
descriptionstringyes
fromstringyesThe entity the edge is read from.
tostringyesThe 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.
attributestring—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."
}
        

Related: Domain · Entity · Attribute

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

FieldTypeRequiredDescription
$schemastring—
dna"behaviour/v1"yesThe behaviour vocabulary this document is written in.
idstringyesKebab-case. Unique among the documents of a set.
namestringyes
descriptionstringyes
domainstringyesThe structure domain this document describes.
usesstring[]—Other behaviour documents whose Actions this one refers to.
actionsAction[]—
operationsOperation[]—
workflowsWorkflow[]—
policiesPolicy[]—

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"
      }
    }
  ]
}
        

Related: Action · Operation · Workflow · Condition · Policy

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

FieldTypeRequiredDescription
idstringyesKebab-case. Unique among the Actions of its behaviour document.
entitystringyesThe entity this is a capability of.
namestringyes
descriptionstringyesWhat the Action does and when to use it. A derived tool's description is this text.
inputAttribute[]—The arguments the Action takes.
outputAttribute[]—What the Action returns.
readOnlyboolean—Changes nothing. Defaults to false.
externalboolean—Reaches outside DNA: a payment, a message, a webhook, a third party. Refused before a sandbox is claimed. Defaults to false.
transitionobject—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

FieldTypeRequiredDescription
idstringyesKebab-case. Unique among the Operations of its behaviour document. all is reserved.
namestringyes
descriptionstringyes
actionstringyesThe Action performed.
actorpartyyesWho performs it.
targetparty—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."
}
        

Related: Behaviour · Action · Workflow · Condition · Policy

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

FieldTypeRequiredDescription
idstringyesKebab-case. Unique among the workflows of its behaviour document. all is reserved.
namestringyes
descriptionstringyes
initialstringyesThe state a run starts in. One of states.
statesstate[]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

FieldTypeRequiredDescription
subject"target" | "actor" | "context" | "input"yesWhich subject the path is read from.
pathstringyesA dotted property path, such as debtToIncome or groups.
op"lt" | "lte" | "gt" | "gte" | "eq" | "neq" | "in" | "notIn"yesThe comparison. in and notIn compare against a list.
valuenumber | string | number | string[]yes
allOfany[]yes
anyOfany[]yes
notanyyes

Example

From examples/behaviour/condition/capture-above-limit.json

          {
  "subject": "input",
  "path": "amount",
  "op": "gt",
  "value": 10000
}
        

Related: Behaviour · Action · Operation · Workflow · Policy

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

FieldTypeRequiredDescription
idstringyesKebab-case. Unique among the policies of its behaviour document.
descriptionstringyesWhat the policy decides and why. A refusal cites it.
actionsstring[]yesThe Actions it governs: in this behaviour document, or behaviour/action for one in a document this one uses.
whenCondition—When the effect applies. Without it, the effect always applies.
effectobject | objectyes

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