Appearance
Exercise 6: Reason with Multiple Topics and Actions
In this exercise, you’ll update the Order Issues & Refunds topic to reason across multiple topics and actions. The goal is to (1) require customer verification, (2) decide whether the request relates to a current/new order or a past order, (3) avoid duplicate cases by checking for existing cases, and (4) transition to Order Lookup only when order context is missing.
Step 1: Confirm prerequisites
Before you begin, confirm your agent includes these topics:
Order LookupVerify CustomersOrder Issues & Refunds
And confirm these actions are available:
- In Order Lookup: Get Customer Profile, Lookup Orders
- In Order Issues & Refunds: Get Related Cases, Handle Order Refunds
Also confirm your Topic Selector can route to these topics:
Order Issues & RefundsOrder LookupVerify Customers
Step 2: Confirm action inputs and outputs (verified context)
Before adding more reasoning, confirm the sensitive actions use the verified customer context. This work happens under Actions Available For Reasoning.
In Agentforce Builder, open the Order Issues & Refunds topic.
In the actions section, expand Get Related Cases and confirm its verified customer input is set to the
VerifiedCustomerIdvariable.Expand Handle Order Refunds and confirm its verified customer input is set to the
VerifiedCustomerIdvariable.Click Save.
Step 3: Add multi-topic reasoning to Order Issues & Refunds (Instructions)
Next, update the topic instructions to guide how the agent should reason about orders and cases before taking action. This work happens in the Instructions section.
In Agentforce Builder, open the Order Issues & Refunds topic.
In the Instructions block, add the following text:
txtDetermine whether the customer is asking about a current/new order or a past order. If the customer is asking about a current/new order, treat the order date as today unless the customer provides a different date. If the customer is asking about a past order, ask for either: - a date range (for example: "last 7 days"), or - which of the last x orders to use (for example: "last 3 orders"). After the customer is verified, check whether a case already exists for this issue using Get Related Cases before creating a new case or issuing a refund. If there is no order context yet (no selected order, order identifier, or date range), transition to the Order Lookup topic to identify the correct order, then return to this topic and continue.Click Save.
Step 4: Transition to Order Lookup when order context is missing
Next, implement the “missing order” branch using the same resource picker pattern as the other exercises.
In the Order Issues & Refunds topic, in the Instructions block, type
/to open the resource picker.Select Conditional Statement.
Configure the conditional so it represents “no order context is available yet” (for example: no selected order, no order identifier, and no date range).
Under that conditional branch, add a Transition to the Order Lookup topic.
Click the Add button next to the conditional logic and select Else.
In the Else branch, proceed with the normal flow (check for existing cases, then handle refunds when appropriate).
Click Save.
Step 5: Test the end-to-end journey
Click Preview.
Enter the following prompt:
txtI'm Alex Morgan. My delivery was late—can you help me with a refund?Press Enter on your keyboard.
In Interaction Details, confirm the agent:
- Transitions to Verify Customers first (if needed)
- Checks whether a related case already exists (Get Related Cases)
- If there is no order context, transitions to Order Lookup to identify the order, then returns
- Proceeds with Handle Order Refunds once the correct order context is available
Summary
You have strengthened multi-topic reasoning by teaching Order Issues & Refunds to distinguish current vs past orders, reuse existing cases when possible, and transition to Order Lookup only when order context is missing.