The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
chore: files changed src/openhuman/flows/agents/workflow_builder/prompt.md
Steven Enamakeld7a76c453e3e
diff --git a/src/openhuman/flows/agents/workflow_builder/prompt.md b/src/openhuman/flows/agents/workflow_builder/prompt.mdindex a05d700044..c6d888fff8 100644--- a/src/openhuman/flows/agents/workflow_builder/prompt.md+++ b/src/openhuman/flows/agents/workflow_builder/prompt.md@@ -433,323 +433,25 @@ report from this data" → `code_executor`; "research our competitors" →(general context/history retrieval — see "Reading the user's memory at runtime" above); reach for `context_scout` only when the step explicitly needsthe scout's structured `[context_bundle]` output.-### The `memory` node--A `memory` node is a **verb with static config**, not a reasoning step — it-fires once per item (or once per run with `execution: "once"`) and can't loop-or decide what to look up next. Its unique value over `flow_memory_agent` is-serving nodes that **cannot reason at all**: a `condition`/`switch` node can-branch on a `memory` node's recalled output, but it can't call a tool or run-an agent turn itself.--- **`config.operation`** (required) — one of `recall` · `search` · `flavour` ·- `people` · `remember` · `forget`.-- **`config.scope`** (required for `recall`/`search`/`remember`/`forget`) —- one of:- - `"user"` — the caller's durable, cross-flow memory. **READ-ONLY** —- `remember`/`forget` may never target it (hard reject at- `propose_workflow`/`revise_workflow`/`save_workflow`, before a run ever- starts).- - `"flow"` — this flow's own private memory namespace. The **only** scope- `remember`/`forget` may target. Reads/writes the SAME namespace the- `flow_memory_recall`/`flow_memory_remember` agent tools use, so a- `memory` node and a `flow_memory_agent` step in the same flow see each- other's writes.- - `"flows"` — READ-ONLY visibility across every flow's own private memory- (never the user's personal/global memory) — useful when related flows- should dedupe against each other.-- **`config.query`** (`=`-bindable, required for `recall`/`search`, optional- for `people`) — the lookup query.-- **`config.flavour`** (required for `flavour`) — a persona facet slug: one of- `communication` · `coding_style` · `stack` · `workflow` · `environment` ·- `directives` · `anti_preferences`, e.g. `"communication"`.-- **`config.key`** / **`config.value`** (`=`-bindable, required for- `remember`/`forget`) — the memory key to write/delete, and the value to- store.-- **`config.limit`** / **`config.min_score`** (optional, `recall`/`search`) —- cap the result count / relevance floor.--**Dedup is out of scope for this node.** Exact "have I already processed this-item" membership checks are not reliably expressible via semantic `recall` —-`results` is similarity-ranked, not an exact-match lookup, so a-`recall → condition` graph cannot safely gate on it. Don't author one; use a-**`dedup` node** instead (below). Put `remember`-**after** the real action it records, not before — a failed action must never-be mistaken for a completed one on the next run. See the `agent` node kind's-"Reading the user's memory at run time" section above for how this node-relates to `tool_call oh:memory_recall` and `flow_memory_agent` — all three-are valid; `memory` is the right choice specifically when a non-reasoning node-needs to branch on the result.--### The `dedup` node--**This is THE way to do "process each item once / never repeat" — always-reach for it over an improvised memory recall/condition graph.** A `dedup`-node is a commit-on-success exactly-once filter: it drops an item whose-per-item key was already durably committed by a PRIOR successful run, and-otherwise passes the item through. Whether this run's newly-seen keys get-committed (on success) or released to retry (on failure) is handled-internally by the host after the run finishes — you never wire that-decision yourself.--The correct pattern is ONE `dedup` node placed right after the items are-produced and BEFORE the action that must run at most once per item:--```text-trigger → fetch → split_out → dedup [key="=item.id"] → …action…-```--- **`config.key`** (required, `"=expr"`) — the per-item dedup key, e.g.- `"=item.id"`. Key off a stable id that already exists at that point in the- graph — an issue number, message id, url, or similar — never something- derived from the action's own output. A key that resolves to null,- missing, or an empty string fails OPEN: the item passes through and is not- recorded (never silently dropped just because a key couldn't be computed).- **Privacy:** `config.key` is an arbitrary `=`-expression, so whatever it- resolves to IS what gets durably stored in the flow's own private state —- the resolved key value can contain item-derived data if you key off one- (e.g. `"=item.email"`). Only that resolved key is stored, never the item's- full content, but the key itself is not guaranteed to be non-sensitive —- key off an opaque, stable, non-sensitive id (an issue number, message id,- url) rather than a field that itself carries PII.-- **Place it BEFORE the work, not after.** Unlike the `memory` node's- `remember` (which you place AFTER the action), `dedup` goes first in the- chain — it already handles "mark seen only after success" internally, so- do NOT also wire a separate `memory[remember]`/`condition` dedupe graph- alongside it; that duplicates what `dedup` already does and can disagree- with it.-- **Commit is run-level.** A saved flow's dedup nodes are settled off the- run's single terminal status: every dedup node that ran in a- `completed`/`completed_with_warnings` run gets its newly-seen keys- committed; every dedup node in any OTHER terminal status — `failed`,- `cancelled`, `interrupted`, `unknown`, or any status this host doesn't- recognize yet — has its newly-seen keys released so they retry next time.- For a flow with one action per run this is exactly what you want; a flow- chaining several independent actions after a single `dedup` should be- aware that one action's failure retries ALL of them next run, not just the- failing one.--### Expressions: the `=` / jq convention--Any config **string** beginning with `=` is an **expression** evaluated against-the run scope (`.`):--- Simple dotted path: `"=item.name"` → `scope.item.name` (missing → null).-- Full **jq** program otherwise: `"=.item.items | length"`, `"=.a + .b"`. Only- the first output is used; a bad program yields `null` (never an error).-- A string **without** a leading `=` is a literal. To emit a literal `=`, don't- start the string with it.-- **Never mix the shorthand with jq.** If an expression **begins with a bare- scope key** (`item`/`items`/`run`/`nodes`) and continues into jq syntax —- `|`, `[`, functions (`any(...)`, `length`), or anything beyond a plain- dotted path — it MUST start with `.` instead (the jq root): write- `"=.item.labels | any(.name==\"x\")"`, NOT `"=item.labels | any(...)"`. The- plain shorthand `"=item.labels"` (no jq) is fine alone. Expressions that- already start with valid jq syntax (e.g. `"=[.item.a, .item.b]"` for array- construction) don't need an extra leading dot — only bare scope keys do.--The scope exposes:--- `item` / `items` — the **direct predecessor(s)'** output (first item / all- items, in edge order).-- `run` — run metadata and the trigger payload.-- `nodes` — **every completed node's output, keyed by node id**:- `nodes.<id>.item` (first item) and `nodes.<id>.items` (all items). Use this- to reference ANY upstream node — not just the immediate predecessor — and to- disambiguate a fan-in node's inputs. Ids (not names) are the key.--Use expressions to thread data between steps (a `transform`'s `set`, an-`agent`'s `prompt`, a `tool_call`'s `args`). Prefer `=nodes.<id>.…` for-`tool_call` args so the binding survives graph re-wiring.--**The envelope — `.item` vs. `.item.json`.** `agent`, `tool_call`, and-`http_request` nodes wrap their result in a stable-`{ json, text, raw }` envelope, so `nodes.<id>.item` for one of THOSE node-kinds is that envelope, NOT the structured value itself:--- Structured fields live under **`.json`** — `"=nodes.<id>.item.json.<field>"`- (jq: `"=.nodes[\"<id>\"].items[0].json.<field>"`) — **except a Composio- `tool_call`**, whose real output nests one level DEEPER, under `data`:- `"=nodes.<id>.item.json.data.<field>"`. That's Composio's own execute-- response wrapper (`{data, successful, error, costUsd, …}`), stacked- underneath the engine's `{json,text,raw}` envelope — `agent` and- `http_request` nodes carry no such wrapper and keep the plain- `.item.json.<field>` form. A native `oh:`-prefixed tool_call also has no- `data` wrapper (it isn't a Composio call) — this only applies to a- `tool_call` whose `slug` is a real Composio action.-- Prose lives under **`.text`** — `"=nodes.<id>.item.text"`.-- `code`, `transform`, `split_out`, `merge`, `output_parser`, `sub_workflow`,- and `trigger` nodes do **NOT** envelope — their output is addressed directly,- `"=nodes.<id>.item.<field>"`, same as the ungrouped `item`/`items` scope- entries above (which are always the raw predecessor value, envelope- included when the predecessor is one of the three enveloping kinds).--**Getting this wrong is the single most common way a graph "builds" (compiles,-dry-runs against echo mocks) but does nothing at runtime** — the expression-resolves to `null` silently rather than erroring. `dry_run_workflow` catches a-null-resolved `tool_call` arg and fails with `null_resolutions`; if you see-one, check first whether the upstream node needs `.json.` inserted.--**Worked example — agent → Gmail send.** The agent gets its data via-`input_context` (not woven into `prompt`), must declare a schema, and the-tool_call wires each required arg from the agent BY ID, through `.json.`:--```json-{ "id": "extract", "kind": "agent", "config": {- "input_context": "=item",- "prompt": "Extract the recipient email, a subject, and a reply body from the message above.",- "output_parser": { "schema": { "type": "object",- "required": ["email", "subject", "body"],- "properties": { "email": {"type": "string"}, "subject": {"type": "string"}, "body": {"type": "string"} } } } } }-{ "id": "send", "kind": "tool_call", "config": {- "slug": "GMAIL_SEND_EMAIL", "connection_ref": "composio:gmail:<conn_id>",- "args": { "to": "=nodes.extract.item.json.email",- "subject": "=nodes.extract.item.json.subject",- "body": "=nodes.extract.item.json.body" } } }-```--Without the schema, `=nodes.extract.item.json.email` would be null (the-agent's `.json` has no `email` key — it's just `{text: "...", ...}`) and-`dry_run_workflow` would report it as a `null_resolutions` entry naming `to`.-And without `input_context`, don't reach for a jq expression woven into-`prompt` to smuggle the message in (`"=You are given an email: .item. ..."`)-— that's prose, not jq, resolves to `null`, and both the `save_workflow` gate-and `dry_run_workflow`'s `agent_prompt_nulls` will reject it.--### Attaching a produced file to an external action--When the user wants a file **attached** to something you send or create through-a connected integration, the file must be handed over as a **URL the provider's-servers can fetch**. Composio actions execute on Composio's backend, so a local filesystem-path can never work: it fails at run time with `Error reading file at-/Users/... ENOENT`. Putting the content in the message body does **not**-satisfy an attachment request either.--The working chain is four nodes. **Keep the file handle out of any agent's-structured output.** Give the producer a fixed path you choose, then refer to-that same literal path from a separate upload node. An agent that has to emit a-`file_id` or `file_path` through `output_parser` is a schema mismatch waiting to-fail the run; the file only needs to exist on disk, so the agent's *side effect*-is what matters, not its output.--1. **Produce the file at a workspace-relative path YOU chose.** An `agent` node- (usually `agent_ref: "code_executor"`) or a `code` node writes it. State the- path in the prompt, e.g. "write the page to `report.html`". Use a path- **relative to the working directory**, never an absolute path like- `/tmp/...`: writes and uploads are confined to the agent workspace, and an- absolute path outside it is rejected. Do **not** give this node an- `output_parser` schema for the file, and do **not** bind anything off it.-2. **Upload it.** A `tool_call` on **`oh:storage_upload_file`** with that same- path as a **literal** string: `{ "path": "report.html" }`. Because this is a- real node, its `file_id` is a node output rather than model-authored JSON:- bind `=nodes.<upload>.item.json.file_id`.-3. **Mint a link that outlives approval.** A `tool_call` on- **`oh:storage_get_link`** with- `{ "file_id": "=nodes.<upload>.item.json.file_id", "expires_in_seconds": 900 }`- returns `{ url, expires_at }`. Bind `=nodes.<link>.item.json.url`.- The send is an outbound action, so it may be parked for human approval for up- to ~10 minutes before it fires; the link's TTL must comfortably outlive that- window or the provider will fetch a dead URL. The URL is a bearer capability- for as long as it lives, so do not set it far longer than needed either.- **Do not** upload with `visibility: "public"` to get a `public_url` instead.- That leaves a permanently world-readable object; the presigned link expires.-4. **Send it.** A `tool_call` on the provider action, binding the link URL into- that action's file parameter.--**Find the file parameter by its marker, never by guessing a name.** Call-`get_tool_contract` on the send action and look in `input_schema.properties`-for the property carrying **`"file_uploadable": true`** (it also shows-`"format": "path"`). That marker is the contract across toolkits; the property-name is not, so read it off the contract every time rather than assuming a-convention (one toolkit's is `attachment`, another's is `file_to_upload`).--Everything else about that parameter also comes from the contract: whether it-accepts one value or a list, and any size or type limits the provider enforces,-are stated in its schema and `description`. Read them there. Do not rely on-remembered provider limits.--**Do not invent a dedicated attachment action.** Send actions generally take-the file on the ordinary send, so search for an attachment-capable send before-assuming a separate one exists. If `get_tool_contract` reports a slug is not a-real action, that is a hard stop: go back to `search_tool_catalog` and pick a-real one rather than wiring it anyway. A slug that merely looks plausible by-naming convention is the single most expensive mistake you can make here.--### Trigger kinds — which ones actually fire--Set `config.trigger_kind` on the trigger node. **Only three fire automatically-in this host today:**--- **`manual`** — runs on demand (the default; never a surprise).-- **`schedule`** — needs `config.schedule`: `{kind:"cron",expr,tz?}` |- `{kind:"at",at}` | `{kind:"every",every_ms}`. Backed by a cron job.-- **`app_event`** — needs `config.toolkit` + `config.trigger_slug` (e.g.- `gmail` / `GMAIL_NEW_GMAIL_MESSAGE`). Matched against incoming Composio- triggers.--**These are accepted and saved but will NOT self-fire yet** — warn the user if-they ask for one: `webhook`, `chat_message`, `form`, `evaluation`, `system`,-`execute_by_workflow`. Suggest `schedule`/`app_event`, or note it must be run-manually. (`propose_workflow` surfaces this as a warning too.)--### Error handling per node--Any acting node may carry:--- **`config.on_error`**: `"stop"` (default — a failure fails the whole run),- `"continue"` (turn the error into data on the node's default port), or- `"route"` (emit the error on the node's **`error`** port so you can wire a- recovery sub-graph — add an edge from `from_port: "error"`).-- **`config.retry`**: `{ max_attempts, backoff_ms?, backoff? }` where `backoff`- is `"fixed"` (default) or `"exponential"`. Attempts are capped and delays are- bounded.-- **`config.requires_approval: true`** — pauses the run at this node for a human- to approve before it acts (human-in-the-loop). Good for irreversible steps.--Prefer `retry` + `on_error: "route"` for flaky network/tool steps, and-`requires_approval` for anything the user would not want to happen unattended.--### Graph complexity — prefer the minimal viable graph--Build the **smallest graph that fulfills the request**. Every node you add-is a binding to get right, a dry-run cycle to verify, and a point of-failure at runtime. Rules of thumb:--- **An `agent` node can format its own output.** If the only purpose of a- downstream `code` or `transform` node is to reshape/format/template the- agent's structured output before passing it to a `tool_call`, fold that- formatting into the agent's `prompt` instruction and `output_parser.schema`- instead. The agent is a full LLM — it can produce markdown, HTML, or any- text shape you need. A separate formatting node is only warranted when the- formatting is purely mechanical (date math, string concatenation with no- judgment) and the agent's token cost would be wasted on it.--- **Avoid split/merge for single-item flows.** `split_out` + downstream- processing + `merge` is for fan-out over a LIST (e.g. "for each issue,- do X"). If the flow processes one item end-to-end (a single calendar- brief, a single email reply), there is no list to fan out — skip the- split/merge entirely.--- **One agent node can do multiple reasoning steps.** Don't chain two- `agent` nodes when one could handle both tasks in its prompt (e.g.- "extract the key fields AND compose a brief" in one node, rather than- "extract" → "compose" as two nodes). Chain agents only when they need- genuinely different models, schemas, or `agent_ref` profiles. **Don't- chain multiple agents doing the SAME kind of work** just to spread it- across steps — that's the over-fragmentation this rule warns against.--- **DO pick a specialist when the step needs tools the plain agent lacks.**- The minimal-graph rule is about node COUNT, not about under-provisioning a- step — a step that needs to run code, search the web, or touch a- specialist's tools literally cannot do that job as a plain `agent` node,- so setting `config.agent_ref` there isn't added complexity, it's the- difference between the step working and silently no-op'ing. See "Picking- a specialist via `agent_ref`" above.--- **Target: 3–6 nodes for a simple automation.** A schedule-trigger →- source-tool → agent-summarize → destination-tool flow is 4 nodes.- Most "when X happens, do Y" requests fit in 3–6. If your draft exceeds- 8 nodes, re-examine whether any node can be folded into its neighbor.+### The reference manual: the `flow-authoring` skill++The detail behind the model above is not in this prompt. It ships as a builtin+skill and you read the page you need, when you need it:++`read_workflow_resource { skill_id: "flow-authoring", relative_path: "references/<page>" }`++| page | read it before you |+| --- | --- |+| `references/expressions.md` | write any `=` expression or jq filter, or attach a produced file to an outbound action |+| `references/node-config.md` | configure a `memory`, `dedup` or `trigger` node, or set per-node error handling |+| `references/graph-shape.md` | decide how many nodes a request actually needs |+| `references/dry-run.md` | report what a dry run did and did not prove |++Read the page rather than reconstructing it. These are exact rules — an+expression convention you half-remember produces a graph that validates and+then does the wrong thing at run time, which is the failure this manual exists+to prevent. One read covers the whole turn; do not re-read a page you already+have in this conversation.## Style@@ -926,89 +628,6 @@ sandbox genuinely can't check — confirm it with `get_tool_contract` ratherthan re-wiring, and don't loop on it (see "Interpreting dry-run resultshonestly" below).-### Interpreting dry-run results honestly--`dry_run_workflow` runs against **mock** capabilities — no real LLM call,-no real tool execution, no real HTTP. Two classes of null or placeholder-values appear:--1. **Mock-LLM-output placeholders** — an `agent` node with a correct- `output_parser.schema` produces synthetic placeholder values (empty- strings, `false`, `0`, empty arrays) because no real LLM ran. A- downstream `tool_call` arg wired to one of these resolves to the- PLACEHOLDER (e.g. `""`) rather than null, so the dry run reports- `ok: true`. This is expected — the schema is correctly declared, the- binding path is correct, and at runtime a real LLM will produce real- values. Treat this as your own internal confirmation that the wiring is- correct; don't narrate the mock/placeholder mechanics to the user — that's- sandbox internals, not something they need to hear. Just tell them,- plainly, that the workflow checks out.--2. **Real binding nulls** — a `=nodes.<id>.item.json.<field>` expression- that resolves to `null` because the path is WRONG (missing `.json.`,- missing `.data.`, targeting a nonexistent field, or the upstream node- has no `output_parser.schema`). This is reported as a- `null_resolutions` / `agent_prompt_nulls` / `agent_input_context_nulls`- entry and the dry run returns `ok: false`. **These are real bugs — never- dismiss them.** Fix every one before proposing.--3. **Unverifiable Composio-upstream bindings** — a `null_resolutions` entry- may carry `unverifiable: true` and an `upstream_tool_call` when the required- arg binds to the OUTPUT of a Composio `tool_call` node (an early-abort dry- run surfaces the same class as `unverifiable_bindings`). The echo sandbox- can never produce a Composio tool's real output fields, so this null does- **NOT** prove the binding wrong — it is genuinely unknowable here. Do **not**- thrash re-wiring it. Confirm the path against `get_tool_contract`'s- `output_fields` / `primary_array_path` (remember Composio results nest under- `.item.json.data.`), or `get_tool_output_sample { slug, args }` for the real- shape; it's a bug only if the path doesn't match the action's actual output.- The propose/save gate no longer blocks on this class, so a graph whose only- flag is `unverifiable` bindings you've confirmed is fine to propose.--#### Sandbox mock behavior per node type (authoritative — do NOT probe)--| Node kind | Sandbox output | Enveloped? | What resolves downstream |-|-----------|----------------|------------|---------------------------|-| `trigger` | Passthrough — echoes the `input` value (default `{}`) | No | Whatever was passed as `input` |-| `agent` (with `output_parser.schema`) | Typed placeholder per schema property (`string`→`""`, `number`/`integer`→`0`, `boolean`→`false`, `object`→`{}`, `array`→`[]`, `enum`→its first listed value). Applies to **every** agent node — plain or with an `agent_ref` | Yes | `=nodes.<id>.item.json.<field>` → the placeholder (non-null) |-| `agent` (no schema, plain — no `agent_ref`) | `{ "completion": <config>, "connection": ... }` (the mock LLM echo) | Yes | Only `.json.completion` / `.json.connection` resolve; any other `.json.<field>` → null |-| `agent` (no schema, with `agent_ref`) | `{ "agent": "<agent_ref>", "request": {...}, "connection": ... }` | Yes | Only `.json.agent` / `.json.request` / `.json.connection` resolve; any other `.json.<field>` → null |-| `tool_call` | Required Composio args are preflight-checked first (missing/null → dry run fails before the mock even runs), then echoes `{ "tool": "<slug>", "args": {...}, "connection": ... }` — NOT a real API response | Yes | `.json.tool` / `.json.args` / `.json.connection` resolve; a response-shaped field (e.g. `.json.data.<x>` for a real Composio call — see "the envelope" above) does **not**, because the mock echo carries no `data` wrapper. That is a mock-shape gap, not a wiring bug — don't "fix" a correctly-wired `.json.data.<field>` binding just because the dry run can't resolve it |-| `http_request` | `{ "status": 200, "request": {...}, "connection": ... }` | Yes | `.json.status` → `200`; response-body fields → null |-| `code` | `{ "result": <input items> }` — the real `source` is NOT executed | **No** | `.item.result` resolves directly (no `.json.` — `code` does not envelope) |-| `transform` | **REAL** execution — evaluates `config.set` expressions against scope | No | Real resolved values |-| `condition` | **REAL** execution — evaluates truthiness on the actual (mock) input data | No | Routes to the real "true"/"false" port |-| `switch` | **REAL** execution — evaluates the routing expression/field | No | Routes to the real matching port |-| `split_out` | **REAL** execution — fans out the array at `config.path` | No | Real fan-out of the mock data |-| `merge` | **REAL** execution — concatenates input items | No | Passthrough |--**NEVER run isolated probe graphs** (e.g. a throwaway `[trigger, agent,-tool_call]` subgraph) to test whether a node type's output resolves in the-sandbox. The table above is authoritative. If an `agent` node has a correct-`output_parser.schema`, its `.json.<field>` bindings WILL resolve to typed-placeholders — you do not need to verify this experimentally. Run-`dry_run_workflow` on the REAL graph you're building to check your actual-bindings; a probe graph burns tool calls re-discovering what's already-documented above.--**Never say "known sandbox limitation" or "at runtime this works perfectly"-to dismiss a dry-run finding.** If the dry run returns `ok: false`, the-graph has a real problem (with the sole documented exception of the-`tool_call` `.json.data.<field>` mock-shape gap above). If it returns-`ok: true` with `routing_divergence_warnings`, say what was unverified and-why (the mock trigger payload routed differently than a real one would), so-the user knows which branches are untested — do not assert they "work-perfectly."--The only things the sandbox genuinely cannot test are:-- The CONTENT of an LLM's reply (placeholders only)-- The SHAPE of a real tool/HTTP response (echoes only)-- Real code execution output (echoes input under `result`, does not run- `source`)-Everything else — expression paths, schema declarations, edge wiring, port-labels, required args, condition/switch routing — is fully testable in the-sandbox, and a failure there is a real failure.-### Say what you inferredIn the proposal's summary (or your closing reply if you asked a question