`sf flow run test` does not return a custom error message
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Domain
- cli
Research direction
Start by reproducing the issue with sf flow run test using the linked sample metadata and JSON output, then compare the empty Message field with the custom failure message shown in Flow Test UI. The payload names no repository files or tests; done means the CLI JSON output includes the custom assertion error message.
Written by the indexing model from the issue text.
Description
Summary
If you execute a Flow Test with Salesforce CLI command sf flow run test it does not return a custom error message for a failed FlowTest, but it is displayed in the FlowTest UI
Steps To Reproduce
General Steps:
Create a Flow Test for a record triggered Flow
Create an assertion which will fail and define a custom error message in the assertion
Run the Flow Test in the UI - inspect errors with "Run Test and View Details" next to the Flow Test Table row - for the failure you will the custom error message
Run the same Flow Test from the CLI with output format JSON -> "message" will be empty
Sample Metadata to Reproduce
Clone repo https://github.com/ChristianMenzinger/flow-test-metadata
Create a new scratch org
Push all metadata to new scratch org
Open Org, Open Flow Builder for Flow "Check Escalated in Cases"
Open "View Tests"
Click chevron on the test row and select "Run Test and View Details"
Inspect the failed assertion:
The assertion failed because a condition was not met.
Condition
{!$Record.IsEscalated} Equals true
Custom failure message
Escalated was not set to true.
Condition evaluation
{!$Record.IsEscalated} (false) Equals true
Notice the custom failure message "Escalated was not set to true"
Run the same test with the CLI command:
sf flow run test -t Check_Escalated_in_Cases.Check_Escalated_in_Cases_Created_Status_is_Escalated_Escalated_is_False -r json -y
Inspect the output:
{
"status": 100,
"result": {
"summary": {
"failRate": "100%",
"failing": 1,
"hostname": "https://customization-speed-3216-dev-ed.scratch.my.salesforce.com",
"orgId": "00DKO000000NIzq2AG",
"outcome": "Failed",
"passRate": "0%",
"passing": 0,
"skipped": 0,
"testRunId": "",
"testStartTime": "2025-11-05T14:52:16.731Z",
"testsRan": 1,
"username": "[email protected]",
"commandTime": "1 ms",
"testExecutionTime": "276 ms",
"testTotalTime": "276 ms"
},
"tests": [
{
"Id": "",
"QueueItemId": "",
"StackTrace": "",
"Message": "",
"AsyncApexJobId": "",
"MethodName": "Created: Status is Escalated, Escalated is False",
"Outcome": "Fail",
"ApexClass": {
"Id": "07MKO000003z7am2AA",
"Name": "Check_Escalated_in_Cases",
"NamespacePrefix": "flowtesting"
},
"RunTime": 42,
"FullName": "flowtesting__Check_Escalated_in_Cases.Created: Status is Escalated, Escalated is False"
}
]
}
}
Notice "Message" is empty
Expected result
"Message" should display the custom error message as in the Flow Test UI
Actual result
"Message" is empty
System Information
{
"architecture": "darwin-arm64",
"cliVersion": "@salesforce/cli/2.110.22",
"nodeVersion": "node-v22.21.0",
"osVersion": "Darwin 24.6.0",
"rootPath": "/Users/christianmenzinger/.local/share/sf/client/2.110.22-7013be3",
"shell": "zsh",
"pluginVersions": [
"@oclif/plugin-autocomplete 3.2.37 (core)",
"@oclif/plugin-commands 4.1.35 (core)",
"@oclif/plugin-help 6.2.33 (core)",
"@oclif/plugin-not-found 3.2.70 (core)",
"@oclif/plugin-plugins 5.4.50 (core)",
"@oclif/plugin-search 1.2.33 (core)",
"@oclif/plugin-update 4.7.11 (core)",
"@oclif/plugin-version 2.2.34 (core)",
"@oclif/plugin-warn-if-update-available 3.1.50 (core)",
"@oclif/plugin-which 3.2.41 (core)",
"@salesforce/cli 2.110.22 (core)",
"agent 1.24.18 (core)",
"apex 3.8.3 (core)",
"api 1.3.3 (core)",
"auth 3.9.17 (core)",
"data 4.0.59 (core)",
"deploy-retrieve 3.23.8 (core)",
"flow 1.0.2 (user) published 197 days ago (Mon Apr 21 2025)",
"info 3.4.93 (core)",
"limits 3.3.67 (core)",
"marketplace 1.3.8 (core)",
"org 5.9.38 (core)",
"packaging 2.22.0 (core)",
"schema 3.3.82 (core)",
"settings 2.4.48 (core)",
"sobject 1.4.76 (core)",
"telemetry 3.6.61 (core)",
"templates 56.3.66 (core)",
"trust 3.7.113 (core)",
"user 3.6.38 (core)",
"sfdx-plugin-package-xml 0.0.0-development (link) /Users/christianmenzinger/dev/metacache/sfdx-plugin-package-xml",
"sfdx-plugin-source-read 1.5.6 (user) published 52 days ago (Sun Sep 14 2025)"
]
}
- Dominant language
- No language data
- Stars
- 571
- Forks
- 80
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 3
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing 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/cli
-
investigating validated
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
forcedotcom/cli#3657 · 2 comments ·
-
area:afdx owned by another team
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
forcedotcom/cli#3645 · 2 comments ·
-
bug investigating validated
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
forcedotcom/cli#3644 · 6 comments ·
-
area:afdx bug investigating owned by another team validated
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
forcedotcom/cli#3625 · 4 comments ·
-
area:afdx bug owned by another team
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
forcedotcom/cli#3608 · 2 comments ·
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
component/mesheryctl kind/bug language/go
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
meshery/meshery#22221 · 3 comments ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
yunaremaia/driftcheck#474 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
HigherOrderCO/Bend#1294 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
cline/cline#14809 · 2 comments ·
Maintainers usually reply within 1 day