Appearance
Exercise 1: Create a New Service Agent
In this exercise, you will use your new Agentforce skills to create a new agent that you can distribute directly to your customers using Agentforce Service Agents. Creating a new agent is the first step in exposing an agent to your customers.
Step 1: Create a new agent
While the the Default Agentforce Agent and Employee Agents are available for you to distribute to your internal Salesforce users, you can also create custom agents that you can use just about anywhere else. Adding a new agent is as simple as clicking a button and adding details.
In the Setup Quick Find, search for and select Agentforce Agents.
Click +New Agent.
Select the Agentforce Service Agent template and click Next.
Deselect all of the pre-configured Topics except for General FAQ.
Set field values as follows:
Field Value Label Coral Cloud Agent
API Name Coral_Cloud_Agent
Description This is the Coral Cloud Agent that helps customers learn more about Experiences as well as book sessions.
Role The agent's job is to assist users in navigating and managing bookings for different experiences offered by Coral Cloud Resorts, ensuring a seamless customer service experience by providing accurate information and resolving issues promptly.
Company Coral Cloud Resorts is a fictitious seaside resort that manages guests and their reservations. It offers a rich set of experiences.
Agent user New Agent User Enrich event logs with conversation data True Click Next.
Create a Data
Under Select Data Sources, Click on the Data Library picklist.
Select New Library
TIP
If you previously created a data library in the Employee Agent workshop, you can select the Customer Service Agent Library that is already in the picklist.
Leave the default values for the Data Space and Library Name
Set the Data Type to Files.
Download the following Documents to your computer:
Coral Cloud Resorts stores various types of information as PDFs in Amazon S3. Check out some of these PDFs below to familiarize yourself with their content:
Click on Upload Files and select all four documents.
Once uploaded, Click Done.
Click Create to create the Agent.
TIP
Each agent has a designated running user and will have access to all of the data and metadata that that user can see. Ensure that you start with a minimum access profile and only give the agent access to the data that it needs.
Step 2: Assign Permissions to the Coral Cloud Agent
Click the back arrow button to leave Agentforce Builder and go back to Setup.
Search for Permission Sets in the Setup Quick Find and select Permission Sets.
Click on the Coral Cloud Service Agent permission set.
Click on Manage Assignments.
Select the EinsteinServiceAgent User.
Click Assign to assign the permission set.
Step 3: Configure the Coral Cloud Agent
Configure the agent with topics and actions that it can use to support your customers.
In Agentforce Builder, click on the New drop down and click on New Topic.
Click Next to skip the AI Generated topic creation.
Configure the topic as follows:
Field Value Topic Label Customer Experience Support
Classification Description This topic addresses customer inquiries and issues related to booking experiences at Coral Cloud Resorts, including making reservations, modifying bookings, and answering queries about experience details.
Scope The agent's job is to assist users in navigating and managing bookings for different experiences offered by Coral Cloud Resorts, ensuring a seamless customer service experience by providing accurate information and resolving issues promptly.
Instruction If a customer would like more information on Activities or Experiences, you should run the action 'Get Experience Details' and then summarize the results with improved readability.
Click on Next.
Do not select any actions.
Click Finish.
Step 3: Create custom service agent actions
Create custom actions for your agent to access data in Salesforce.
Create the Get Experience Details action
From Setup, open Agentforce Agents (under Agent Studio).
Click on the Coral Cloud Agent in the list of agents.
Click Open in Builder.
In Agentforce Builder, select the Customer Experience Support topic.
Click on the This Topic's Actions tab in the topic details.
Click on the New drop down and click on Create New Action.
Configure the action as follows:
Field Value Reference Action Type Flow
Reference Action Get Experience Details
Loading Text Looking up experience...
Agent Action Label Keep default Agent Action API Name Keep default Click Next.
Leave the default instructions in.
Check Require input for the
experienceName
input.Check show in Show in Conversation for the
experienceDetails
output.Click Finish.
Test out the instructions in the Conversation Preview. If prompted that you are about to use Einstein, click on Got It.
Click on the refresh button to reset the conversation.
Enter this prompt in the dialog box:
txtCan you let me know more about the full moon beach party experience?
Create the Get Customer Details Action
Under This Topic’s Actions, click New → Add from Asset Library → Create New Action.
Configure the action as follows:
Field Value Reference Action Type Flow
Reference Action Get Customer Details
Show loading text True
Loading Text Verifying identity...
Agent Action Label Keep default Agent Action API Name Keep default Click Next.
Leave the default instructions in.
Check Require input for both inputs (
experienceId
andstartDate
).Check show in Show in Conversation for the
sessions
output.Click Finish.
Create the Get Sessions action
Under This Topic’s Actions, click New → Add from Asset Library → Create New Action.
Configure the action as follows:
Field Value Reference Action Type Flow
Reference Action Get Sessions
Loading Text Getting sessions...
Agent Action Label Keep default Agent Action API Name Keep default Click Next.
Leave the default instructions in.
Check Require input for both inputs (
experienceId
andstartDate
).Check show in Show in Conversation for the
sessions
output.Click Finish.
Create the Create Booking action
Under This Topic’s Actions, click New → Add from Asset Library → Create New Action.
Configure the action as follows:
Field Value Reference Action Type Flow
Reference Action Create Booking
Loading Text Creating booking...
Agent Action Label Keep default Agent Action API Name Keep default Click Next.
Leave the default instructions in.
Check Require input for all three inputs (
contactId
,numberOfGuests
, andinstructions
).Check show in Show in Conversation for the
createdBooking
output.Click Finish.
Step 4: Introduce Filters & Variables
Variables in Agentforce act as secure data containers, enabling developers to control agent logic and ensure deterministic outcomes. There are primarily two types of variables: context variables and conversation variables.
Assign the isVerified Variable
Click on the This Topic's Actions tab in the Customer Experience Support Topic Details.
Select the Get Customer Details Action.
Scroll down to the isCustomerVerified output variable.
Select the isVerified variable.
Assign the VerifiedCustomerId Variable
Scroll down to the VerifiedCustomerId output variable.
Select the VerifiedCustomerId variable.
Assign the Customer Id to the Create Booking Action
Click the Arrow next to View Action to get back to the action list.
Select the Create Booking action.
Scroll down to the contactId input variable.
Assign the VerifiedCustomerId variable to the input.
Add the Is Customer Verified Filter to the Create Booking Action
In the Create Booking action, Click the Filter button in the heading of the View Action panel.
Select the Verified User filter from the dropdown.
Navigate back to the topic and select Topic Configuration
Add the following instruction so that the agent knows to verify the user
txtNever ask the user for an ID. Instead, ask for a record that's relevant.
Step 5: Add actions to the Coral Cloud Agent
Click on the Topic Configuration tab in the Topic Details.
Click on the New Instruction Button to create a new instruction, repeat for each of the following instructions:
Field Value Session Query Instructions If asked to get sessions for the experience, use the 'Get Sessions' action. Ask for the date of the sessions if not provided. Use the Id of the Experience__c from the 'Get Experience Details'.
Create Booking Instructions If asked to book, use the action 'Create Booking'. The Session__c is the ID of the session from the action 'Get Sessions'. If multiple sessions are present, ask to select one of the sessions—do not display the Id, display the Start_Time__c—and use that Session as the ID for the Session__c. Prompt for the Number of Guests and use that for the Number_of_Guests__c.
Click Save.
Test out the instructions in the Conversation Preview. If prompted that you are about to use Einstein, click on Got It.
Enter this prompt:
txtCan you let me know more about the full moon beach party experience?
Press your Return/Enter key and notice the response, asking you to validate your identity before proceeding.
txtCan you book me in for tomorrow session?
Press your Return/Enter key and notice the response, provide the following details to verify your identity:
txtMy email address is sofiarodriguez@example.com and my membership number is 10008155
Click on Activate to activate the agent.
Summary
You have just created a custom service agent that can be used to interact with your customers. Next, we will use the service deployment capabilities in Service Cloud to deploy the agent to a customer-facing Experience Cloud site.