Loading
Upcoming Mandatory Changes to Public Key Infrastructure (PKI)Read More
Salesforce Enforces New Security Requirements in Summer 2026Read More
Agentforce and Einstein Generative AI
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Example: Send a Rich Choice Response to a Customer With a Flow

          Example: Send a Rich Choice Response to a Customer With a Flow

          In this example, you send product options using an autolaunched flow and rich choice response. You also help the agent decide whether to present text-based product options as buttons or a list.

          Required Editions

          Available in: Lightning Experience
          Available in: Enterprise, Performance, Unlimited, and Developer Editions. Required add-on licenses vary by agent type.
          User Permissions Needed
          To build and manage Service Agents:

          Manage Agentforce Service Agents AND Manage AI Agents

          OR

          Customize Application

          To open, edit, or create a flow in Flow Builder: Manage Flow

          Before you begin:

          Create Product Records

          Create a few active product records. Later, your agent uses information from these records in responses. Make sure that the agent user has access to the Product object and its fields.

          For example, you can create product records with this information:

          • Product Name: Performance Tee

            Product Description: Lightweight, moisture-wicking short-sleeve shirt designed for activity and comfort.

          • Product Name: Denim Jeans

            Product Description: Modern jeans made with stretch fabric for maximum comfort and movement.

          • Product Name: Cotton Socks

            Product Description: Durable, breathable ankle-length socks for everyday use. One size fits all.

          • Product Name: Crewneck Sweater

            Product Description: Classic, soft cotton sweater for year-round casual wear. Available in six colors.

          • Product Name: Utility Jacket

            Product Description: Water-resistant, hooded jacket with multiple pockets for practical outdoor use.

          Create a Flow

          To retrieve product records, create an autolaunched flow. Later, you create a custom agent action based on this flow. Make sure that the agent user has the Run flows permission.

          1. From Setup, in the Quick Find box, enter Flows, and then select Flows.
          2. Click New Flow and then select Autolaunched Flow (No Trigger).
          3. In Flow Builder, create a productList resource with these properties.
            1. Data Type: Record. Select Allow multiple values (collection).
            2. Object: Product
            3. Availability Outside the Flow: Available for output
          4. Create a recordId resource with these properties.
            1. Data Type: Text
            2. Availability Outside the Flow: Available for input
          5. After the Start element, click add icon and then add a Get Records element with these properties.
            1. Label: Get Products
            2. Get Records of This Object: Select the Salesforce Object data source. From the Object dropdown, select the Product object.
            3. Filter Product Records: Select the None–Get All Product Records condition requirement.
            4. How Many Records to Store: All Records
            5. How to Store Record Data: Choose fields and assign variables (advanced).
            6. Select Variable to Store Product Records: The productList resource that you created.
            7. Select Product Fields to Store in Variable: Product Name, Product Description
          6. Save and activate the flow.

          Create a Custom Agent Action

          Create a custom agent action that uses the Get Products flow as a reference action.

          1. Reference Action Type: Flow
          2. Reference Action: Get Products
          3. Agent Action Instructions: Finds and retrieves product records. For each product, retrieve its name and description. This action is for when a user asks for products.
          4. Loading Details: Getting products
          5. recordId input instructions: The single ID of the Salesforce record with the product name.
          6. productList output instructions: A list of products. Select Show in conversation.

          Create a Custom Subagent

          Create a custom subagent that sends product options.

          1. Open your Agentforce Service agent in Agentforce Builder.
          2. Create a custom subagent with these properties.
            1. Classification Description: Handles inquiries related to searching for products, including gathering user requirements and presenting product options. For example, use this subagent when the user says: "What product do you have?"
            2. Scope: My job is only to assist customers with searching for products by gathering user requirements and presenting available product options based on user requests.
            3. Instructions: Use the Get_Products action to get product options.

          Guide Agent Responses with Subagent Instructions

          Add a subagent instruction that helps the agent decide how to present text-based product options.

          1. To encourage the agent to send options as buttons, tell it to present choices. For example: Present products in a clear, organized format with details like the description. Instruct the user to choose an option to see more details.
          2. To encourage the agent to send options as a list, tell it to not present choices. For example: Present products in a clear, organized format with details like the description. Do not ask the user to select or choose a specific product.

          To test your agent, activate it and then chat with it on a connected channel.

           
          Loading
          Salesforce Help | Article