Skip to main content

This Badge Requires a New Custom Agentforce Playground

You’ll have limited time to complete this badge and any other badge requiring a Agentforce Playground. If you run out of time, you’ll lose access to this Playground and may need to start over.

Update a Flow, Agent Action, and Topic

Beyond prompt template customizing, Coral Cloud Resorts needs additional information added to its agent, which requires adjustment to flows, actions, and topics. As it pertains to agents, topics are categories of actions related to particular jobs to be done—these actions dictate what agents do. Actions can be based on flows, prompt templates, and more.

Basically, topics contain actions, and actions can use flows to execute tasks. And even after topics, actions, and flows are initially created and connected, they can always be edited or updated.

Update the Get Experience Details Flow

A flow can be triggered by an agent when it needs to retrieve some information. That means the agent uses this flow when it needs it. The Get Experience Details flow currently returns details about Coral Cloud Resorts experiences, but not the price of the experience. Here’s how to fix that.

  1. In the Setup Quick Find box, search for and select Flows.
  2. Scroll down and select the flow named Get Experience Details.
  3. Click the Get Experience by Name element.

Get Experience by Name element.

  1. Click Edit Element.
  2. On the right, scroll down to the bottom of the page and click the Add Field button.
  3. In the Field box, enter price, then select Price_c from the list.

Price_c field added to the element.

  1. Click on the Assign Experience Record element.

Assign Experience Record element.

  1. Click Edit Element.
  2. Change the description to: Assign an Experience__c record for presentation back to the user with details about the requested experience.
  3. Click Save As New Version then click Save in the Save As dialog box.
  4. Click Activate.
  5. Click the back arrow in Flow Builder to get back to Setup.

back arrow highlighted.

Update the Corresponding Agent Action

The Get Experience Details flow is updated, so the corresponding agent action now needs to be updated.

  1. In the Setup Quick Find, enter and select Agent Actions.
  2. Select the Get Experience Details action.
  3. Scroll down to the green box, click the pencil icon next to the instructions for the output variable called experienceRecord.

experienceRecord Instructions highlighted.

  1. Enter the new instructions: Assign an Experience__c record for presentation back to the user with details about the requested experience.
Note

This line of text was updated in Flow Builder. When creating a new action, the descriptions from the flow automatically get pulled in as input and output instructions. But since this is an existing action, the instructions need to be manually updated.

Updated experienceRecord Instructions.

  1. Click Save.

Update the Customer Experience Support Topic

The topic needs to know what details it can get from the action. Adding instructions to the topic makes that happen.

  1. In the Setup Quick Find, enter and select Agents.
  2. Select the Coral Cloud Experience Agent.
  3. Select Open in Builder.
  4. Ensure the agent is deactivated. If the button in the upper right says Deactivate, click it to deactivate the agent.
  5. Select the Customer Experience Support topic.
  6. Scroll down and click the Add Instructions button. This adds a sixth instruction textbox.
  7. Add the new instruction: If asked about an experience’s Name, Description, Activity Level, Type or Price, then call the Get_Experience_Details action.
Note

This is an example of being very specific about which action to use when certain topics are requested. This is one way to put guardrails on the agent, while still letting the AI interpret a user’s request to decide if what they’re requesting is something about an experience at the resort.

  1. Click Save.

Add the Generate Personalized Schedule Action

One last task. The agent needs the Generate Personalized Schedule action added to Customer Experience Support topic. This action uses the Generate Personalized Schedule prompt template that was customized earlier.

  1. Click Customer Experience Support topic.
  2. Click This Topic’s Actions.

This Topic’s Actions subtab highlighted.

  1. Click New and then select Add from Asset Library.

Add from Asset Library selection highlighted.

  1. Select the checkbox next to Generate Personalized Schedule. Note: This action is based on the Generate Personalized Schedule prompt that you edited earlier.

Checkbox next to Generate Personalized Scheduled checked.

  1. Click Finish.
  2. Click Activate above the Conversation Preview.

Test the Updates

Now that the flow, action, and topic have been updated, you can see all the moving parts of the agent in action.

  1. Click the refresh icon at the top of the Conversation Preview.

Conversation Preview refresh button highlighted.

  1. Enter this prompt to get it started: Can you generate a personalized schedule of experiences for me?
  2. After the agent responds, enter the next prompt: I am sofiarodriguez@example.com and my membership number is 10008155.

The Output on the Generate Personalized Schedule includes Sofia’s name, because it’s already come back from the LLM through the Einstein Trust Layer, and it has been de-masked.

  1. Pick one of the presented resort activities and ask for more details. For example: Tell me more about white water rafting. Note: Price is now included in the response because the price field was added to the Get Experience Details flow.
Note

If you’re curious, you can expand the Outputs window of the Get Experience Details action by dragging the corner of the window. There you see the Price_C variable near the end of the Output text. That’s what you added to the Get Experience Details flow.

Prompts, prompt templates, models, topics, actions, flows—all these features customize the agent to meet Coral Cloud Resorts’ unique needs. Their agent can now provide quick, personalized responses and answer routine inquiries.

It’s only fitting to prompt AI to summarize everything covered in these two steps:

Prompt: Summarize this Trailhead project.

Response: By following these steps, the Coral Cloud Resorts agent can better manage customer interactions autonomously, retrieve accurate resort information, and handle a wide range of inquiries. This enhances customer service efficiency, providing quick and consistent responses while reducing the workload on human agents.

Verify Step

+100 points

You’ll be completing this unit in your own Agentforce Playground.

This Badge Requires a New Custom Agentforce Playground

You’ll have limited time to complete this badge and any other badge requiring a Agentforce Playground. If you run out of time, you’ll lose access to this Playground and may need to start over.

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