Skip to main content
Build the future with Agentforce at TDX in San Francisco or on Salesforce+ on March 5–6. Register now.

Configure an Agentforce Service Agent

In this project, you’ll:

  • Create an Agentforce Service Agent through guided setup.
  • Associate topics and actions to the Service Agent.
  • Build custom agent actions with flows.
  • Update an existing deployment flow.

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 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 experience availability, booking, and more.

Enable Agents, Publish the Experience Cloud Site, 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. Refresh your browser to reload Setup.
  5. In the Setup Quick Find, search for and select Agents.
  6. Click the Einstein Copilot for Salesforce toggle, and ensure it is set to On.

Einstein Copilot for Salesforce toggle set to On.

Publish the Experience Cloud Site

The agent is deployed via Coral Cloud’s Experience Cloud site. To prepare for deployment, get the Experience Cloud site ready for the new agent.

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

Add a Permission Set to the Agent’s User Profile

The new agent will have a user profile associated with it. However, additional permissions need to be added to this user profile.

  1. Search for Users in the Setup Quick Find and select Users.
  2. Select the EinsteinServiceAgent User.
  3. Scroll down to the Permission Set Assignments section and click Edit Assignments.
  4. Select the Service Agent Permissions Permission Set and click the add arrow to add to the Enabled Permission Sets list.
    Note: There should now be two listings in the Enabled Permission Sets list: Agentforce Service Agent User and Service Agent Permissions.
  5. Click Save.

Create the Agent

The first step in creating an agent is the guided setup. This setup process walks through creating an agent, associating topics, and more. Topics define the range of jobs your agents and copilot can handle. Actions are the tools they can use to get the jobs done. For example, if a client asks about a topic, what action(s) should the agent produce?

  1. In the Setup Quick Find, search for and select Agents.
  2. Click + New Agent. Note: If the New Agent button is not present, refresh the page until the button appears.

New Agent button highlighted.

  1. Select Agentforce Service Agent as the type.
  2. Click Next.
  3. Unselect these topics (click the Added button) so that General FAQ is the only remaining topic:
    • Case Management
    • Account Management
    • Reservation Management
    • Delivery Issues
    • Order Inquiries
    • Escalation
  4. Feel free to review the prebuilt action for the General FAQ topic by clicking See Included Actions. Click Next.
  5. Change the Name to CC Service Agent and ensure the API Name updates to CC_Service_Agent.
  6. Enter this info for Company: Coral Cloud Resorts provides customers with exceptional destination activities, unforgettable experiences, and reservation services, all backed by a commitment to top-notch customer service.
  7. Select EinsteinServiceAgent as the User Agent.
  8. IMPORTANT: Before you proceed, double check that the agent name and API name are exactly like they are listed in step 7 above, then click Next.
  9. For now, Data Cloud won’t be used. Click Create.

Add Custom Topics and Actions

Topics and actions can be created and customized using Agent Builder. Note: It’s not recommended to use the standard query and summarization actions with a public facing agent, so instead use custom actions to interact with the data.

  1. From the Agent Builder, click New and select New Topic. Note: If the New button does not appear, try toggling the Einstein Copilot for Salesforce on the agent setup page and refreshing the page.

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 Activities or Experiences, you should run the action 'Get Experience Details' and then summarize the results with improved readability. Always ensure you know the customer before running this action.
  1. Leave everything else as is and click Next.
  2. Custom actions will be added to this topic so skip adding any of the standard actions and click Finish.

Add the Get Experience Details Action to the Agent

Create and attach the Get Experience Details action to the Experience Management topic so the agent can produce details about each experience.

  1. Click the Experience Management topic.
  2. Click the This Topic’s Actions subtab.

This Topic’s Actions tab highlighted.

  1. Click New and select Add Action.
  2. Select Flow as the Reference Action Type.
  3. Select Get Experience Details.
  4. Leave the other options as is, and click Next.
  5. For experienceName, check Require Input.
  6. For experienceRecord, check Show in conversation.

A configured action for agent with designated checkboxes checked.

  1. Click Finish. Note: If the API name is already in use error appears, it is because this action has already been created. Return to the New Action button and select Add from Asset Library.

Add an Action to Validate Customer Details

For security purposes, the agent needs to validate that the customer is who they say they are. In this case, the agent validates key contact details such as email and membership number.

  1. With the This Topic’s Actions subtab still selected, click New and select Add Action.
  2. Select Flow as the Reference Action Type.
  3. Select Get Customer Details.
  4. Leave the other options as is, and click Next.
  5. For email, check Require Input.
  6. For memberNumber, check Require Input.
  7. For contact, check Show in conversation.
  8. Click Finish.

Add an Action to Get Session Records

Use the Get Sessions flow to get the available session records for each experience.

  1. With the This Topic’s Actions subtab still selected, click New and select Add Action.
  2. Select Flow as the Reference Action Type.
  3. Select Get Sessions.
  4. Leave the other options as is, and click Next.
  5. For experienceId, check Require Input.
  6. For startDate, check Require Input.
  7. For sessions, check Show in conversation.
  8. Click Finish.

Add an Action to Generate a Personalized Schedule

The 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. With the This Topic’s Actions subtab still selected, click New and select Add Action.
  2. Select Prompt Template as the Reference Action Type.
  3. Select Generate Personalized Schedule as the Reference Action.
  4. Leave the other options as is and click Next.
  5. 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 Get Customer Details action.
  1. For the Prompt Response Output, check Show in conversation.
  2. Click Finish.

Add an Action to Create a Booking

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. Click New and select Add 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.
  10. Click Finish.

Provide the Agent with Instructions to Choose the Correct Action

Put all the pieces together and add instructions to the topic.

  1. Click the Topic Configuration subtab.
  2. At the bottom, click Add Instructions five (5) times. This will create five blank instruction text boxes under the prepopulated first instruction.
  3. Add these Instructions:

Field

Value

1st Instruction

[leave as is]

2nd Instruction

If the customer is not known, you must always ask for their email address and their membership number to get their Contact record by running the action 'Get Customer Details' before running any other actions.

3rd Instruction

Whenever a date is provided, convert the date to YYYY-MM-DD format and ensure that the date is not in the past before using it for the 'Get Sessions' action. If a past date is provided, explain to the client the date must be future.

4th Instruction

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'. Do not use the experience name, this must be an ID.

5th Instruction

If asked to book, use the action 'Create Booking'. The Contact__c is the contact ID from the 'Get Customer Details'. 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 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.

6th Instruction

If asked to recommend experiences that a user might be interested in, use the 'Generate Personalized Schedule' Action to generate a schedule based on a contacts interests. Use the contact record from 'Get Customer Details' and pass it into the Contact input.
  1. Click Save.
  2. Click Activate.

Activate button highlighted.

Test the Agent

Start a conversation to preview how your agent builds a plan and executes actions based on user interactions. As interactions happen with the agent, notice the panel in the middle of the screen that displays exactly what the agent is executing.

  1. While still in the Agent Builder, click Refresh (circular arrow) in the top right corner of the Conversation Preview.

The Conversation Preview window with the refresh button highlighted.

  1. Don't worry if the dots are spinning in the Conversation Preview, go ahead and enter this prompt: Can you let me know more about the full moon beach party experience? and press your Return/Enter key.
  2. Reminder: email address is sofiarodriguez@example.com and 10008155 is the membership number. Press your Return/Enter key. Keep answering the agent’s questions and book a session.
  3. Click the back arrow to return to Setup.

Highlighted back arrow to get back to Setup.

Publish and Update

Publish the web deployment and update the flow.

  1. In the Setup Quick Find, search for and select Embedded Service Deployments.
  2. Select the ESA Web Deployment.
  3. 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.

Re-route the Flow

Now update the existing flow to route work to the newly created Service Agent.

  1. In the Setup Quick Find, search for and select Flows.
  2. Click on the Route to ESA flow.
  3. Click the Route to ESA component Route to ESA component and select Edit Element.
  4. Select these values in the Set Input Values section:

Field

Value

Route To

Agentforce Service Agent

Agentforce Service Agent

CC Service Agent

Note: If CC Service Agent doesn’t show up as an option, return to Agent Builder for the CC Service Agent and make sure it’s activated.

  1. Click Save As New Version.
  2. Keep everything as is and click Save.
  3. Click Activate.
  4. Click the back arrow to return to Setup.

Back arrow highlighted in the Flow Builder.

Add the Agent to the Coral Cloud Site

Lastly, embed the chat component to the Coral Cloud Experience Cloud site.

  1. In the Setup Quick Find, search 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 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.

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 the new agent.

  1. Click the Experience Builder menu Experience Builder menu icon .
  2. Select View coral-cloud to open the published coral cloud 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.
  3. Click on the Messaging icon messaging icon in the lower right corner to start interacting with the new agent. Wait for the agent to say hi and then try out the following prompt:
    • Can you let me know about the Underground Cave Exploration?
    • Reminder: email address is sofiarodriguez@example.com and 10008155 is the membership number.
    • Keep answering the agent’s questions and book a session.
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

Share your Trailhead feedback over on Salesforce Help.

We'd love to hear about your experience with Trailhead - you can now access the new feedback form anytime from the Salesforce Help site.

Learn More Continue to Share Feedback