Skip to content

Commit 23ad069

Browse files
committed
wip(docs): the flows guide states no {var} form of a condition (#19939 S7)
Claude-Session: https://claude.ai/code/session_01BRQ9Mp1yH7R1az6MaUM18H Co-authored-by: Claude <noreply@anthropic.com>
1 parent 56f393d commit 23ad069

1 file changed

Lines changed: 11 additions & 16 deletions

File tree

‎content/docs/automation/flows.mdx‎

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -630,8 +630,8 @@ later node reads `{subject}`, not `{screen_1.subject}`.
630630
}
631631
```
632632

633-
`visibleWhen` is **bare CEL over the screen's own field names** — not the `{var}`
634-
template dialect the rest of a node's `config` uses. The client re-evaluates it
633+
`visibleWhen` is **bare CEL over the screen's own field names** — never a
634+
`{{ }}` template like the screen's `title` / `description`. The client re-evaluates it
635635
as the user types, against the values collected so far, which is why it cannot
636636
be a server-interpolated template. Omit it for a field that is always visible.
637637

@@ -650,7 +650,7 @@ Two things worth knowing:
650650
the name is never bound and a downstream condition reading it aborts the run.
651651
- **A broken predicate fails open** (the field stays visible) rather than hiding
652652
an input the flow may be waiting on. `registerFlow()` does check the predicate
653-
as bare CEL — a `{var}` template or a syntax error is a loud registration
653+
as bare CEL — a `{…}` brace or a syntax error is a loud registration
654654
failure that quotes the source and locates it as
655655
`config.fields[N].visibleWhen` — but a predicate that *parses* and simply
656656
names the wrong field still shows up as a field that never hides.
@@ -2202,19 +2202,14 @@ a field access on an object variable is not one. Both reported `success`. They
22022202
are bare CEL now, so the spellings in the table above are the correct ones and
22032203
`lead_record.status == 'converted'` resolves the field.
22042204

2205-
The `{var}` form still works where a condition is a plain authored string — a
2206-
start node's `config.condition`: `{amount} > 100`, `{status} == 'active'`. The
2207-
two ways it used to answer `false` without saying so are now **loud errors**
2208-
naming the reference: a `{…}` hole that matches no flow variable, and a
2209-
substituted value that is neither a boolean, a number, nor part of a comparison
2210-
(#4336).
2211-
2212-
**A decision's `conditions[].expression` is the exception — it is always CEL.**
2213-
The slot is declared bare CEL and is on the expression ledger as a predicate
2214-
(#4439), so a braced spelling there is not the `{var}` dialect but a build
2215-
failure: `os build` and `registerFlow` reject it, naming
2216-
`config.conditions[N].expression`. That is deliberate — the alternative is a
2217-
build that refuses what run time would happily execute.
2205+
**There is no `{var}` form of a condition.** Every condition is bare CEL — a
2206+
start node's `config.condition`, an edge's `condition`, a decision's
2207+
`conditions[].expression`, a screen field's `visibleWhen` — so a braced
2208+
spelling (`{amount} > 100`) is a build failure: `os build` and `registerFlow`
2209+
reject it, naming the slot (`config.conditions[N].expression`, …). Write
2210+
`amount > 100`, `status == 'active'`. The template path the evaluator kept for a
2211+
braced string is deleted (#19939), so a direct `evaluateCondition` call refuses
2212+
the same spelling as a CEL fault, and a `template` or `flow` envelope with it.
22182213
</Callout>
22192214

22202215
CEL conditions that fail to evaluate raise an error and stop the run — they

0 commit comments

Comments
 (0)