fix(uipath-maestro-flow): run a script body against the real payload, not just a parser - #3094
fix(uipath-maestro-flow): run a script body against the real payload, not just a parser#3094rockymadden wants to merge 2 commits into
Conversation
… not just a parser
skill-flow-slack-weather-pipeline faulted with [300501] Error invoking
script task (element extractOfficeCity1). The script:
const parts = description.split(',').map(p => p.trim());
const city = parts[parts.length - 3];
against "700 Bellevue Way NE, Suite 2000, Bellevue, WA 98004" yields
"Suite 2000", not "Bellevue". The coordinate lookup it feeds then found
nothing and threw.
impl.md already told the agent to syntax-check with
`node -e "new Function(<script>)"`. Confirmed that passes this script
unchanged — the bug is invisible to a parser, and `flow validate` does not
read script bodies at all, so nothing between authoring and a live debug
run says anything.
Rule 9 extends the existing check from parse to execute, against the
payload the agent already has: the `uip is resources run` / `registry get`
call that told it the field names returns the same shape
`$vars.<nodeId>.output` carries at runtime. A hand-written stub is
explicitly ruled out — it tests the script against what you assumed the
field held, which is the thing under test.
Verified both directions on the real payload: the shipped script fails
with "No Open-Meteo coordinate mapping for city: Suite 2000" and a line
number, and `parts.length - 2` returns
{ city: 'Bellevue', latitude: 47.6101, longitude: -122.2015 }.
The Debug table gains the row that routes there: [300501] with no
`Unexpected token` is logic, not syntax.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Claude finished @rockymadden's task in 1m 55s —— View job Review of PR #3094
SummaryAdds rule 9 to the Script Node implementation doc, instructing agents to execute script bodies against the real upstream payload (not just parse them) before shipping. Also adds a Debug table row that distinguishes logic faults ( Change-by-Change Review1.
|
| Area | Status | Notes |
|---|---|---|
| Frontmatter | OK | Not changed |
| E2E Tests | OK | Docs-only change; extensive existing coverage |
| Skill Body | OK | Not changed |
| References & Assets | Medium | # comment in JS code block would error at runtime |
| Repo Hygiene | OK | Scoped change, no secrets, no cross-skill refs, all links valid |
Issues for Manual Review
None found.
Conclusion
Solid fix — the rule is well-motivated by a real production fault, the debug-table row correctly discriminates the two [300501] cases, and the prose is clear. One medium issue: the # in the JavaScript code block (line 48) needs to be // so the example actually runs. With that fixed, this looks good to merge.
The recipe and worked example belong in the tool, not the doc. `flow validate` should run the runtime engine over script bodies and `=js:` fields and warn — that catches the syntax and engine-compatibility classes automatically, for every agent, without anyone remembering a manual step. Filed separately. What survives here is the part no validator can reach: an index or key that is wrong for the real payload parses cleanly and only a run with real data exposes it. 1180 -> 416 bytes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Independent of #3091 and #3093 — different file, based on
main.Problem
skill-flow-slack-weather-pipelinefaulted with[300501] Error invoking script task (element extractOfficeCity1):Against
"700 Bellevue Way NE, Suite 2000, Bellevue, WA 98004"that is"Suite 2000", not"Bellevue". The coordinate lookup it feeds found nothing and threw.impl.mdalready told the agent to syntax-check withnode -e "new Function(<script>)". Confirmed that passes this script unchanged — the bug is invisible to a parser, andflow validatedoes not read script bodies at all. Nothing between authoring and a live debug run says a word.Fix
Rule 9 extends the existing check from parse to execute, against a payload the agent already has: the
uip is resources run/registry getcall that told it the field names returns the same shape$vars.<nodeId>.outputcarries at runtime.A hand-written stub is ruled out explicitly — it tests the script against what you assumed the field held, which is the thing under test.
Verified both directions
Against the real Slack payload:
The check reproduces the exact runtime fault at author time, with a line number and the wrong value named — and it does not fire on the corrected script, so it discriminates rather than just failing loudly.
Also
The Debug table gains the row that routes there:
[300501]with noUnexpected tokenis logic, not syntax. The existing entry only covers theUnexpected tokencase, so a logic fault currently sends you looking for an unbalanced paren.Scope
One file, docs only. All maintenance checkers clean apart from the anchor pre-existing on
main; both flavors compose.🤖 Generated with Claude Code