Appearance
Exercise 4: Verify Customers with Hybrid Reasoning - Part 2
In this exercise, you’ll implement verified-customer guardrails using variables, a dedicated Verify Customers topic, and conditional logic in Order Issues & Refunds.
Step 1: Create a new topic (Verify Customers)
First, create a dedicated topic that handles identity verification.
In Agentforce Builder, click the + sign besides Topics in the explorer.
Select Create new topic.
Enter
Verify Customersas the topic name, and click Create and Open.Set the topic fields:
Field Value Description Verifies a customer’s identity before allowing access to sensitive support actions.Click Save.
Step 2: Add Verify Customers to Topic Selector (routing)
Next, make sure the agent can route into your new topic.
In the explorer, open Topic Selector.
Open the Authoring Agent (toggle the right panel).
Enter the following prompt:
txtAdd Verify Customers as a transition in the Topic Selector.Review the suggested change and apply it.
Click Save.
Step 3: Create an action (Send Email with Verification Code)
Next, create the first Flow action used by the Verify Customers topic.
In the explorer, open Verify Customers.
Click on the + sign besides Actions, and select Create new action.
Enter
Send Email with Verification Codeas action name and click Create and Open.Enter the following information:
Field Value Agent Action Label Send Email with Verification CodeDescription Sends a verification code to the customer’s email address.Reference Action Type FlowReference Action Send Email with Verification CodeInputs - customerToVerify Select checkbox Require Input to execute actionOutputs - verificationMessage Select checkbox Show in conversationClick Save.
Step 4: Create an action (Verify Code)
Next, create the second Flow action used by the Verify Customers topic.
In the explorer, stay in Verify Customers.
Click on the + sign besides Actions, and select Create new action.
Enter
Verify Codeas action name.Enter the following information:
Field Value Agent Action Label Verify CodeDescription Verifies a user-provided verification code.Reference Action Type FlowReference Action Verify CodeInputs - customerCode Select checkbox Require Input to execute actionInputs - customerId Select checkbox Require Input to execute actionInputs - customerType Select checkbox Require Input to execute actionClick Save.
Step 5: Add variables for verified-customer context
Next, create global variables that the agent can use across topics.
You’ll use these variables throughout the rest of the workshop:
IsVerifiedCustomer: Track whether the customer has successfully completed verification.VerificationKey: Store the authentication key returned by Send Email with Verification Code so it can be passed into Verify Code.FirstName: Store the customer’s first name so the agent can refer to them by name in responses.
Click on Variables in the explorer.
Replace the existing variables with the block below:
agentscriptvariables: EndUserId: linked string source: @MessagingSession.MessagingEndUserId description: "This variable may also be referred to as MessagingEndUser Id" RoutableId: linked string source: @MessagingSession.Id description: "This variable may also be referred to as MessagingSession Id" ContactId: linked string source: @MessagingEndUser.ContactId description: "This variable may also be referred to as MessagingEndUser ContactId" EndUserLanguage: linked string source: @MessagingSession.EndUserLanguage description: "This variable may also be referred to as MessagingSession EndUserLanguage" VerifiedCustomerId: mutable string = "" description: "This variable may also be referred to as VerifiedCustomerId" IsVerifiedCustomer: mutable boolean = False description: "Whether the user is a verified customer or not" VerificationKey: mutable string = "" description: "Authentication key used to link email-code issuance to code verification" FirstName: mutable string = "" description: "Customer first name for personalization after verification"Click Save.
TIP
At the moment, editing variables is only available in Agent Script. A dedicated user interface for managing variables will be added later in the beta.
Step 6: Add actions to the Verify Customers topic
Next, add the actions to the topic and map inputs/outputs to your global variables. This work happens under Actions Available For Reasoning.
In the explorer, open Verify Customers.
Click on the arrow besides Select action, and select Send Email with Verification Code.
Expand the Send Email with Verification Code action and map the outputs:
- Set the output for the verified customer identifier to
VerifiedCustomerId. - Set the output for the authentication key to
VerificationKey.

- Set the output for the verified customer identifier to
Click Save.
Click on the arrow besides Select action, and select Verify Code.
Expand the Verify Code action and configure it:
- In the action inputs, set the authentication key input to the
VerificationKeyvariable. - Map the output that represents whether the customer is verified to
IsVerifiedCustomer.

- In the action inputs, set the authentication key input to the
Click Save.
Click on the arrow besides Select action, and select Get Customer Profile.
Expand the Get Customer Profile action and configure it:
- In the action inputs, set the
VerifiedCustomerIdinput to theVerifiedCustomerIdvariable. - Map the output that represents the customer’s first name to
FirstName.

- In the action inputs, set the
Click Save.
Step 7: Update the Verify Customers topic instructions
Next, replace the topic instructions with a clear, step-by-step verification flow. This work happens in the Instructions section.
In the explorer, open Verify Customers.
Replace the topic instructions with the text below:
txtFollow the below Rules step by step Rules: Step 1: Ask the user for their Email Address or Username. If not provided you will ask for it and you won't proceed After Step 1 please proceed to Step 2 Step 2: Send a verification code to the user using (@SendEmailwithVerificationCode PLACEHOLDER) with the email address or username provided. After Step 2 please proceed to Step 3 Step 3: Wait for the user to provide their verification code. When the users sends through the code, then you must run the (@VerifyCodePLACEHOLDER) action with the code they submitted. After Step 3 please proceed to Step 4 Step 4: If the customer has successfully verified themselves, then retrieve their customer profile using @Get Customer Profile and begin to address them by their (@FirstNamePLACEHOLDER). Ask the user if they would like you to continue with their request. After Step 4 please proceed to Step 5 Step 5: (Add Logic Placeholder)Click Save.
After you paste the instructions, replace the placeholders by typing
@and selecting:- Send Email with Verification Code
- Verify Code
- Get Customer Profile
For the logic placeholder, type
/and add a Conditional Statement:Select the
IsVerifiedCustomervariable.Leave the default
==operator and set the value totrue.Underneath the conditional logic, open the resource picker again and select Transition.
In the transition topic, select Topic Selector.
Click the Add button next to the conditional logic and select Else.
Under the Else branch, paste the text below:
txtProvide the user with the verification message returned from Send Email with Verification Code then return to Step 1.
Click Save.
Step 8: Update the Order Issues & Refunds topic to use verified context
Next, update the Order Issues & Refunds topic so sensitive actions run only after the customer is verified. The action input mappings happen under Actions Available For Reasoning, and the conditional/transition work happens in the Instructions section.
In the explorer, open the Order Issues & Refunds topic.
In the actions section, expand Get Related Cases and set the
verifiedCustomerIdinput to theVerifiedCustomerIdvariable.Expand Handle Order Refunds and set the
verifiedCustomerIdinput to theVerifiedCustomerIdvariable.Click Save.
In the Instructions block, type
/to open the resource picker.
Select Conditional Statement.
Select the
IsVerifiedCustomervariable.Leave the default
==operator and set the value toFalse.Underneath the conditional logic, open the resource picker again and select Transition.
In the transition topic, select Verify Customers.
TIP
This is where hybrid reasoning shines: the agent can use conditional logic (for example, checking
IsVerifiedCustomer) to transition to another topic for verification, then return and continue the workflow. This makes handoffs predictable while still allowing natural, conversational interactions.Click the Add button next to the conditional logic and select Else.
Under the Else block, add short, explicit instructions that tell the agent when to run the actions you added in Exercise 3 (for example, Get Related Cases and Handle Order Refunds).
Click Save.
Step 9: Test the end-to-end journey
Click Preview.
Enter the following prompt:
txtHi, I'm Alex Morgan. Can you show me my open cases?Press Enter on your keyboard.
In Interaction Details, confirm the agent transitions to Verify Customers before running any sensitive actions.
If the agent asks for an email address, enter
alex.morgan@example.comand press Enter.In the Interaction Details panel, open the Send Email with Verification Code action and locate the
verificationCodein the output response.
Copy the
verificationCodeand paste it into the agent dialog. Confirm with Enter.After verification completes, confirm the agent returns to Order Issues & Refunds and can run Get Related Cases.
Summary
You have implemented a reusable Verify Customers topic and hybrid reasoning guardrails so Order Issues & Refunds can require verification before running sensitive actions.