Skip to content

Flows and Nodes

Randy Northrup edited this page Nov 19, 2026 · 1 revision

Flows and nodes

A flow is one job's instructions: a start node, steps, decisions, checks, the rules and gotchas that hang off them, and connections between them. Each flow is one JSON file, playbook/store/flows/<id>.json. The canvas edits it; agents read it with pb.py show and change it with pb.py put. The schema is in playbook/lib/schema.py and is strict on purpose: an unknown key is an error, so a typo can't hide as data.

Ids

The file name is the id. An id is lower-case letters and digits joined by single hyphens (x, promo-post, part-read-back), at most 64 characters. Also:

  • No Windows device names (con, nul, com1...).
  • A flow id can't be a canvas page name: home, accounts, folders, parts, history, settings, sidebar, customize, upgrade, downloads, map.
  • A part id starts with part-.

Node ids follow the same pattern and are unique within their flow.

Flow fields

Field Required Limit What it is
name yes 60, one line The flow's title
group yes one of the groups below Where it is listed
icon yes one of the icons below Its icon on the canvas
summary yes 300, one line One sentence: what this flow covers. pb.py list and the canvas show it.
order yes 0 to 999 Position in its group
origin no 4000 Where the flow came from (see Provenance)
copiedFrom no an id Set by Duplicate flow
editedAt, updatedAt no timestamp like 2026-11-09T14:02:00Z editedAt is stamped by the canvas when you change the flow's settings. updatedAt is allowed but the shipped tools don't set it.
nodes yes 1 to 60 The nodes
edges yes up to 150 The connections

Groups, in display order: Start here, Rules & QC, Platforms, Video, Art & thumbnails, Projects & promo, Jobs & inbox. Flows in Start here are entry points.

Icons: map, loop, shield, check, browser, spam, x, bluesky, threads, linkedin, facebook, instagram, reddit, article, rocket, reply, video, youtube, tiktok, music, camera, mic, palette, image, thumb, layers, banner, megaphone, box, briefcase, mask, puzzle, chat, glasses, window, gamepad, shirt, list, clock, folder, library, sparkle.

Node fields

Field Limit What it is
id an id Unique in the flow
kind one of the ten kinds Required unless the node references a part
part a part id The node follows that part (see Parts)
title 80, one line, required What the node says on the board
sub 120, one line The one-line summary ("One-line summary" on the canvas)
body 1200, no tabs The details. A line starting with - is a bullet; **bold** works on the canvas.
checks up to 12 items of 200 A checklist
folders up to 8 folder ids Shared folders this node uses
links up to 6 Each {"label": "...", "url": "https://..."} (label 80, url 500, http or https)
goto a flow id, or map Only on a goto node: the flow it opens (map is the overview page)
account an account id Only on an account node
src up to 12 lines of 300 Sources ("Sources" on the canvas)
origin 4000 Where the node came from
x, y whole numbers, multiples of 10, from -20000 to 20000 Position on the board. Required.
editedAt timestamp Stamped by the canvas when you edit the node

A node that references a part may not carry its own kind, title, sub, body, checks, goto or account: those come from the part. Its own folders and links are added to the part's.

The ten node kinds

pb.py show prints each kind with a tag; the canvas has its own label.

Kind Canvas label show tag Use it for
start Start [START] Where the flow begins. Exactly one per flow. Its summary is a good place for the precondition ("Signed in as the right account").
step Step [STEP] Something to do. Name the command with its real arguments.
decision Decision [DECIDE] A question with branches. Label each outgoing connection with the answer.
check QC check [QC] A gate before moving on: what must be true, and what evidence shows it. Put the items in checks.
rule Rule [RULE] A standing "always" or "never" that governs the step it is attached to.
tool Tool [TOOL] A script, app or site and how to use it, attached to the step that uses it.
gotcha Gotcha [GOTCHA] A known failure and its fix, attached to the step where it bites.
output Result [RESULT] The end state of a path ("Everyone answered").
goto Go to flow [GOTO] Hand over to another flow. Ends the path.
account Account [ACCOUNT] One of the accounts in the registry, shown with its platform, handle and status.

Main path and attached notes

rule, tool and gotcha are notes: they hang off a step instead of sitting on the main path. Every other kind is a main-path node.

  • Connect main-path nodes with "type": "flow" (solid arrow on the canvas).
  • Attach a note with "type": "attach" (dashed line). The canvas picks this for you when either end is a note.

pb.py show prints attached notes under their step with a +, so the agent reads the rule exactly where it applies:

[STEP] Find questions to answer | Where the app is a real answer
  - Search the subs listed in the account's notes for open questions.
  + [RULE] Read the sub's rules first | Every sub, every time
    - Self-promotion rules differ per sub: some ban links, some want a flair.

Edges

Field Required What it is
from, to yes Node ids in this flow. Not the same node.
type yes flow (main path) or attach (attached note)
label no Up to 24 characters, one line: the branch name (yes, pass, X, BLOCK)
id no If present it must be the two ids joined by > (for example cl-start>cl-read); the stored form leaves it out

The same connection can't be listed twice. pb.py show prints a labelled branch as (label). When two branches meet again, or a path loops back, show prints -> continue at: <title> (above) instead of repeating the node. Nodes that can't be reached from the start print under ## Also in this flow.

Gotos

A goto node opens another flow, so jobs chain without copying steps: a platform hub (x) branches to its reply flow (x-reply) and its post flow (x-post). In pb.py show a goto is one line ending in the target id:

(replies) [GOTO] X: replies | The reply pass -> x-reply

Rules for gotos:

  • A goto ends the path: no main-path connection may leave it (lint error goto-outgoing).
  • show never prints a goto's details, so give it none (lint warning goto-body). Put the instructions in the target flow.
  • A goto can't open its own flow, and its target must exist (dangling-ref).
  • Every flow outside Start here should be opened by at least one goto (flow-unlinked).

Provenance: origin and src

Instructions say what to do, not who said it or when. The history of a rule (the incident, the date, who asked) goes in origin (free text) and src (a list of short lines) on the flow, node, part or account. pb.py show never prints them, so they don't distract the agent; the canvas shows them collapsed under Where this came from. On the canvas you can edit a node's Sources (src); origin is set with pb.py put. Every replaced version of a document is also kept in history.

The lint rules attribution, date and owner-name push this kind of text out of the instructions.

Limits at a glance

Limit Value
Nodes per flow 60
Connections per flow 150
Flow name / summary 60 / 300
Node title / summary / details 80 / 120 / 1200
Checklist 12 items of 200
Folders per node 8
Links per node 6 (label 80, url 500)
Sources 12 lines of 300
Origin 4000
Edge label 24
Position -20000 to 20000, multiples of 10
Id 64 characters

A flow that outgrows these limits is usually doing two jobs. Split it (see pb.py split).

The stored shape

Every document is stored the same way on every OS: UTF-8, LF line endings, one-space indent, keys in a fixed order, a final newline, and nothing that says nothing (empty lists, empty summaries, empty edge labels and edge ids that only repeat from>to are dropped). python playbook/pb.py normalize --check reports a file that isn't in this form; normalize rewrites it. The canvas and pb.py put always write this form.

A small flow, as JSON

{
 "name": "Changelog post",
 "group": "Projects & promo",
 "icon": "rocket",
 "summary": "One post per release, written from the release notes.",
 "order": 3,
 "nodes": [
  {"id": "cl-start", "kind": "start", "title": "A release is tagged", "sub": "Published on GitHub", "x": 0, "y": 0},
  {"id": "cl-read", "kind": "step", "title": "Read the release notes", "sub": "Every claim comes from here",
   "body": "- `gh release view --repo acme-notes/acme-notes` prints the latest notes.\n- List the two or three changes a user would notice.",
   "x": 340, "y": 0},
  {"id": "cl-facts", "kind": "rule", "title": "Facts from the source", "sub": "Unsure? Leave it out",
   "body": "Every claim in the post traces to a line in the release notes read this session.", "x": 340, "y": 200},
  {"id": "cl-qc", "part": "part-qc-check", "x": 680, "y": 0},
  {"id": "cl-x", "kind": "goto", "title": "Post it on X", "sub": "The X originals flow", "goto": "x-post", "x": 1020, "y": 0}
 ],
 "edges": [
  {"from": "cl-start", "to": "cl-read", "type": "flow"},
  {"from": "cl-facts", "to": "cl-read", "type": "attach"},
  {"from": "cl-read", "to": "cl-qc", "type": "flow"},
  {"from": "cl-qc", "to": "cl-x", "type": "flow", "label": "pass"}
 ]
}

Saved with python playbook/pb.py put flows changelog-post changelog-post.json into the demo, it passes the schema. pb.py check -w then lists two warnings: flow-unlinked (no goto opens it yet) and flow-no-recipe (no recipe reaches it). Add a goto to it from a hub flow, or add it to a recipe, and both go away.

Lint rules

python playbook/pb.py check runs the schema and these rules over the whole playbook, plus the recipe checks and the QC selftest. Each finding prints as file: path: level [rule] message.

  • Errors make check exit 1.
  • Warnings make it exit 1 only with --strict. -w lists them; --rule NAME (repeatable) shows only one rule.
  • There is no list of accepted problems: keep the playbook at zero findings. CI runs check --strict.

Errors

Rule Means Fix
unreadable A file isn't valid JSON, or its name isn't a valid id Restore it from history (pb.py versions/restore) or git
schema A document breaks the schema: unknown key, wrong type, over a limit, a node that both references a part and sets title... The message names the field; fix it
dangling-ref A goto, folder, account or part reference points at nothing (often after a pb.py delete, which lists these references when it runs) Point it at something that exists, or remove it
start A flow has no start node, or more than one Keep exactly one start
unreachable A node can't be reached from the start through main-path connections and attached notes Connect it, or delete it with a reason
goto-outgoing A main-path connection leaves a goto A goto ends the path: make the node a step, or attach the note
recipe-file state/recipes.json isn't valid JSON or has no recipes object Fix the file
recipe-id, recipe-field, recipe-step, recipe-ref A recipe has a bad id, lacks title, when or steps, has a step without id or text or a duplicate step id, or names a flow or part that doesn't exist See Recipes
qc-filters qc/filters.json or qc/lists.json is invalid The message names the filter
qc-selftest A filter no longer catches one of its bad examples, or flags a good one See QC gate

Warnings

Rule Means Fix
attribution Text says who said it: (11-08), or the owner's name followed by a date or a quote Keep the instruction; move the rest to origin
date Text carries a calendar date: 2026-11-08, or 11-08 with a two-digit month. A range followed by a unit (10-15 minutes, 8-12 fps) is not a date. Move it to origin, unless the date is the instruction
owner-name Text names the owner by first name. The names come from the owner field of the accounts, when it is one capitalised word. Handles, paths and full names are left alone. Write "the owner"
part-copy A node repeats a part's title instead of referencing the part Use Swap part, or set "part"
unused-folder No node uses the folder Attach it to a step, or delete it with a reason
unused-part No node references the part Use it, or delete it with a reason
flow-unlinked No goto opens the flow (flows in Start here are exempt) Add a goto to it from the flow that leads there
attach-main An attached-note connection joins two main-path nodes Make it a main-path connection, or change one end to a rule, tool or gotcha
flow-to-note A main-path connection touches a rule, tool or gotcha Make it an attached note
two-way Two nodes are connected in both directions Keep one direction; use a decision for a loop
restates-title A node's details only repeat its title or summary Say something new, or leave the details empty
placeholder A node still has its placeholder title (Untitled, New step, New rule...; a start node may be called Start) Give it a real title
goto-body A goto has details or a checklist, which show never prints Move them into the target flow, or make the node a step
duplicate-name Two flows share a name Rename one
email An account record contains an email address Remove it: accounts never hold emails or secrets
recipe-step-ref A recipe step names no flow or part Add "flow" or "part" to the step
flow-no-recipe No recipe reaches the flow, directly or through gotos Add it to a recipe's flows, or a goto to it from a flow a recipe uses

The text rules (attribution, date, owner-name) read node titles, summaries, details and checklists, part text, account labels, purposes, pacing and notes, and folder labels and notes. A node that references a part is checked once, through the part.

check also counts folders whose paths don't exist on this machine and prints the number at the end of the summary line; --paths lists them. This never fails the check. ~ is expanded to your home folder, a relative path is read from the skill folder (so playbook/state/bank.tsv works from anywhere), and network paths are never probed.

Clone this wiki locally