Appearance
Exercise 3: Verify Customers with Hybrid Reasoning
In this exercise, you’ll create an Order Issues & Refunds topic and add the actions it needs to support customer case lookups and refunds. In the next exercise, you’ll add customer verification guardrails using variables and conditional logic.
Step 1: Create the Get Customer Profile action
Create the Order Issues & Refunds topic.
In Agentforce Builder, switch to the Canvas View.
Click the + sign besides Topics in the explorer.
Select Create new topic.
Set the following values:
Field Value Name Order Issues & RefundsDescribe the job you want the topic to do This topic resolves problems with orders, such as missing items, incorrect items, cold food, late deliveries, or orders that never arrived. It also handles support cases related to those issues—including creating a case, checking whether a case already exists, and providing case status/follow-up. It determines refund eligibility, issues refunds or credits, and explains outcomes clearly and empathetically to customers.Click Create and Open.
Paste the following into the Instructions Section:
txtAddress the user's concerns regarding their order. If the user reports an issue with their order, determine the nature of the issue (e.g., missing items, incorrect items, cold food, late delivery, or non-delivery).Click Save to save the changes.
Step 2: Add the Order Issues & Refunds to Topic Selector
Expand the Topic Selector folder in the explorer and open the topic.
Open the Authoring Agent by toggling the right panel.
Enter the following prompt into the Authoring Agent dialog.
txtAdd the new Order Issues & Refunds as transitions to the topic selector.Click Accept All.
Click Save to save the changes.
Step 3: Create an action (Get Customer Profile)
Next, create an Apex-based action that retrieves customer details from an email address.
Open the Order Issues & Refunds folder in the explorer and select the topic.
Click on the + sign besides Actions, and select Create new action.
Enter
Get Customer Profileas action name and click Create and Open.Enter the following information:
Field Value Description Retrieves a customer profile based on their email address.Reference Action Type ApexReference Action Get Customer ProfileLeave the default input and output settings.
Click Save.
Step 4: Create the related cases action
Next, create an action that retrieves a customer’s related cases with basic case information.
Inside the Order Issues topic, click on the + sign besides Actions, and select Create new action.
Enter
Get Related Casesas action name and click Create and Open.Enter the following information:
Field Value Description Retrieves a customer’s related cases (basic details) based on the requested case status.Reference Action Type ApexReference Action Get Related CasesOutputs - Cases Select checkbox Show in conversationClick Save.
Update the Get Related Cases Action Agent Script
In the Get Related Cases Action, Switch the current view from Canvas to Script.
Find the
Get_Related_Casesaction.Find the cases output and make the following changes:
- Update the output type to
list[object] - update the
complex_data_type_nameto@apexClassType/c__AgentCaseActions$CaseSummary
- Update the output type to
Click Save.
Step 5: Create the order refund action
Next, create an action that issues refunds using Flow.
Switch back to the Canvas view.
Inside the Order Issues Refunds Topic, Click on the + sign besides Actions, and select Create new action.
Enter
Handle Order Refundsas action name and click Create and Open.Enter the following information:
Field Value Description Submits and executes order refundsReference Action Type FlowReference Action Issue RefundInputs - refundAmount Select checkbox Require Input to execute actionInputs - refundReason Select checkbox Require Input to execute actionInputs - verifiedContactId Select checkbox Require Input to execute actionOutputs - returnedRefunds Select checkbox Show in conversationClick Save.
Update the Handle Order Refunds Action Agent Script
In the Handle Order Refunds Action, Switch the current view from Canvas to Script.
Find the
Handle_Order_Refundsaction.Find the returnedRefunds output and make the following changes:
- Update the output type to
list[object] - update the
complex_data_type_nametolightning__recordInfoType
- Update the output type to
Click Save.
Step 6: Add actions to the Order Issues & Refunds topic
Next, attach the actions to the topic so the agent can use them during conversations.
Switch back to the Canvas view and open the Order Issues & Refunds topic.
Add the following basic instructions to the topic:
txtWhen a user asks about their order or requests a refund, ask for their email address. Run Get Customer Profile using the customer’s email address. Then either: - run Get Related Cases to check for existing cases and provide status, or - run Handle Order Refunds to process a refund when appropriate.Click Save.
Step 7: Test the agent
Next, test that the agent can ask for an email address, retrieve a customer profile, and show the customer’s open cases.
Click Preview.
Enter the following prompt:
txtCan you show me all of my cases?Press Enter on your keyboard.
When the agent asks for an email address, enter:
txtalex.morgan@example.comPress Enter on your keyboard.
In Interaction Details, confirm the agent runs Get Customer Profile and then Get Related Cases, and that it shows the case results in the conversation.
Summary
You have created the core actions your agent will use for customer support workflows, added them to Order Issues & Refunds with baseline instructions, and tested that the agent can retrieve and display open cases.