Skip to main content

予想時間

トピック

コミュニティに質問

Bring Your Prompt to Life with Agent Actions

Learning Objectives

After completing this unit, you’ll be able to:

  • List the benefits of using structured prompts in Agentforce.
  • Describe how to enable and configure Agentforce for user interaction in Salesforce.
  • Explain how prompt templates enhance agent workflows.

Connect the Dots Between Prompt Builder and Agents

In the first unit, you explored the concept of prompt engineering and how well-crafted prompts help ensure that your agent delivers accurate, consistent, and helpful responses. You also learned how to create a prompt that drafts a personalized message with compensation options for guests experiencing issues.

Set Up An Agent

Now that you understand the importance of automation in resolving guest complaints, let’s see how Becca sets up Agentforce and tailors it to meet her needs. With Agentforce’s flexibility, she can automate a variety of tasks to provide consistent, efficient guest interactions across every touchpoint.

Enable Agentforce

Her first step is enabling Agentforce.

  • In the Setup Quick Find box, search for and select Agentforce Agents.
  • Click the Agentforce toggle and verify that it’s set to On.
  • Click the Enable the Agentforce (Default) Agent toggle and set it to On.

Create a Custom Topic with Actions in Agentforce

Once Agentforce is activated, she can begin configuring it to use her prompt template. She does this by adding custom topics and actions to define how the agent responds to guests complaints.

Add a Custom Topic

  1. From the Agentforce setup page, select the Coral Cloud Experience Agent.
  2. From the Agent Builder, click Open in Builder.
  3. Click New > + New Topic.
Note

If the New button doesn’t appear, return to the agent setup page and toggle Agentforce off and back on.

  1. In the modal for What do you want this topic to do, enter or type Handles guest issues by providing personalized recovery options based on an open case.
  2. Click Next.
  3. Configure Create a Topic as follows, replacing the placeholder text in these fields:

Field

Value

Name

Guest Issue Recovery

Classification Description

Handles guest issues by providing personalized recovery options based on an open case

Scope

Your job is only to assist in resolving guest issues by offering tailored recovery options based on the details of open cases.
  1. At the bottom, leave only two text boxes for instructions. Any additional text boxes can be deleted.
  2. Add these instructions, replacing the placeholder text:

Field

Value

1st Instruction

If a guest sends a negative message about the resort experience or event, run the ’Guest Experience Compensation’ action. Always ensure you know the customer before running this action. If the response returns saying that a case does not exist, inform the user and provide an empathetic response to the guest’s concerns.

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.
  1. Click Next and Finish.

Next, for this topic, she creates two custom actions.

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. Select the Guest Issue Recovery topic.
  2. With the This Topic’s Actions subtab selected, click New > + Create New Action.
  3. Select Flow as the Reference Action Type.
  4. For Reference Action, select Get Customer Details.
  5. Leave the other options as is, and click Next.
  6. Uncheck the box labeled Show loading text for this action.
  7. For email, check Require Input.
  8. For memberNumber, check Require Input.
  9. For contact, check Show in conversation.
  10. Click Finish.

Create an Action to Use the Prompt Template

Now, Becca brings in the prompt template. Just like flows or Apex, prompts are also available as actions for an agent. When agents are paired with prompt templates, they gain an intelligent layer, enabling them to make smarter decisions. Even though agents can invoke LLMs and search on their own, prompt templates give agents direction and structure, ensuring the agent knows exactly what data to fetch and how to present it.

  1. With the This Topic’s Actions subtab selected, click New > + Create New Action.
  2. Select Prompt Template, as the Reference Action Type.
  3. For Reference Action, select Guest Experience Compensation.
Note

If the Guest Experience Compensation prompt template isn’t listed, return to Prompt Builder to confirm it’s activated, and then refresh the page.

  1. Leave the other options as is and click Next.
  2. Configure the agent actions as follows, replacing any placeholder text:

Field

Value

Agent Action Instructions

Provide the options the customer has after a grievance about their experience. Do not modify any of the guest options from the response. Do not include that there are tiers to guest resolution gifts.

Show loading text for this action

[uncheck]

Complaint Input Instruction

Use the text received from the guest complaint in the chat.

Contact Input Instructions

Input will be the contact record and this contact record will be passed through another flow.

Output Instructions in the Prompt Response

The prompt response generated by the action based on the specified prompt and input.

Show in conversation

[check]

  1. Click Finish.

By connecting her prompt template with an agent in Agentforce, Becca has set up a powerful automation loop that takes in guest complaints and generates tailored responses. But right now, the prompt template isn’t delivering consistent results—and that’s by design. In the next unit, Becca tests her agent’s behavior, identifies what’s going wrong, and refines the prompt template to ensure it responds accurately and responsibly in every situation.

Salesforce ヘルプで Trailhead のフィードバックを共有してください。

Trailhead についての感想をお聞かせください。[Salesforce ヘルプ] サイトから新しいフィードバックフォームにいつでもアクセスできるようになりました。

詳細はこちら フィードバックの共有に進む