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
- From the Agentforce setup page, select the Coral Cloud Experience Agent.
- From the Agent Builder, click Open in Builder.
- Click New > + New Topic.
- 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.
- Click Next.
- 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. |
- At the bottom, leave only two text boxes for instructions. Any additional text boxes can be deleted.
- 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. |
- 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.
- Select the Guest Issue Recovery topic.
- With the This Topic’s Actions subtab selected, click New > + Create New Action.
- Select Flow as the Reference Action Type.
- For Reference Action, select Get Customer Details.
- Leave the other options as is, and click Next.
- Uncheck the box labeled Show loading text for this action.
- For email, check Require Input.
- For memberNumber, check Require Input.
- For contact, check Show in conversation.
- 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.
- With the This Topic’s Actions subtab selected, click New > + Create New Action.
- Select Prompt Template, as the Reference Action Type.
- For Reference Action, select Guest Experience Compensation.
- Leave the other options as is and click Next.
- 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] |
- 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.