Configure an Agentforce Service Agent
Learning Objectives
In this project, you’ll:
- Associate topics and actions to agents.
- Construct a Custom Agent Action with a Prompt.
- Build a Custom Agent Action with Flow.
- Create a functional Agentforce Service Agent.
Coral Cloud Resorts + Agentforce
Coral Cloud Resorts is known for two things: amazing destination activities and top-notch customer service. Business is booming. Coral Cloud’s customer service agents are very busy providing activity recommendations and booking activities for clients. With the busy season upcoming, Coral Cloud Resorts needs to scale its service assistance quickly. If only there was a tool to help. Agentforce to the rescue! An Agentforce Service Agent can assist Coral Cloud clients with personalized recommendations, experience booking, and more.
Enable Agents, Web Deployment, and More
Step one of building an agent is enabling all of the required org features.
- Click and click Setup. The Setup page opens in a new tab.
- In the Setup Quick Find, search for and select Einstein Setup.
- Click the Turn on Einstein toggle, and make sure Einstein is On.
- In the Setup Quick Find, search and select Einstein Bots.
- Click the Einstein Bots toggle, and make sure Einstein Bots is On.
- In the Setup Quick Find, search for and select Agents.
- Refresh your browser to reload Setup.
- Click the Einstein Copilot for Salesforce toggle, and make sure it is set to On.
- In the Setup Quick Find, search for and select Embedded Service Deployments.
- Select the ESA Web Deployment.
- Click Publish to republish with the latest additions. Note: The deployment can take up to 10 minutes but no need to wait, proceed to the next step.
Publish the Experience Cloud Site
In preparation of the deployment, get the Experience Cloud site ready for the new agent.
- Search for
Digital Experiences
in the Setup Quick Find and select All Sites.
- Click Builder next to the coral-cloud site.
- If a popup appears, click OK.
- Click Publish in the upper right corner.
- Click Publish in the confirmation window.
- Click Got It.
- Click the Experience Builder menu .
- Click Salesforce Setup.
Create a New Agent
Adding a new agent is as simple as clicking a button and adding details.
- In the Setup Quick Find, search for and select Agents.
- Click +New Agent.
- In the Agent Details, add
My First Agent
as the Label andA fun way to learn how to build my first Agent.
as the Description.
- Leave the other options as is and click Create.
Configure the Agent
Now that you know how to create a brand-new Agent, you can adjust a previously created agent by adding topics and actions to the agent. In other words, if a client asks about a topic, what action(s) should the agent produce?
- With the Agent Studio still open, select Coral Cloud Agent.
- Select Coral Cloud Agent.
- Click Open in Builder.
- Click the down arrow and select New Topic.
- In the modal, configure the Start element as follows:
Field |
Value |
---|---|
Topic Label |
Experience Management |
Classification Description |
This topic addresses customer inquiries and issues related to booking experiences at Coral Cloud Resort, 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 Resort, ensuring a seamless customer service experience by providing accurate information and resolving issues promptly. |
Instruction |
If a customer would like more information on an Experience, you should search for the related Experience__c record and let them know more. |
Note: Want to learn more about topics? Check out Topics and Actions on Salesforce Help.
- Click Next.
- Add a check to the following actions:
- Identify Object by Name
- Identify Record by Name
- Query Records
- Summarize Record
- Identify Object by Name
- Click Finish.
- If necessary, confirm that you’re about to use Einstein by clicking on Got it in the sidebar.
- While still in the Agent Builder, click Refresh (circular arrow) in the top right corner of the Conversation Preview.
- Enter this prompt in the Describe your task or ask a question… dialog box:
Can you let me know more about the full moon beach party experience?
- Press your Return/Enter key and notice the response, which gives information about that party. If necessary, respond “Yes” for more details about the party experience.
Note: The agent’s response is accurate but still needs some refining.
Configure the Generate Personalized Schedule Prompt
Add parameters on how the agent should interact with the Coral Cloud clients.
- Click the back arrow to return to Setup.
- In Setup, search and select Prompt Builder.
- Click Generate Personalized Schedule under All Prompt Templates.
- Configure the prompt as follows:
Field |
Value |
---|---|
Prompt Template Workspace |
Present the list of resort activities happening today that match the guest's interests.
For clarity, use a bullet list.
For each activity, include name, time, location and duration on a single line. Do not include the date.
Tell the guest to reach out if they'd like to book any of these activities.
List of activities happening today that match the guest's interests:
{!$Apex:PersonalizedGuestExperiences.Prompt} |
- Click the Save As dropdown in the top right of the builder and select Save as a New Version.
- In the Preview panel, select Sofia Rodriguez as the Contact.
- Click Preview and see the populated Resolution and Response.
- Click Activate.
Create a Custom Agent Action with a Prompt
The Agentforce Service Agent needs to be able to give personalized recommendations based on the current contact’s schedule. The client shouldn’t get a recommendation for jet skiing if they already have that experience booked.
- Click the back arrow button to navigate back to Setup.
- In the Setup Quick Find, search for and select Agent Actions.
- Click +New Agent Action to create a new Action.
- Select Prompt Template as the Reference Action Type.
- Select Generate Personalized Schedule as the Reference Action.
Note: Not seeing the Generate Personalized Schedule prompt template option in the Reference Action selector? Return to the Generate Personalized Schedule prompt template and ensure it is activated (Setup > Prompt Builder > Generate Personalized Schedule > Activate).
- Leave the other options as is and click Next.
- Configure the instructions as follows:
Field |
Value |
---|---|
Agent Action Instructions |
Generate a personalized schedule that includes the time and location of resort experiences that are available today, and that match the guest's interests. |
Contact Input Instructions |
Contact for which the personalized schedule should be generated. Must be a valid JSON representing the contact info, chained from having executed the QueryRecords action. |
Note: The instructions are used by the agent to understand what the actions do and what is needed as input and output.
- For the Prompt Response Output, check Show in conversation.
- Click Finish.
Create a Custom Agent Action with Flow
When the agent provides excellent recommendations and the client wants to book an experience, what should happen? Hint, the agent will create a new record within Salesforce.
- Create another new Action by clicking +New Agent Action.
- Select Flow as the Reference Action Type.
- Select Create Experience Session Booking.
- Leave the other options as is, and click Next.
- For Contact_Id, check Require Input.
- For Guests, check Require Input and Collect data from user.
- For Session_Id, check Require Input.
- For Booking output, check Show in conversation.
- For Output_Message output, check Show in conversation.
- Click Finish.
Assign the Custom Actions to the Agent
Put all the pieces together and add the custom actions to the Agentforce Service Agent.
- In the Setup Quick Find, search for and select Agents.
- Select Coral Cloud Agent.
- Click Open in Builder.
- Click the Experience Management topic.
- Click the This Topic’s Actions subtab.
- Click the Add Action Icon (plus sign).
- Add a check to the Create Experience Session Booking Action and the Generate Personalized Schedule Action.
- Click Finish.
- Click the Topic Configuration subtab.
- Click New Instruction.
- Leave the pre-populated Instruction as is and configure the new blank Instruction element as follows:
Field |
Value |
---|---|
Instruction |
When a customer requests a list of recommended experience sessions, first retrieve their contact record. Pass this record into the "Generate Personalized Schedule" action's contact input to return a list of relevant experiences available for booking. |
- Click New Instruction again.
- Configure the new Instruction element as follows:
Field |
Value |
---|---|
Instruction |
When a customer requests to book an experience, first locate a Session__c record that corresponds to the desired date and Experience__c they wish to book. Then, use the "Create Experience Session Booking" action to complete the booking, ensuring that you pass the Session__c Id, not the Experience__c Id. |
Note: There should now be a total of three instructions.
- Click Save.
- Click Refresh (circular arrow) in the top right corner of the Conversation Preview.
- Enter this prompt:
Can you let me know if there are any experiences I, Sofia Rodriguez, might be interested in today?
and press your Return/Enter key.
- Enter the following prompt:
Can you tell me more about the Beach Bootcamp Challenge?
and press your Return/Enter key.
- Enter the following prompt:
Can you book Sofia into the Beach Bootcamp Challenge for today?
and press your Return/Enter key.
- You may tweak the instructions until you are getting the correct results.
- Click Activate.
Deploy the Agent to Your Customers
Next, set the user profile of the agent and embed the agent to an Experience Cloud site.
- Click the back arrow button to navigate back to Agents Setup.
- Click Coral Cloud Agent.
- Click the edit icon next to the Agent User field.
- Select Custom Agent User.
- Search for and select Coral Cloud Agent.
- Click the checkmark to save.
Note: The agent will now use the security profile (such as create, read, update, and delete operations on objects in the org) of this Custom Agent user.
Add the Agent to the Coral Cloud Site
- Search for
Digital Experiences
in the Setup Quick Find and select All Sites.
- Click Builder next to the coral-cloud site.
- Click the Components widget .
- Search Embedded Messaging and drag and drop the component over the Book an Experience of a Lifetime section. Note: exact placement is up to you and it may take a few seconds for the component to appear.
- Leave the default settings.
- Click Publish in the upper right corner.
- Click Publish in the confirmation window.
- Click Got It.
View the Agent as a Customer
The big reveal. Time to interact with your new Agentforce Service Agent.
- Click the Experience Builder menu .
- Select View coral-cloud to open the published coral coud site.
Note: It may take a few minutes for the site to publish. Go ahead and verify the challenge below while you wait for your Experience Cloud site to publish.
- Click on the Messaging icon in the lower right corner to start interacting with the new agent. Try some prompts like:
What activities are there at the resort?
-
What dining experiences does the resort offer?
Coral Cloud Resorts now has a shiny new Agentforce Service Agent that can not only give personalized experience recommendations, but also book experiences for clients. Bring on the busy season!