Loading
システム管理者に対するフィッシング耐性MFA・全従業員ユーザーMFAの適用のお知らせ 続きを読む
Automate Your Business Processes with Salesforce Flow
Test a Flow with Mock Outputs (Beta)

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.

Required Editions

View supported editions.
User Permissions Needed
To open, edit, create, activate or deactivate a flow using all flow types, elements, and features available in Flow Builder, including Einstein and Agentforce for Flow: Manage Flow
Note
Note Mock outputs are a pilot or beta service that is subject to the Beta Services Terms at Agreements - Salesforce.com or a written Unified Pilot Agreement if executed by Customer, and applicable terms in the Product Terms Directory. Use of this pilot or beta service is at the Customer's sole discretion.

Before you configure mock outputs for a test scenario, make sure that:

  • Your flow is an autolaunched flow or a record-triggered flow.
  • Your flow contains at least one action element or subflow element.

With mock outputs, you can define what data an action or subflow element returns during a test run, without actually sending an external callout or running the referenced flow. This isolation keeps your test scenarios focused on the flow logic you're validating instead of on external dependencies. Learn more about test scenarios and assertions in Automated Flow Testing.

Examples of when to use mock outputs:

  • A flow with an action element with an HTTP callout to an external API that are rate-limited or unavailable
  • A flow with an action element that invokes an Apex method with complex dependencies
  • A flow with a subflow element that you don't want to run in the test scenario.

To use mock outputs, follow these steps.

  1. In Flow Builder, open the flow that you want to test.
  2. Click Test to open Test Mode.
  3. On the canvas, click an action element or subflow element that you want to use mock outputs for.
    The element's properties panel opens.
  4. Click the Scenario Output tab.
  5. Click Use Mock Output to enable mock output for this element.
  6. To stop using mock output for this element, click Using Mock Output.
  7. For each output, enter the mock value, or copy the value from a previous debug run in the debug history.
  8. (Optional) To test a fault or alternate path, set Path After Mock Output to the path that you want the flow to take after this element runs.
    Action element properties panel in Test Mode, with the Scenario Output tab selected and an output field showing a JSON value.
  9. Repeat these steps for each action element or subflow element that run asynchronously in this test scenario.
  10. Click Save Scenario to save your test scenario.
  11. Click Run Scenario to run the scenario.

The test scenario runs using your mock output for each element for which you enabled mock output. The flow skips the element's normal execution and uses the values that you specified. On the canvas, mocked elements show an Output Mocked badge.

Subflow element with Output Mocked badge showing
 
読み込み中
Salesforce Help | Article