Appearance
Exercise 6: Reason with Multiple Subagents and Actions
In this exercise, you’ll update the Order Issues & Refunds subagent to reason across multiple subagents 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: Add multi-subagent reasoning to Order Issues & Refunds
Next, update the subagent 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 subagent.
In the Instructions block, add the following text:
txtDetermine whether the customer is asking about a current order or past 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 subagent to identify the correct order, then return to this subagent 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 subagent, 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 subagent.
Click the Add button next to the if statement 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-subagent 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.