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.
{ "ready": 3, "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", }, ],}{ "ready": 3, "kind": "step", "id": "write.write-note.type", "flow": "write.write-note", "title": "Type the note", "step_kind": "screen", "interface": "interface.editor", "copy": { "title": "New note", "actions": ["Cancel"] }, // Save is the editor's own copy "does": ["Type the note and save it"], "edges": [ { "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": true }, ],}{ "ready": 3, "kind": "step", "id": "write.write-note.saved", "flow": "write.write-note", "title": "Note saved", "step_kind": "outcome", "interface": "interface.editor", "presentation": "toast", "copy": { "title": "Saved" }, "data": [ { "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.
{ "ready": 3, "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"],}{ "ready": 3, "kind": "step", "id": "write.note.active", "flow": "write.note", "title": "Active", "step_kind": "state", "initial": true, "description": "The note shows in its writer's list.", "field": "archived_at", "value": "empty", "edges": [{ "to": "write.note.archived", "trigger": "trigger.archive-note" }]}{ "ready": 3, "kind": "step", "id": "write.note.archived", "flow": "write.note", "title": "Archived", "step_kind": "state", "final": true, "description": "The note leaves the list and is deleted after the retention period.", "field": "archived_at", "value": "set"}An 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 |
tools |
no | System ids the step reads from or acts in; each shows a badge |
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. |
system |
The app or system working while the person waits, e.g. “Checking the source”. |
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; folds into the step it leaves on the map |
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 |
handoff_mode |
no | After the person’s step: recorded (picked up later by a schedule or trigger), prompted (given to the agent directly), or either |
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.
{ "ready": 3, "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",}{ "ready": 3, "kind": "trigger", "id": "trigger.archive-note", "display_id": "TRIG-ARCHIVE", "trigger_kind": "action", // no capability: two capabilities use it "name": "Archive", "actor": "actor.writer", "interface": "interface.notes-list",}{ "ready": 3, "kind": "trigger", "id": "library.nightly", "display_id": "TRIG-NIGHTLY", "capability": "library", "trigger_kind": "schedule", "name": "The nightly cleanup", // named as the event "schedule": "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, in words |
cadence |
no | The same timing as structure; schedule triggers only (below) |
A cadence is { unit, every?, at?, day? }. unit is hour, day, week,
or month; every is a whole number of units (1 when omitted); at is a
24-hour HH:MM time, on every unit but hour; day is mon to sun on a
week, or 1 to 31 on a month (a shorter month runs on its last day). Anything
else is field.invalid, and a cadence on a trigger that is not a schedule is
trigger.cadence.
{ "schedule": "Mondays at 8am", "cadence": { "unit": "week", "day": "mon", "at": "08:00" }}The interval is every × unit: 60 minutes, 24 hours, 7 days, or one calendar
month. at and day place each run and never change the interval. The next
run is due one interval after the last run that names the trigger (or the
check-in that confirmed the schedule); the schedule shows as stale once that run
is late by more than one full interval.
One trigger per direction: “Go back” is its own trigger (edge.both-ways).
Ready Room draws an action as a solid arrow and an event, schedule, or
call as a dashed one. An unused trigger is trigger.unused.
In Ready Room
Section titled “In Ready Room”
A journey as Ready Room draws it, with the sequence on each edge that runs one.