Configure the Agent Topic to Use Revenue Cloud Quoting

Update the Upsell and Cross-sell agent topic by adding or removing specific actions. Refine the instructions to enable the agent to use Revenue Cloud quoting capabilities.

Required Editions

Available in: Lightning Experience
Available in: Automotive Cloud, Communications Cloud, and Manufacturing Cloud, with Agentforce enabled. View edition availability.

Identify instructions by their unique identifier label found on the first line of the description. Locate this label within the Agentforce UI rather than searching for internal YAML names.

  1. Update the list of actions.
    1. Remove this agent action.
       
      - CreateSalesQuote 
      
    2. Add these agent actions.
      
      - CreateOpportunity
      - quotingAI__CreateInitialQuote
      - quotingAI__AddQuoteLineItemToQuote
      - quotingAI__ApplyDiscountToQuoteLineItem
      - quotingAI__QueryQuoteLineRecords
      - quotingAI__IdentifyObjectByName
      - quotingAI__GetProdtSellModelForPrdct
      
  2. Find the CRITICAL - Core Parameter and API Governance instruction identifier, navigate to the section about switching flows, and modify it.
    1. Find and select this set of instructions.
      
      When switching flows (e.g., Cross-Sell to Upsell, or Upsell to Cross-Sell):
      - You MUST retain and reuse the validated accountId from the previous flow
      - Clear all other flow-specific parameters (assetId, catalogId, categoryId, pricebookId, etc.)
      - DO NOT ask the user to provide the account again - it should be automatically reused
      - Simply inform: "I'll help you with [new flow type] for [Account Name]" and proceed
       
      
    2. Replace the selected set of instructions with this set.
      
      When switching flows (e.g., Cross-Sell to Upsell, or Upsell to Cross-Sell):
      - You MUST retain and reuse the validated accountId from the previous flow
      - Retain the createdOpportunityId and createdQuoteId if they exist (for quote reuse)
      - Clear only flow-specific parameters (assetId, catalogId, categoryId)
      - DO NOT ask the user to provide the account again - it should be automatically reused
      - Simply inform: "I'll help you with [new flow type] for [Account Name]" and proceed
  3. Navigate to these instruction identifiers, and delete the sets of instructions under them.
    • [FLOW] Quote - Step 1: Ask For Discount
    • [FLOW] Quote - Step 2: Create Quote & Associate
    • [FLOW] Quote - Step 3: Display & Ask to Submit (Do not delete this instruction, instead change the heading from “Step 3” to “Step 4”)
  4. Change the handoff target in these sets of instructions.
    1. Navigate to the [FLOW] Upsell - Step 4: Get & Display Products - STEP 5 instruction identifier and replace the paragraph that starts with the line “When user selects product(s):” with this set of instructions.
      When user selects product(s):
      - Capture ALL selected product IDs (single or multiple)
      - Store them as selectedProductIds array
      MANDATORY: Pass control to [FLOW] Quote - Step 1: Prepare Opportunity and Quote
      DO NOT skip any steps in the quote flow
      
    2. Navigate to the [FLOW] Cross-Sell - Step 4: Get & Display Products - STEP 5 instruction identifier and replace the paragraph that starts with the line “When user selects product(s):” with this set of instructions.
      
      When user selects product(s):
      - Capture ALL selected product IDs (single or multiple)
      - Store them as selectedProductIds array
      MANDATORY: Pass control to [FLOW] Quote - Step 1: Prepare Opportunity and Quote
      DO NOT skip any steps in the quote flow
      
    3. Navigate to the Exception: Handling Customer Preferences (Show 3) instruction identifier and replace the paragraph that starts with the line “When user selects product(s):” with this set of instructions.
      When user selects product(s):
      MANDATORY: Pass control to [FLOW] Quote - Step 1: Prepare Opportunity and Quote
      DO NOT skip any steps in the quote flow
      
    4. Navigate to the Exception: Handling "Suggest Best Option" (Show 1) - Step 4: instruction identifier and ONLY replace the paragraph that starts with the line “If user agrees to proceed:” with this set of instructions.
      If user agrees to proceed:
      - Treat this as a product selection
      - MANDATORY: Pass control to [FLOW] Quote - Step 1: Prepare Opportunity and Quote
      - DO NOT skip any steps in the quote flow
      
  5. Add these new quote flow instructions to replace the deleted quote instructions.
    1. Add this set of instructions to prepare Opportunity and Quote.
      [FLOW] Quote - Step 1: Prepare Opportunity and Quote
      
          Trigger: This instruction activates after a user has selected one or more products to quote in ANY context.
      
          PREREQUISITES:
          - You MUST have accountId (validated Account record)
          - You MUST have selectedProductIds array (one or more Product2 IDs)
          - You MUST have selectedPricebookId (Pricebook2 ID)
      
          Task 1: Create or Reuse Opportunity (SILENT - DO NOT SHOW TO USER)
      
          CRITICAL - Opportunity Reuse Logic:
          Check if upsellOpportunityId already exists in conversation context:
          
          • If upsellOpportunityId EXISTS and is not null:
            - REUSE it. Do NOT create another Opportunity.
            - Skip to Task 2.
          
          • If upsellOpportunityId DOES NOT EXIST or is null:
            - Create a new Opportunity using CreateOpportunity action:
              * AccountId = accountId from context
              * Name = "Upsell Opportunity - [current date and time in dd/MM/yyyy HH:mm:ss format]"
              * StageName = "Prospecting"
              * CloseDate = 100 days from today
            - Capture the returned Opportunity Id
            - Store it in conversation memory as upsellOpportunityId
            - Proceed to Task 2
      
          CRITICAL: DO NOT display any message to the user about Opportunity creation. This is a silent operation.
      
          Task 2: Create or Reuse Quote (SILENT - DO NOT SHOW TO USER)
      
          CRITICAL - Quote Reuse Logic:
          Check if createdQuoteId already exists in conversation context:
          
          • If createdQuoteId EXISTS and is not null:
            - REUSE it. Do NOT create another Quote.
            - Display brief message: "Adding selected product(s) to your existing quote..."
            - Skip to Task 3 (go directly to adding QLIs).
          
          • If createdQuoteId DOES NOT EXIST or is null:
            - Create a new Quote using quotingAI__CreateInitialQuote action:
              * OpportunityId = upsellOpportunityId from Task 1
              * quote name = "Upsell Quote [current date and time in dd/MM/yyyy HH:mm:ss format]"
              * PricebookId = selectedPricebookId
            - Capture the returned Quote Id
            - Store it in conversation memory as createdQuoteId
            - Display brief message: "Creating quote..."
            - Proceed to Task 3
      
          Task 3: Handoff to Add Quote Line Items
      
          Pass control to [FLOW] Quote - Step 2: Add Quote Line Items with:
          - selectedProductIds array (all products user selected)
          - createdQuoteId (quote to add items to)
             
    2. Add this set of instructions to add Quote Line Items.
      
         [FLOW] Quote - Step 2: Add Quote Line Items
      
          Trigger: This instruction activates after Opportunity and Quote are prepared.
      
          PREREQUISITES:
          - createdQuoteId exists and is valid
          - selectedProductIds array exists with one or more Product2 IDs
      
          Task 1: Initialize Tracking Variables
      
          Create these tracking variables:
          - successfulQLIs = [] (array to store successfully added QLI details)
          - failedProducts = [] (array to store products that failed with error messages)
      
          Task 2: Process Each Selected Product
      
          For EACH product in selectedProductIds array, execute the following steps sequentially:
      
          Step A: Fetch Product Selling Model
          - Call GetProdtSellModelForPrdct action with ProductId = current product ID
          - Capture productSellingModelID from response
          
          Step B: Validate Selling Model
          - If productSellingModelID is missing, null, or empty:
            * Add product to failedProducts array with error: "Product selling model not available"
            * SKIP this product (do NOT stop entire flow)
            * Continue to next product in the loop
          
          Step C: Add Quote Line Item (if selling model is valid)
          - Call AddQuoteLineItemToQuote action with:
            * ProductSellingModelID = productSellingModelID from Step A
            * QuoteId = createdQuoteId
            * Quantity = 1
            * ProductId = current product ID
          
          Step D: Handle Add Result
          - If add operation FAILED:
            * Add product to failedProducts array with the error details from action response
            * Continue to next product in the loop
          - If add operation SUCCEEDED:
            * Add product to successfulQLIs array with product name and QLI ID
            * Continue to next product in the loop
      
          Task 3: Display Summary After All Products Processed
      
          After processing ALL products in the loop:
      
          • If successfulQLIs array is NOT empty:
            Display: "Successfully added [count] quote line item(s) to the quote:"
            List each successful product name from successfulQLIs array
          
          • If failedProducts array is NOT empty:
            Display: "The following product(s) could not be added:"
            List each failed product name with its error message from failedProducts array
          
          • If BOTH arrays are empty (should not happen):
            Display: "No products were processed."
      
          Task 4: Determine Next Step
      
          • If successfulQLIs array is NOT empty (at least one QLI was added):
            - Proceed to Task 5
          
          • If successfulQLIs array is empty (all products failed):
            - Ask: "Would you like to select different products?"
            - STOP and WAIT for user response
            - Do NOT proceed to discount step
      
          Task 5: Handoff to Discount Step
      
          ONLY if at least one QLI was successfully added:
          Pass control to [FLOW] Quote - Step 3: Apply Discount to Quote Line Items
             
    3. Add this set of instructions to appply discount to Quote Line Items.
      [FLOW] Quote - Step 3: Apply Discount to Quote Line Items
      
          Trigger: This instruction activates after quote line items have been successfully added to the quote.
      
          PREREQUISITES:
          - createdQuoteId exists and is valid
          - At least one QLI has been successfully added to the quote
          - User has confirmed the discount for that quote line item
      
          Task 1: Ask User About Discount Preference (MANDATORY)
      
          FINAL ACTION IN THIS CONVERSATION TURN:
      
          Ask: "Would you like to apply a discount to the quote line items? You can choose to apply a discount to all items or specify discounts for individual items."
      
          END YOUR RESPONSE HERE. This is the last thing you do in this turn.
          - DO NOT proceed to Task 2
          - DO NOT call any actions
          - The user will provide their answer in their next message
      
          ========== CONVERSATION BOUNDARY - WAIT FOR USER INPUT ==========
      
          Task 2: Process User's Discount Preference (ONLY EXECUTES IN THE NEXT CONVERSATION TURN)
      
          When user provides their response:
      
          Option A: User wants NO discount
          - User says: "no", "no discount", "skip", "no thanks"
          - Action: Skip discount application entirely
          - Proceed directly to Task 6 (handoff to display and submit)
      
          Option B: User wants discount on ALL items
          - User says: "apply to all", "all items", "same discount for all", "discount all"
          - Action: Continue to Task 3
      
          Option C: User wants discount on SPECIFIC items
          - User says: "specific items", "individual items", "different discounts", "some items"
          - Action: Continue to Task 4
      
          Option D: User provides discount percentage immediately
          - User says: "10%", "15 percent", "give 20% off"
          - Interpret as: Apply this discount to ALL items
          - Store the percentage and continue to Task 3
      
          Task 3: Apply Discount to ALL Quote Line Items
      
          Trigger: User chose Option B or Option D above.
      
          Step 1: Get discount percentage (if not already provided)
          - If user didn't provide percentage yet, ask: "What discount percentage would you like to apply to all items? (0-100%)"
          - WAIT for user response
          - Extract percentage from user input (e.g., "10", "15%", "twenty" → parse as number)
      
          Step 2: Fetch all QLIs for this quote
          - Call QueryQuoteLineRecords action with:
            * quoteId = createdQuoteId
            * productIds = null (to get all QLIs)
          - Capture all returned QuoteLineItem IDs
      
          Step 3: Apply discount to each QLI
          - For EACH QuoteLineItem ID in the results:
            * Call ApplyDiscountToQuoteLineItem action with:
              - QuoteLineItemId = current QLI ID
              - discountPercentage = percentage from Step 1
            * Track successes and failures
      
          Step 4: Display summary
          - Show: "Applied [X]% discount to [N] quote line item(s)."
          - If any failures, list them
      
          Step 5: Skip to Task 6 (handoff to display and submit)
      
          Task 4: Apply Discount to SPECIFIC Quote Line Items
      
          Trigger: User chose Option C in Task 2.
      
          Step 1: Ask which items
          - Ask: "Which products would you like to apply a discount to? You can provide product names or say 'show all items'."
          - WAIT for user response
      
          Step 2: Handle user response
      
          Option A: User says "show all items" or "list items"
          - Call QueryQuoteLineRecords with quoteId = createdQuoteId
          - Display all QLIs with product names in a numbered list
          - Ask: "Which item(s) would you like to discount? You can provide the numbers or product names."
          - WAIT for user response
          - Proceed to Step 3
      
          Option B: User provides product name(s)
          - Extract product names from user input
          - Proceed to Step 3
      
          Step 3: Identify products by name
          - If user provided product names (not IDs):
            * Call IdentifyObjectByName action to convert product names to Product2 IDs
            * Capture the list of product2Ids
      
          Step 4: Query specific QLIs
          - Call QueryQuoteLineRecords action with:
            * quoteId = createdQuoteId
            * productIds = list of product2Ids from Step 3
          - Capture returned QuoteLineItem IDs
      
          Step 5: Handle multiple QLIs with same product
          - If multiple QLIs exist for the same product:
            * Display: "There are multiple line items for [Product Name]. Which one would you like to discount?"
            * Show details to help user distinguish (e.g., quantity, price)
            * WAIT for user clarification
            * Narrow down to specific QLI ID
      
          Step 6: Ask for discount percentage
          - Ask: "What discount percentage would you like to apply to the selected item(s)? (0-100%)"
          - WAIT for user response
          - Extract percentage from user input
      
          Step 7: Apply discount to selected QLIs
          - For EACH QuoteLineItem ID from Step 4:
            * Call ApplyDiscountToQuoteLineItem action with:
              - QuoteLineItemId = current QLI ID
              - discountPercentage = percentage from Step 6
            * Track successes and failures
      
          Step 8: Display summary
          - Show: "Applied [X]% discount to the selected quote line item(s)."
          - If any failures, list them
      
          Step 9: Ask if user wants to discount more items
          - Ask: "Would you like to apply a discount to any other items on the quote?"
          - WAIT for user response
          - If YES: Return to Task 4 Step 1
          - If NO: Proceed to Task 6
      
          Task 5: RESERVED (not used - tasks flow from 4 to 6)
      
          Task 6: Handoff to Display and Submit
      
          After discount application is complete (or skipped):
          Pass control to [FLOW] Quote - Step 4: Display and Ask to Submit
             
    4. Add this set of instructions to display the quote and ask to submit.
      [FLOW] Quote - Step 4: Display and Ask to Submit
      
          Trigger: This instruction activates after quote line items have been added and discounts (if any) have been applied.
      
          PREREQUISITES:
          - createdQuoteId exists and is valid
          - Quote has at least one QLI
      
          Task 1: Fetch Complete Quote Details
      
          Use GetRecordDetails or QueryRecords to fetch the full quote record with:
          - Quote Name
          - Quote ID
          - Quote Status
          - Account Name (from AccountId)
          - Total Amount
          - Discount Amount (if any)
          - Subtotal
      
          Also fetch all Quote Line Items for this quote using QueryQuoteLineRecords:
          - Product Name
          - Quantity
          - Unit Price
          - Line Total
          - Discount (if applied)
      
          Task 2: Display Comprehensive Quote Summary
      
          Format the quote details as follows:
      
          ```
          Quote created and updated successfully!
      
          **Quote Details:**
          • Quote ID: [createdQuoteId]
          • Quote Name: [quoteName]
          • Account: [accountName]
          • Status: [quoteStatus]
      
          **Line Items:**
          [For each QLI:]
          • [Product Name] - Quantity: [qty] - Unit Price: $[unitPrice] - Discount: [discount]% - Line Total: $[lineTotal]
      
          **Pricing Summary:**
          • Subtotal: $[subtotal]
          • Total Discount: $[discountAmount]
          • Total Amount: $[totalAmount]
          ```
      
          Display this summary to the user with the actual values populated.
      
          Provide a clickable link to the quote record using the format: [View Quote](/[createdQuoteId])
      
          Task 3: Ask for Submission (MANDATORY)
      
          After the summary (on a new line), ask: "Do you want to submit the quote for approval now?"
      
          STOP IMMEDIATELY. Do NOT submit the quote without user consent.
      
          WAIT for explicit user consent (e.g., "yes," "submit it", "approve").
      
          NEVER auto-submit or assume the user wants to submit.
      
          Task 4: Submit Quote (if consented)
      
          ONLY if the user explicitly confirms:
          - Call UpdateRecordFields action on createdQuoteId to set Status = "Approved"
          - Confirm the submission success to the user: "Quote has been submitted for approval successfully!"
      
          If the user says "no" or declines:
          - Do NOT submit the quote
          - Acknowledge their decision: "Quote has been saved but not submitted. You can submit it later from the quote record."
      
          Task 5: End Flow
      
          The quote flow is complete.
      
          Ask: "Is there anything else I can help you with?"