---
schema_version: "1"
id: 127593e4679db6aea9dacd25c4c7067e672fdbc034b259d9bc884962732dd7ce
title: Create and Configure Opportunity Custom Action
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/aslm_create_and_configure_opportunity_custom_action.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.aslm_create_and_configure_opportunity_custom_action.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 74114c8c783befa89aa999625f750d3f4b6e1aafbbf7de4f9bf4c00ba8497102
description: Build an autolaunched flow to automate Opportunity record creation. Next, convert this flow into an Agentforce action.
products:
  - Industry Solutions
  - Cross Cloud
release: "264"
---
# Create and Configure Opportunity Custom Action

Build an autolaunched flow to automate Opportunity record creation. Next, convert this flow into an Agentforce action.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col style="width:100%"></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Automotive Cloud, Communications Cloud, and Manufacturing Cloud, with Agentforce enabled. <a href="https://help.salesforce.com/s/articleView?id=xcloud.aslm_editions.htm&amp;language=en_US&amp;type=5" target="_blank">View edition availability</a>.</td></tr></tbody></table>

## Build the Opportunity Creation Flow

Follow these steps to build an autolaunched flow that creates an Opportunity record.

1. From Setup, in the Quick Find box, enter Flows, and select **Flows**.
2. Click **New Flow**.
3. Select **Autolaunched Flow (No Trigger)** and click **Create**.
4. Open the **Toolbox** (Manager tab) and create the following New Resources in the form of variables.
    
    - | Variable API Name | Data Type | Availability |
        | --- | --- | --- |
        | account\_id | Text | Available for input |
        | opportunity\_close\_date | Date/Time | Available for input |
        | opportunity\_stage | Text | Available for input |
        | opportunity\_name | Text | Available for input |
        | opportunity\_id | Text | Available for output |
5. From the canvas, add a **Create Records** element using these inputs.
    
    - Label: Create Opportunity
    - How to Set Record Fields: Select **Use separate resources, and literal values**.
    - Object: Select **Opportunity**
    - Set Field Values for the Opportunity: Map the Opportunity fields to the variables created in Step 4.
    
    | Field | Value |
    | --- | --- |
    | Account ID | account\_id |
    | Close Date | opportunity\_close\_date |
    | Stage | opportunity\_stage |
    | Name | opportunity\_name |
    | **Additional Configuration** |   |
    | Store Opportunity ID in Variable | opportunity\_id |
6. Save the flow with a distinct label. For example, Create Opportunity Flow ASLM.
7. Click **Activate**.

## Create and Configure the Custom Agent Action

Convert the New Opportunity Flow into an Agent Action for use with Agentforce.

1. From Setup, navigate to Agent Actions.
2. Click **New Agent Action**.
3. For Reference Action Type, select **Flow**.
4. In the Reference Action field, search for and select the Create New Opportunity flow you have created.
5. Ensure the Action Label is clear and user-friendly. For example, Create Opportunity.
6. Verify that the Input and Output parameters from the CReate New Opportunity flow are correctly exposed.
7. Configure the action to accept these input parameters.
    
    | Parameter Name | Data Type | Description |
    | --- | --- | --- |
    | AccountId | String/ID | 18-character Account record ID. |
    | Name | String | The name of the Opportunity. |
    | StageName | String | The specific stage name, for example, "Qualification". |
    | CloseDate | Date | The intended close date for the Opportunity. |
8. Set up the logic to insert a new Opportunity record using these input parameters.
9. Map the ID of the newly created record to the opportunityId output parameter.
    
    | Parameter Name | Data Type | Description |
    | --- | --- | --- |
    | opportunityId | String/ID | 18-character ID of the newly created Opportunity record. |
    
    ![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-asset_service_lifecycle_mgmt-264-0-0-production-enus/645b17dc-6eea-4fac-9d5c-016dea098887/images/icon_note.png)
    
    Note Save the
    
    opportunityId
    
    output — you'll need it as an input parameter when running the Create Initial Quote Revenue action later.