Skip to content

Flows

A flow is how one subject moves. Its subject sets what it is:

subject The flow is a Its steps are
an actor journey what a person sees and gets
an entity lifecycle the states a record rests in

Each step lists its edges, the ways out. Every edge names a trigger, and may name the sequence it runs and which outcome leads where.

entered from Your notes · New noteSCREENType the noteCancel$returnSaveSEQUENCESave a notesavedrefusedOUTCOMENote savedERRORNote too longShorten the note

Write a note. Solid arrows are the writer’s moves. Save runs the Save a note sequence (dashed: system work), and the outcome it ends with picks the next step.

write.write-note
kind: flow
id: write.write-note
display_id: FLOW-WRITE
capability: write
title: Write a note
summary: The writer types a note and saves it, or is told it is too long.
subject: actor.writer
steps:
- write.write-note.type # the first step is where it starts
- write.write-note.too-long
- write.write-note.saved
entries:
- label: New note
from: library.browse.list # a step in another flow
to: write.write-note.type
trigger: library.new-note
STATE · INITIALActiveArchiveSTATE · FINALArchivedarchived_at: emptyarchived_at: set

Note. Every lifecycle step is a state; field and value say where the state is kept.

write.note
kind: flow
id: write.note
display_id: FLOW-NOTE
capability: write
title: Note
summary: A note is active from the moment it is saved until its writer archives it.
subject: data.notes # an entity, so a lifecycle
steps:
- write.note.active
- write.note.archived

An entity has no lifecycle field: its lifecycle is the flow whose subject it is. Facts a table always keeps true are invariant rules.

Derived, never declared:

  • A flow leads to every flow whose entries come from one of its steps. Browse notes leads to Write a note.
  • A journey moves a lifecycle when an edge of each runs the same sequence, or one of its steps names a lifecycle state in data[].state. Note saved names write.note.active, so Write a note moves Note.

Plus the common fields.

Field Req. Meaning
capability yes Owning capability (home.capability)
title yes Plain-words name
subject yes Actor id (journey) or entity id (lifecycle) (flow.subject)
steps no Ordered step ids; when omitted, derived from steps naming this flow ordered by order then id (flow.empty)
entries no [{ label, from?, to, trigger? }]: where the subject comes in
parts, part_of no Parts, over 12 steps (size.flow)
Field Req. Meaning
flow yes Its flow (step.flow)
title yes The state, named as a noun or place, not the move
step_kind yes Below (step.kind)
order no Optional integer ordering when the parent flow omits steps
owner no Actor or system id responsible for this step
edges no Every way out; a final step has none
data no [{ entity, access: read | write, state? }] (data.state)
rules no Rule ids this step applies
step_kind Use for
screen What the person sees on a UI surface (blue). A choice between options is a screen, one edge each.
state A resting, waiting, or intermediate state (blue). Required in lifecycles (initial/final mark the ends) and allowed in journeys.
task A human or agent work stage that needs no dedicated UI screen (purple).
system The app or system working while the person waits, e.g. “Checking the source” (purple).
decision A multi-destination branch or human review with two or more outcomes (amber hexagon). Set owner when a person or agent decides.
approval A multi-destination review or sign-off split (amber hexagon). For a single-destination human sign-off, use gate: human_approval on the edge instead.
outcome A positive end state or milestone result (green pill). May end the journey or lead on.
error A visible failure, hold, or negative end state the person can often recover from (red box).
action Discouraged (step.action): an action is usually an edge or a sequence, not a step.

Journey step fields: owner (actor or system), interface (a surface), presentation (screen, inline, sheet, dialog, toast, email, notification, external), platforms, roles, copy ({ title, body[], actions[], hints[] }, verbatim, with {slot} placeholders), sees and does (described, never quoted). A state step in a journey may also set description, field, and value.

Lifecycle step fields: initial, final, description, field, value. Setting initial or final on a journey step, or journey fields on a lifecycle step, is field.invalid.

Field Req. Meaning
to yes A step id, or $return for back to where the flow was entered
trigger yes A trigger record id (edge.trigger)
guard no The condition, in plain words, never a rule id
rules no Rule ids this move applies
label no The branch name, e.g. Yes and No on a decision
sequence no The sequence this move runs; renders as a shared full-size purple junction node
outcome no Which of its outcomes leads to to (edge.sequence)
gate no auto or human_approval for a single-destination human sign-off on the route
approver no Actor id who approves when gate: human_approval
channel no email, push, async, link, or handoff
to_actor no Intended actor id when handing off across a channel
platforms no Where the move exists, when it differs on purpose
roles no Who may take it
secondary no true for a rare branch, a failure, or Cancel; hidden until Less common

The edges that run one sequence are its fan-out:

  • same step, same trigger, one edge per outcome (edge.start);
  • each outcome mapped by at most one edge (field.invalid);
  • an outcome no edge maps is a sequence.outcome warning.

A step has no list of sequences: where a sequence starts and ends is derived from these edges.

A lifecycle’s edges are its transitions, each with a trigger. A journey step that changes the record names the state it leaves it in, as Note saved does above.

A flow starts at its first step, each entry’s to, and every initial state. Any step nothing reaches from those is a step.unreachable warning.

What causes a move. Every edge names one, and so does every sequence no edge runs. One trigger can serve several edges.

write.save
kind: trigger
id: write.save
display_id: TRIG-SAVE
capability: write # used only here
trigger_kind: action
name: Save # a verb phrase in the person's words
actor: actor.writer
interface: interface.editor
Field Req. Meaning
name yes The words on the edge
trigger_kind yes action, event, schedule, or call
capability no The one capability that uses it; none when shared
actor no Who acts
interface no Where it fires: the button’s surface, or the webhook operation
schedule no When a schedule trigger fires

One trigger per direction: “Go back” is its own trigger (edge.both-ways). Emergent Instruments draws an action as a solid arrow and an event, schedule, or call as a dashed one. An unused trigger is trigger.unused.

Every check is listed under Validation.