|
| 1 | +# Node Catalog |
| 2 | + |
| 3 | +Every node has a `NodeKind`. Kind-specific settings live in the node's `config` |
| 4 | +(free-form JSON, validated per kind). Ports carry the item arrays between nodes; |
| 5 | +the default port is `main`. |
| 6 | + |
| 7 | +## Trigger |
| 8 | + |
| 9 | +Exactly one per workflow — the graph's entry node. Its firing mode is a |
| 10 | +`TriggerKind` in config (`manual`, `schedule`, `webhook`, `app_event`, `form`, |
| 11 | +`execute_by_workflow`, `chat_message`, `evaluation`, `system`). The host actually |
| 12 | +fires it; tinyflows injects the trigger payload as the initial run state. |
| 13 | + |
| 14 | +| Node | Purpose | Ports / config gist | |
| 15 | +|------|---------|---------------------| |
| 16 | +| `trigger` | Entry node that starts the run | Out `main`; config `trigger_kind` | |
| 17 | + |
| 18 | +## Control-flow nodes (native) |
| 19 | + |
| 20 | +Native routing logic — no host capabilities required. |
| 21 | + |
| 22 | +| Node | Purpose | Ports / config gist | |
| 23 | +|------|---------|---------------------| |
| 24 | +| `condition` | Two-way IF branch | Out `true` / `false`; config: boolean expression | |
| 25 | +| `switch` | Multi-way branch keyed by an expression | Out one port per case (+ optional `default`); config `expression`, `cases` | |
| 26 | +| `merge` | Fan-in barrier combining multiple inputs | Waits for all wired inputs; config `mode` (e.g. `append`) | |
| 27 | +| `split_out` | Fan-out: one item per element of a list | Downstream runs per item; config `path` | |
| 28 | +| `transform` | Pure, expression-based field mapping | Config `set` (field → `=`-expression map) | |
| 29 | + |
| 30 | +## Capability-backed nodes |
| 31 | + |
| 32 | +Reach the outside world through the host-injected [capability |
| 33 | +traits](Capability-Traits). |
| 34 | + |
| 35 | +| Node | Purpose | Ports / config gist | |
| 36 | +|------|---------|---------------------| |
| 37 | +| `agent` | Runs an LLM agent turn | Sub-ports `chat_model` / `memory` / `tool` / `output_parser`; config `prompt`, `model`, … — via `LlmProvider` | |
| 38 | +| `tool_call` | Invokes one specific integration action | Config `slug`, `args` — via `ToolInvoker` | |
| 39 | +| `http_request` | Outbound HTTP request | Config `method`, `url`, `headers`, `query`, `body` — via `HttpClient` | |
| 40 | +| `code` | Runs sandboxed user code | Config `language` (`javascript`/`python`), `source` — via `CodeRunner` | |
| 41 | +| `output_parser` | Parses/validates an agent's output into a structured shape | May use `LlmProvider` for auto-fixing; can nest as a sub-agent | |
| 42 | +| `sub_workflow` | Runs another workflow as a nested sub-graph | Config `workflow_id`, `input` mapping | |
| 43 | + |
| 44 | +All 11 node kinds plus the trigger are implemented and dispatched by the engine. |
| 45 | +Per-node error handling (`on_error` stop/continue/route, `retry`, an `error` |
| 46 | +port) and approval gating (`requires_approval`) are configured through the same |
| 47 | +free-form `config`. |
| 48 | + |
| 49 | +See [`docs/03-node-catalog.md`](../blob/main/docs/03-node-catalog.md) for the full |
| 50 | +catalog, and [`docs/06-triggers.md`](../blob/main/docs/06-triggers.md) for trigger |
| 51 | +kinds. |
0 commit comments