Skip to main content
Estimación de tiempo

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.

  1. Click setup icon and click Setup. The Setup page opens in a new tab.
  2. In the Setup Quick Find, search for and select Einstein Setup.
  3. Click the Turn on Einstein toggle, and make sure Einstein is On.
  4. In the Setup Quick Find, search and select Einstein Bots.
  5. Click the Einstein Bots toggle, and make sure Einstein Bots is On.
  6. In the Setup Quick Find, search for and select Agents.
  7. Refresh your browser to reload Setup.
  8. Click the Einstein Copilot for Salesforce toggle, and make sure it is set to On.
  9. In the Setup Quick Find, search for and select Embedded Service Deployments.
  10. Select the ESA Web Deployment.
  11. Click Publish to republish with the latest additions. Note: The deployment can take up to 10 minutes.

Publish the Experience Cloud Site

In preparation of the deployment, get the Experience Cloud site ready for the new agent.

  1. Search for Digital Experiences in the Setup Quick Find and select All Sites.
  2. Click Builder next to the coral-cloud site.
  3. If a popup appears, click OK.
  4. Click Publish in the upper right corner.
  5. Click Publish in the confirmation window.
  6. Click Got It.
  7. Click the Experience Builder menu Experience Builder menu icon .
  8. Click Salesforce Setup.

Create a New Agent

Adding a new agent is as simple as clicking a button and adding details.

  1. In the Setup Quick Find, search for and select Agents.
  2. Click +New Agent.
  3. In the Agent Details, add My First Agent as the Label and A fun way to learn how to build my first Agent. as the Description.
  4. 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?

  1. With the Agent Studio still open, select Coral Cloud Agent.
  2. Select Coral Cloud Agent.
  3. Click Open in Builder.
  4. Click the down arrow and select New Topic.

Highlighted New Topic selection.

  1. 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.

  1. Click Next.
  2. Add a check to the following actions:
    • Identify Object by Name
    • Identify Record by Name
    • Query Records
    • Summarize Record
  3. Click Finish.
  4. If necessary, confirm that you’re about to use Einstein by clicking on Got it in the sidebar.
  5. Click Refresh (circular arrow) in the top right corner of the Conversation Preview.

The Conversation Preview withdow with the refresh button highligted.

  1. 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?
  2. 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.

  1. Click the back arrow to return to Setup.

Highlighted back arrow to get back to Setup.

  1. In Setup, search and select Prompt Builder.
  2. Click Generate Personalized Schedule under All Prompt Templates.
  3. 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}
  1. Click the Save As dropdown in the top right of the builder and select Save as a New Version.
  2. In the Preview panel, select Sofia Rodriguez as the Contact.
  3. Click Preview and see the populated Resolution and Response.
  4. 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.

  1. Click the back arrow button to navigate back to Setup.

Highlighted back arrow to return to Setup.

  1. In the Setup Quick Find, search for and select Agent Actions.
  2. Click +New Agent Action to create a new Action.
  3. Select Prompt Template as the Reference Action Type.
  4. 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).

  1. Leave the other options as is and click Next.
  2. 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.

  1. For the Prompt Response Output, check Show in conversation.
  2. 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.

  1. Create another new Action by clicking +New Agent Action.
  2. Select Flow as the Reference Action Type.
  3. Select Create Experience Session Booking.
  4. Leave the other options as is, and click Next.
  5. For Contact_Id, check Require Input.
  6. For Guests, check Require Input and Collect data from user.
  7. For Session_Id, check Require Input.
  8. For Booking output, check Show in conversation.
  9. For Output_Message output, check Show in conversation.

A configured action for Agent with designated checkboxes checked.

  1. Click Finish.

Assign the Custom Actions to the Agent

Put all the pieces together and add the custom actions to the Agentforce Service Agent.

  1. In the Setup Quick Find, search for and select Agents.
  2. Select Coral Cloud Agent.
  3. Click Open in Builder.
  4. Click the Experience Management topic.
  5. Click the This Topic’s Actions subtab.

This Topic’s Actions tab highlighted.

  1. Click the Add Action Icon (plus sign).
  2. Add a check to the Create Experience Session Booking Action and the Generate Personalized Schedule Action.
  3. Click Finish.
  4. Click the Topic Configuration subtab.
  5. Click New Instruction.

Topic Detail with New Instruction button highlighted.

  1. Configure the new 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.
  1. Click New Instruction again.
  2. 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.

Three completed constructions in the Topic Detail.

  1. Click Save.
  2. Click Refresh (circular arrow) in the top right corner of the Conversation Preview.

Highlighted refresh button in the Conversation Preview window.

  1. 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.
  2. Enter the following prompt: Can you tell me more about the Beach Bootcamp Challenge? and press your Return/Enter key.
  3. Enter the following prompt: Can you book Sofia into the Beach Bootcamp Challenge for today? and press your Return/Enter key.
  4. You may tweak the instructions until you are getting the correct results.
  5. 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.

  1. Click the back arrow button to navigate back to Agents Setup.
  2. Click Coral Cloud Agent.
  3. Click the edit icon next to the Agent User field.

Edit Agent User selected.

  1. Select Custom Agent User.
  2. Search for and select Coral Cloud Agent.
  3. 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 user.

Add the Agent to the Coral Cloud Site

  1. Search for Digital Experiences in the Setup Quick Find and select All Sites.
  2. Click Builder next to the coral-cloud site.
  3. Click the Components widget Components widget .
  4. Search Embedded Messaging and drag and drop the component on top of the Schedule section (scroll down to see the scheduled section). Note: exact placement is up to you and it may take a few seconds for the component to appear.

Embedded Messaging added to the Experience Cloud site.

  1. Leave the default settings.
  2. Click Publish in the upper right corner.
  3. Click Publish in the confirmation window.
  4. Click Got It.

View the Agent as a Customer

The big reveal. Time to interact with your new Agentforce Service Agent.

  1. Click the Experience Builder menu Experience Builder menu icon .
  2. 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 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?
Note

Agent not responding as expected? Try re-publishing the Experience Cloud site. The proper connection between the agent and the Experience Cloud site may take a few minutes on initial site publish.

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!

Resources

Comparta sus comentarios de Trailhead en la Ayuda de Salesforce.

Nos encantaría saber más sobre su experiencia con Trailhead. Ahora puede acceder al nuevo formulario de comentarios en cualquier momento en el sitio de Ayuda de Salesforce.

Más información Continuar a Compartir comentarios