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.
A journey
Section titled “A journey”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.
kind: flowid: write.write-notedisplay_id: FLOW-WRITEcapability: writetitle: Write a notesummary: The writer types a note and saves it, or is told it is too long.subject: actor.writersteps: - write.write-note.type # the first step is where it starts - write.write-note.too-long - write.write-note.savedentries: - label: New note from: library.browse.list # a step in another flow to: write.write-note.type trigger: library.new-notekind: stepid: write.write-note.typeflow: write.write-notetitle: Type the notestep_kind: screeninterface: interface.editorcopy: title: New note actions: [Cancel] # Save is the editor's own copydoes: - Type the note and save itedges: - to: write.write-note.saved trigger: write.save sequence: write.save-note outcome: saved - to: write.write-note.too-long trigger: write.save sequence: write.save-note outcome: refused secondary: true - to: $return trigger: write.cancel secondary: truekind: stepid: write.write-note.savedflow: write.write-notetitle: Note savedstep_kind: outcomeinterface: interface.editorpresentation: toastcopy: title: Saveddata: - { entity: data.notes, access: write, state: write.note.active }A lifecycle
Section titled “A lifecycle”Note. Every lifecycle step is a state; field and value say where the state is kept.
kind: flowid: write.notedisplay_id: FLOW-NOTEcapability: writetitle: Notesummary: A note is active from the moment it is saved until its writer archives it.subject: data.notes # an entity, so a lifecyclesteps: - write.note.active - write.note.archivedkind: stepid: write.note.activeflow: write.notetitle: Activestep_kind: stateinitial: truedescription: The note shows in its writer's list.field: archived_atvalue: emptyedges: - to: write.note.archived trigger: trigger.archive-notekind: stepid: write.note.archivedflow: write.notetitle: Archivedstep_kind: statefinal: truedescription: The note leaves the list and is deleted after the retention period.field: archived_atvalue: setAn entity has no lifecycle field: its lifecycle is the flow whose subject it is. Facts a table always keeps true are invariant rules.
Links between flows
Section titled “Links between flows”Derived, never declared:
- A flow leads to every flow whose
entriescomefromone 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 nameswrite.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 |
Edges and sequences
Section titled “Edges and sequences”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.outcomewarning.
A step has no list of sequences: where a sequence starts and ends is derived from these edges.
Lifecycles
Section titled “Lifecycles”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.
Reaching every step
Section titled “Reaching every step”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.
trigger
Section titled “trigger”What causes a move. Every edge names one, and so does every sequence no edge runs. One trigger can serve several edges.
kind: triggerid: write.savedisplay_id: TRIG-SAVEcapability: write # used only heretrigger_kind: actionname: Save # a verb phrase in the person's wordsactor: actor.writerinterface: interface.editorkind: triggerid: trigger.archive-notedisplay_id: TRIG-ARCHIVEtrigger_kind: action # no capability: two capabilities use itname: Archiveactor: actor.writerinterface: interface.notes-listkind: triggerid: library.nightlydisplay_id: TRIG-NIGHTLYcapability: librarytrigger_kind: schedulename: The nightly cleanup # named as the eventschedule: Every night at 03:00 UTC| 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.