[BUG][code-analyzer] <Unexpected Flow Engine Failure on metadata retrieved using API v68>
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- python, typescript
- Domain
- tooling
Research direction
Run sf code-analyzer with the attached Minimal_Test.flow-meta.xml and the flow rule selector to reproduce the failure. Read code-analyzer-flow-engine/dist/python/FlowScannerCommandWrapper.js and the flow_parser.parse debug output; done means explicit elements scan successfully and per-file engine failures are surfaced during multi-file scans.
Written by the indexing model from the issue text.
Description
Have you tried to resolve this issue yourself first?
- I confirm I have gone through the above steps and still have an issue to report.
Bug Description
- Flow metadata is retrieved using API v68.0
- As per Winter'27 release, End Elements are stored in metadata now. Here.
- Metadata contains tags
- sf code analyzer execution fails with a critical warning The engine with name 'flow' threw an unexpected error: Error: ENOENT:
Output / Logs
The engine with name 'flow' threw an unexpected error: Error: ENOENT: no such file or directory, open '.../flow/flowScannerResultsFile.json'
at async open (node:internal/fs/promises:638:25)
at async Object.readFile (node:internal/fs/promises:1242:14)
at async RunTimeFlowScannerCommandWrapper.runFlowScannerRules (.../code-analyzer-flow-engine/dist/python/FlowScannerCommandWrapper.js:52:36)
...
The engine's own debug log (sfca-flow-*.log, only written when log_folder is set) shows the actual root cause:
flow_parser.parse | CRITICAL | Variable type cannot find match for elem <name> with tag ends
flow_parser.parse | CRITICAL | non-traversable element <name> in flow <path>
Steps To Reproduce
- Take a sample flow which is extracted using v68.0 API (Attached a sample)
- Run sf code-analyzer run --workspace --rule-selector flow
- crashes with UnexpectedEngineError as above.
- Delete the block and the referencing it (leave the assignment's path unconnected — functionally identical, implicit end) → scan succeeds normally
Also reproduced on a real-world flow (happy to attach if useful) with two independent paths converging on a single named End element (END_ELEMENT_2) — same crash, same fix by removing the End element.
Expected Behavior
The flow engine should be able to parse and analyze Flows containing explicit elements without crashing, and any per-file engine failure during a multi-file scan should be surfaced as a visible error/violation rather than silently dropped.
Operating System
Windows 11
Salesforce CLI Version
2.75.5
Code Analyzer Plugin (code-analyzer) Version
5.16.0
Node Version
No response
Java Version
No response
Python Version
3.12.10
Additional Context (Screenshots, Files, etc)
No response
Workaround
Extract metadata using v67.0 API
Urgency
Moderate
- Dominant language
- TypeScript
- Stars
- 240
- Forks
- 52
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 5
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from forcedotcom/code-analyzer
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
forcedotcom/code-analyzer#2094 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
forcedotcom/code-analyzer#2093 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
forcedotcom/code-analyzer#2091 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
forcedotcom/code-analyzer#2090 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
forcedotcom/code-analyzer#2097 ·
All issues in forcedotcom/code-analyzer
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
danielmiessler/LifeOS#2218 ·