|
| 1 | +--- |
| 2 | +title: "Flow Designer" |
| 3 | +description: "Authoring automation flows on the visual canvas — nodes, edges, the searchable add-node palette, the node inspector, validation, and simulation." |
| 4 | +--- |
| 5 | + |
| 6 | +# Flow Designer |
| 7 | + |
| 8 | +The **Flow Designer** is the visual editor for `flow` metadata in the console's |
| 9 | +metadata admin. It renders a flow's nodes and edges on a pan/zoom canvas so you |
| 10 | +can assemble automation — create/update records, branch on conditions, wait for |
| 11 | +events, call APIs, route for approval — without hand-editing JSON. The designer |
| 12 | +is a thin, **spec-driven** view over `flow` metadata: everything you drop on the |
| 13 | +canvas is a node in the flow's schema, so the same document runs unchanged on |
| 14 | +the automation engine. |
| 15 | + |
| 16 | +Open it from a `flow` record's **Design** tab. The **Form** tab holds the same |
| 17 | +flow as an editable tree; the two stay in sync. |
| 18 | + |
| 19 | +## The canvas |
| 20 | + |
| 21 | +Each node is a card showing its icon, label, `type`, and a one-line summary of |
| 22 | +its config. Edges are the arrows between them. |
| 23 | + |
| 24 | +| Gesture | Result | |
| 25 | +|---|---| |
| 26 | +| Click a card | Select it (opens the node inspector) | |
| 27 | +| Drag a card | Reposition it | |
| 28 | +| Hover a card → click the bottom **+** | Append a connected child node | |
| 29 | +| Zoom controls / **Fit** | Scale and re-center the graph | |
| 30 | + |
| 31 | +Structural problems (an undeclared cycle, an unreachable node) surface three |
| 32 | +ways at once: a red ring on the offending card, a badge in its corner, and an |
| 33 | +inline banner at the top-left of the canvas. Clicking a banner row selects and |
| 34 | +pans to the element it refers to. |
| 35 | + |
| 36 | +## Adding nodes — the palette |
| 37 | + |
| 38 | +The **Add node** button (top-right, edit mode only) opens the node palette: a |
| 39 | +searchable, grouped list of every node type the flow can use. |
| 40 | + |
| 41 | +### Search and keyboard |
| 42 | + |
| 43 | +Type in the box at the top to filter across **all** categories at once — the |
| 44 | +match is a case-insensitive substring test over each node's **label**, **hint**, |
| 45 | +and **type**, so `scr` finds *Screen*, `http` finds *HTTP request*, and a word |
| 46 | +that only appears in a hint (`concurrently` → *Parallel*) still surfaces the |
| 47 | +node. Clearing the box restores the full grouped list. |
| 48 | + |
| 49 | +The palette is keyboard-navigable end to end: |
| 50 | + |
| 51 | +| Key | Action | |
| 52 | +|---|---| |
| 53 | +| `↑` / `↓` | Move the highlight (wraps around) | |
| 54 | +| `Enter` | Insert the highlighted node | |
| 55 | +| `Esc` | Close the palette | |
| 56 | + |
| 57 | +The search box autofocuses when the palette opens, so you can open, type a few |
| 58 | +letters, and press `Enter` without touching the mouse. |
| 59 | + |
| 60 | +### Categories |
| 61 | + |
| 62 | +Nodes are grouped into five sections, in this order: |
| 63 | + |
| 64 | +| Category | Node types | |
| 65 | +|---|---| |
| 66 | +| **Data** | Create / Update / Get / Delete record | |
| 67 | +| **Logic** | Decision, Loop, Set variables, Parallel, Try / Catch | |
| 68 | +| **Human** | Approval, Screen | |
| 69 | +| **Integration** | HTTP request, Connector, Script | |
| 70 | +| **Flow** | Subflow, Wait, End | |
| 71 | + |
| 72 | +Section headings are localized to the active console language (e.g. *数据 / |
| 73 | +逻辑 / 人工 / 集成 / 流程* in Chinese); the underlying node types are unchanged. |
| 74 | + |
| 75 | +### Recently used |
| 76 | + |
| 77 | +When the search box is empty, a **Recently used** group tops the list with the |
| 78 | +node types you inserted most recently (up to five, most-recent first) — so the |
| 79 | +nodes you reach for repeatedly stop needing a scroll or a search. The list is |
| 80 | +per-user and, when the console is connected to a backend, syncs across devices |
| 81 | +(see [User-Scoped State Persistence](/docs/guide/user-state-persistence)); it |
| 82 | +falls back to browser-local storage when offline. Types from a plugin that was |
| 83 | +since uninstalled drop out of the list automatically. |
| 84 | + |
| 85 | +### Server-merged, plugin-extensible |
| 86 | + |
| 87 | +The palette is **server-driven**. Beyond the built-in node types, the running |
| 88 | +engine publishes its registered actions at `GET /api/v1/automation/actions`, and |
| 89 | +plugins contribute their own node types there (for example an `approval` node |
| 90 | +from an approvals plugin, or third-party `connector_action` providers). The |
| 91 | +designer overlays those descriptors onto the built-in list — adopting the |
| 92 | +engine's labels and descriptions and appending engine-only types — so the |
| 93 | +palette always matches what the connected backend actually supports. Plugin |
| 94 | +nodes are searchable exactly like built-ins, including by their registered |
| 95 | +`type`. When the endpoint is unreachable the designer falls back to its |
| 96 | +built-in defaults, so authoring still works offline. |
| 97 | + |
| 98 | +## The node inspector |
| 99 | + |
| 100 | +Selecting a node opens its inspector: **ID**, **Label**, **Node Type**, an |
| 101 | +optional **Description**, and a **Configuration** section. New nodes start with |
| 102 | +spec-valid defaults (a *Wait* node already carries a timer config, an *HTTP* |
| 103 | +node defaults to `GET`) so a freshly dropped block is never in a broken |
| 104 | +intermediate state. |
| 105 | + |
| 106 | +For node types whose engine executor publishes a `configSchema` (ADR-0018), the |
| 107 | +inspector renders a **server-driven property form** from that schema — so a |
| 108 | +plugin's node gets a real config UI without the designer hardcoding its fields. |
| 109 | + |
| 110 | +## Validate, simulate, inspect runs |
| 111 | + |
| 112 | +The toolbar toggles four side panels: |
| 113 | + |
| 114 | +| Panel | What it shows | |
| 115 | +|---|---| |
| 116 | +| **Variables** | The flow's declared variables | |
| 117 | +| **Problems** | Structural + server validation issues, each clickable to reveal on canvas | |
| 118 | +| **Debug** | A step-through **simulator** that walks the graph and highlights the active / visited nodes | |
| 119 | +| **Runs** | Execution history for the published flow, fetched from the engine | |
| 120 | + |
| 121 | +## See also |
| 122 | + |
| 123 | +- [User-Scoped State Persistence](/docs/guide/user-state-persistence) — how the |
| 124 | + "Recently used" list is stored and synced. |
| 125 | +- [Console App](/docs/guide/console) — the reference app that hosts the metadata |
| 126 | + admin and its designers. |
0 commit comments