Skip to content

Commit 47adef2

Browse files
committed
docs(automation): a flow's record nodes treat a computed filter operand as a value, never as a query operator
The automation skill's filter-operand section and the flows page's CRUD filter paragraph state the rule from the service-automation changeset and the author's fix: make the expression evaluate to the compared value (for a record, its id), and write conditions in the filter itself. The skill's token ceiling is paid in the same file by deleting restatement: the condition-CEL item of the silently-wrong list (taught by objectstack-formula, which the skill's opening blockquote already names), a second legacy-to-CEL pointer that repeats the opening blockquote, the inline filter example repeated by the update_record example further down, and the notify row's "(inbox by default)" that the notify block's channels default restates. Claude-Session: https://claude.ai/code/session_01J8VVAmczcwpTdN2WmzM6Mo Co-authored-by: Claude <noreply@anthropic.com>
1 parent 4e0c5d3 commit 47adef2

2 files changed

Lines changed: 13 additions & 7 deletions

File tree

‎content/docs/automation/flows.mdx‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,12 @@ than guarding it to `null`. To match an empty field, write the literal `null`
431431
operator map, `{ dialect: { $eq: 'x' } }`, since an object naming a string
432432
`dialect` at an operand is read as an envelope.
433433

434+
**A computed operand is a value, never a query operator**: a string, number,
435+
bigint, boolean or date, or at an `$in` / `$nin` / `$between` comparand a list
436+
of them with no empty entry. Anything else fails the node as a guard before the
437+
query runs. Make the expression evaluate to the compared value (for a record,
438+
its `id`), and write conditions in the filter itself.
439+
434440
**Where an envelope is data, the remedy names none there.** An envelope
435441
evaluates only as the top-level value of a value slot — `fields`,
436442
`assignments`, a callee's `input` / `inputs`, a screen's `defaults`,

‎skills/objectstack-automation/SKILL.md‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ Flows are built from **built-in node types** (plugins register more):
9494
| Node | Purpose |
9595
|:-----|:--------|
9696
| `http` | Call an external HTTP API — always set `timeoutMs` (unset = no timeout). `url` and `headers` are served as written with the definition to every member who can read flows — only `signingSecret` and a start node's `secret` are withheld — so never a credential there: a credential means a declared connector called via `connector_action` |
97-
| `notify` | Send a notification through the messaging service (inbox by default) |
97+
| `notify` | Send a notification through the messaging service |
9898
| `connector_action` | Dispatch an action of a declared connector (§ *Integrations are declared, not coded*) or a plugin's. `connectorConfig.input` is a value-slot map like `subflow` `input`: `registerFlow` and `os validate` refuse a `{…}` token at `connectorConfig.input.<key>`. Once evaluated, it is judged against the action's `inputSchema` (`required`, `type`, `properties`, `items`) before dispatch: a breach fails the step `VALIDATION_ERROR` (`fault`-routable), nothing sent; `os validate` does not judge the `inputSchema` fit yet |
9999
| `script` | Call a **registered** function named by `config.function` (see *Valid-but-silently-wrong* #3) |
100100
| `screen` | Display a UI form to the user (screen flows only). `config.fields[]`: `{ name, label, type, required, options, defaultValue }`, `type` an open widget hint; `'file'` renders the upload widget and resumes with the `sys_file` id bound to `name` — a later `create_record` / `update_record` writes it into a `file` field, which claims the file: collect first, write after the last screen. `'record_link'` (never `'record'`, an object field type) takes no input — it shows the `reference` record whose id `defaultValue` evaluates to, by display name, as a link to its record page: the result screen of a flow that created records, `{ name: 'account_link', type: 'record_link', reference: 'crm_account', defaultValue: { dialect: 'cel', source: 'account.id' } }` over a `create_record` `outputVariable: 'account'`. Both keys required; `required` / `options` / `placeholder` / `min` / `max` refused; a resume value under its name refused (`400 INVALID_SCREEN_INPUT`). A completed `end` `message` is refused and a markdown link in a screen `description` renders literally. Next / Submit and "Step N of M" are not authored: the engine reads the graph when the screen pauses and serves `progress` (`nextScreen: 'none' | 'possible' | 'certain'`; `step` / `stepCount` only when every path agrees), which alone labels the button and draws the counter. A `decision`, `fault` edge, loop back, non-screen pause (`approval`, `wait`) or `subflow` after a screen answers `possible` — "Next", no count. `progress` in a node `config` is refused; never hand-roll a button label or step counter into `fields` |
@@ -195,7 +195,7 @@ type: 'text', isInput: true }, { name: 'approval_result', type: 'boolean', isOut
195195
### Filter operands (`config.filter`)
196196

197197
- **Each operand is a value slot** — a literal or a CEL envelope evaluated
198-
before the query (`filter: { id: { dialect: 'cel', source: 'record.id' } }`).
198+
before the query.
199199
A whole-string **query placeholder** (`{current_user_id}`, `{today}`,
200200
`{current_year_start}`) passes through verbatim for the query engine; a flow
201201
variable never shadows it, and only `filter` gets this hand-off.
@@ -206,6 +206,11 @@ type: 'text', isInput: true }, { name: 'approval_result', type: 'boolean', isOut
206206
literal `null`. A relation hop (`record.owner.email`) needs the start node's
207207
`config.expand` to list the field — else the fault names the missing hop, not
208208
the remedy.
209+
- **A computed operand is a value, never a query operator**: a string, number,
210+
bigint, boolean or date, or at an `$in` / `$nin` / `$between` comparand a list
211+
of them with no empty entry. Anything else fails the node as a guard before the
212+
query runs. Make the expression evaluate to the compared value (for a record,
213+
its `id`), and write conditions in the filter itself.
209214

210215
---
211216

@@ -226,7 +231,6 @@ write them right the first time:
226231
CEL refuses an absent key where the template wrote nothing, so nothing /
227232
`null` / a default is now YOUR call; `'{record.tags.0}'` → `'record.tags[0]'`;
228233
a deep path guards each step: `has(vars.source) && has(vars.source.id) ? vars.source.id : null`
229-
- dates and money: the legacy → CEL table in **objectstack-formula**
230234
- run user: `{$User.Id}` → `current_user.id`; a flow that can run without a
231235
user guards it, `current_user != null ? current_user.id : null`.
232236
`current_user` holds `id`, `positions`, `organizationId`, `isPlatformAdmin`
@@ -280,10 +284,6 @@ write them right the first time:
280284
} });
281285
```
282286

283-
4. **Conditions are bare CEL; only the stdlib (`CEL_STDLIB_FUNCTIONS`,
284-
**objectstack-formula**) is callable bare.** An unknown function (`PRIOR()`, a
285-
typo) and a `{…}`-wrapped field ref both **fail the build** — write `record.x`.
286-
287287
---
288288

289289
→ State Machines & Approvals: [references/state-machines-and-approvals.md](./references/state-machines-and-approvals.md) — its state-introspection route is `GET /api/v1/meta/object/:name/state/:field?from=:state`.

0 commit comments

Comments
 (0)