Component
Flow engine — code step runtime
What's wrong?
Code steps silently fail or throw cryptic errors when using JavaScript optional chaining (?.), which has been standard since ES2020 (Node 14+, 2020).
Description
Any code step using foo?.bar or arr?.[0] either:
- Fails silently (returns undefined where it shouldn't)
- Throws an unhelpful syntax error with no mention of optional chaining
The correct pattern is (foo || {}).bar or (arr || [])[0], but every AI coding agent (Claude, GPT, Copilot) generates ?. by default since it's been standard JS for 6 years.
Scale of impact: We had to purge ?. from 69 flows in a single session and now maintain a regression test (brittleness_regression.py) that scans all code steps for ?. usage to prevent reintroduction.
How we discovered this
Flows that worked in local Node testing broke when executed via one flow execute. Root cause was ?. in code steps. Commit 44129c2 documents the mass fix across multiple flows.
Examples
Fails:
const data = $.steps.enrichment?.output?.company;
Works (our workaround):
const data = (($.steps.enrichment || {}).output || {}).company;
Suggested fix
Either:
- Support optional chaining — upgrade the code step runtime to a modern JS engine/parser
- Clear error message — if
?. is detected, throw: "Optional chaining (?.) is not supported in code steps. Use (x || {}).y instead."
- Lint at load time —
one flow validate could flag ?. before execution
Option 1 is ideal. Option 2 would save hours of debugging. We currently handle this with option 3 via a custom script.
Source
- MDN: Optional chaining — standard since ES2020
- Our workaround:
brittleness_regression.py scans 372 code steps across 88 flows
Component
Flow engine — code step runtime
What's wrong?
Code steps silently fail or throw cryptic errors when using JavaScript optional chaining (
?.), which has been standard since ES2020 (Node 14+, 2020).Description
Any code step using
foo?.barorarr?.[0]either:The correct pattern is
(foo || {}).baror(arr || [])[0], but every AI coding agent (Claude, GPT, Copilot) generates?.by default since it's been standard JS for 6 years.Scale of impact: We had to purge
?.from 69 flows in a single session and now maintain a regression test (brittleness_regression.py) that scans all code steps for?.usage to prevent reintroduction.How we discovered this
Flows that worked in local Node testing broke when executed via
one flow execute. Root cause was?.in code steps. Commit44129c2documents the mass fix across multiple flows.Examples
Fails:
Works (our workaround):
Suggested fix
Either:
?.is detected, throw:"Optional chaining (?.) is not supported in code steps. Use (x || {}).y instead."one flow validatecould flag?.before executionOption 1 is ideal. Option 2 would save hours of debugging. We currently handle this with option 3 via a custom script.
Source
brittleness_regression.pyscans 372 code steps across 88 flows