You are here:
Testing Your Flow in Test Mode (Beta)
Use Test Mode to configure, save, and run test scenarios for autolaunched and record-triggered flows. To use automated testing in Test Mode, turn on Scenario Testing Automation and add assertions to evaluate expected results automatically.
Required Editions
| View supported editions. |
Turn On Test Mode
Before you can test a flow in Test Mode, an admin turns on the beta setting for your org. Learn how in Turn On Flow Test Mode (Beta).
Build and Test Modes
For autolaunched and record-triggered flows, use the Build and Test Modes to switch between
building your flow and testing it. In Test Mode, the canvas switches to a test view, and
limited editing of the flow is available. The test configuration panel opens so that you can
provide the data and run options for a test scenario. To open or close the panel, click
in the Flow Builder toolbar. To fully edit the flow, switch to build mode.
Configure a Test Scenario
Use the test configuration panel to select a flow path, provide a triggering record or input values, and select run options. Turn on Scenario Testing Automation when you want to use isolated test data, add assertions, or control rollback behavior. Learn more in Set Up and Run a Test Scenario (Beta).
Manage Test Scenarios
View, run, and manage all the test scenarios that you saved for a flow. Learn more in Manage Test Scenarios (Beta).
Review Test Results
After you run the test scenario, the Details tab shows the run's execution path and any errors, similar to the Flow Builder debugger. For an automatically evaluated scenario (Scenario Testing Automation on), an Expected Results tab also shows, with the status of each assertion. Learn how to interpret these results in Interpret Test Scenario Results in Test Mode (Beta).
Mock Action and Subflow Outputs
You can also configure an action or subflow element to return predictable mock values instead of running its normal operation while testing. Learn more in Test a Flow with Mock Outputs (Beta).
Use Isolated Test Data
Instead of testing against live org data, use dedicated, reusable test data from an Apex class that includes a test setup method. Learn more in Test a Flow with Isolated Test Data.
Generate Test Scenarios Automatically
To increase test coverage without manually configuring each scenario for record-triggered, autolaunched, or Data Cloud-triggered flows, see Generate Test Scenarios with Agentforce for Flow.
IN THIS SECTION:
- Turn On Flow Test Mode (Beta)
Turn on flow Test Mode for your org so that users can test autolaunched and record-triggered flows in Flow Builder. - Set Up and Run a Test Scenario (Beta)
Configure test data and run options, and then run the scenario in Test Mode (beta). - Interpret Test Scenario Results in Test Mode (Beta)
In Test Mode, review the Details and Expected Results tabs after you run a test scenario, and troubleshoot failed assertions. - Test a Flow with Mock Outputs (Beta)
Use mock outputs to test autolaunched and record-triggered flows without depending on external systems. Define predictable output values for action and subflow elements so your test scenarios validate flow logic instead of live callouts or subflow execution. - Test a Flow with Isolated Test Data
Test record-triggered and autolaunched flows using dedicated, reusable test data from an Apex class that includes a test setup method. After a test scenario runs, the isolated test data rolls back like an Apex unit test, so your org's live data stays as it was. - Manage Test Scenarios (Beta)
View, run, and manage all the test scenarios that you saved for a flow.
