---
schema_version: "1"
id: 0336fa8ffb74b5e1cfea84f91e6e54ef8345c01e4326fb61cf863056bd1f0220
title: Generate Test Scenarios with Agentforce for Flow
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/automate_flow_test_generate_using_ai.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.automate_flow_test_generate_using_ai.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: d132e04c3203635ee13981a9995db41da526833000296a26b18fe797741bf6ff
description: Skip the manual setup and use Agentforce to draft your test scenarios from the command line, without opening Flow Builder. Generate comprehensive test scenarios for a record-triggered, autolaunched, or Data Cloud-triggered flow, including success, fault, and edge-case paths.
products:
  - Flow Builder
  - Salesforce Platform
release: "264"
---
# Generate Test Scenarios with Agentforce for Flow

Skip the manual setup and use Agentforce to draft your test scenarios from the command line, without opening Flow Builder. Generate comprehensive test scenarios for a record-triggered, autolaunched, or Data Cloud-triggered flow, including success, fault, and edge-case paths.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;"><a href="https://help.salesforce.com/s/articleView?id=platform.flow_ref_supported_editions.htm&amp;release=264.0.0&amp;type=5" title="Learn about the editions and user interfaces that support Flow Builder. Some Flow Builder features integrate with other Salesforce products that require additional licenses.">View supported editions.</a></td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:left;vertical-align:top;" id="d191589e59">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d191589e59 ">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:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d191589e59 ">Manage Flow</td>

          </tr>
        </tbody>
      </table>

To use Agentforce for Flow in Agentforce Vibes, you need the Agentforce Platform Developer and Admin permission set license, and the Agentforce Developer and Admin Tools permission set assigned to your user.

Before you begin, connect your AI terminal to your Salesforce org.

Creating comprehensive test scenarios for complex flows manually is time-intensive and error-prone. Agentforce for Flow Headless automatically analyzes your flow's structure, decision outcomes, and required fields to draft comprehensive test scenarios. By letting Agentforce for Flow Headless generate your test scenarios, you can:

- Ensure comprehensive coverage across success, fault, and edge-case paths.
- Reduce manual effort and potential logic gaps with pre-populated field values and precise assertions.
- Scale your testing strategy by integrating AI-generated test scenarios directly into your CI/CD pipelines.

1. In your Salesforce-connected terminal, open your AI tool.
2. Ask your AI tool to find your flow.
3. Tell your AI tool that you want to update that flow.
4. Enter this prompt.
    
    ```
    create flow tests
    ```
    
    Agentforce for Flow Headless analyzes your flow and logic branches, and returns a structured list of proposed test scenarios in your console.
5. Review the proposed test scenarios in your chat.
6. Approve the proposed test scenarios.
    
    Agentforce for Flow Headless builds the test scenarios, adds them to your flow, checks that they're valid, and runs them.
7. To review the test scenarios in Flow Builder, open the URL provided in your terminal.

#### See Also

- [Testing Your Flow in Test Mode (Beta)](https://help.salesforce.com/s/articleView?id=platform.automate_flow_test_mode.htm&release=264.0.0&type=5 "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.")
- [Automated Flow Testing](https://help.salesforce.com/s/articleView?id=platform.automate_flow_test_record_data_cloud_triggered.htm&release=264.0.0&type=5 "Understand assertions, flow versions, and test data before you set up an automated test scenario through Test Mode (beta) or for a Data Cloud-triggered flow.")