By submitting you agree to receive a newsletter from Twistellar. You can unsubscribe anytime.
Since its release in October 2024, Agentforce has been proclaimed a huge CRM milestone with its turnkey AI Service Agents. While the official demos for Salesforce Agentforce look easy, there are unobvious configuration pitfalls that can lead to incorrectly functioning Agents or prevent you from creating one without specific configurations.
Following our recent article with Agentforce features overview, we’ve compiled an easy-to-follow, straightforward guide to building an Agentforce Service Agent. It will have a simple flow for creating a case after a customer request via a website chat.
Steps one to five outline the Service Agent creation, and steps six to ten describe how to embed and launch it for your customers to see and interact with.
How to Сreate a Service Agent in Salesforce?
Before building an Agent, make sure you have Einstein, Einstein Bots, Agents, Embedded Service Deployment, and Messaging enabled:
Click the gear icon in the upper right corner, select Setup.
In the Setup Quick Find on the left pane, search for and select Einstein Setup. Toggle Turn on Einstein.
Search for and select Einstein Bots. Toggle Einstein Bots to ensure it is on.
Search for and select Agents. Toggle Einstein Copilotfor Salesforce to ensure it is on.
To outline the order of actions Agent will take, let’s start by creating an Autolaunched Flow with input fields to create a сase (OpenFlow Builder—Setup—Quick Find box, find and select Flows—New Flow).
The flow should check for a contact in the system and create a new case. If necessary, you can simplify this step by removing the contact check. Here’s what it will look like:
Autolaunched Flow for Service Agent in Salesforce, image source: Trailhead
Create the following fields in this flow to make sure it relays all the necessary information about the case to your Salesforce org:
Variable with API Name = caseRecord, Data Type = 'Record', Object='Case' and enable 'Available for output'
Variable with API Name = contactRecord, Data Type = 'Record', Object='Contact' and enable 'Available for input'
Variable with API Name = caseDescription, Data Type = 'Text' and enable 'Available for input'
Variable with API Name = caseSubject, Data Type = 'Text' and enable 'Available for input'
Save and activate your flow.
2. Create an Agent Action
Next, click the New Agent Action button to create an Agent Action to connect the flow with the Agent in Setup—Agent Actions. You can also use a preexisting Create Case action, but creating an Action from scratch is better if you switch dependent flows.
Salesforce Service Agent Actions Settings, image source: Trailhead
3. Create an Agent
Let’s create an Agent which will execute the flow and the action above (Setup—Agent (Agent Studio)—New Agent).
Creating an Agent in Salesforce, image source: Trailhead
Select its type (Service Agent) and proceed to review and add the topics. For this Agent, we need to add Case Creation and Escalation ones.
Selecting Topics for a Service Agent in Salesforce, image source: Trailhead
Define the settings for the Agent.
Service Agent Settings in Salesforce Agent Builder, image source: Trailhead
You can add data for the knowledge articles in the next step, but it's unnecessary for this specific Agent.
4. Manage Permissions
In Setup—Agent Details, you can see an autogenerated user for this specific Agent that requires the Permission set.
Salesforce Agentforce Service Agent Details, image source: Trailhead
Create a permission set and assign it to the Einstein Service Agent User. A custom permission set should give read access to all fields in the Contact object and read/create/edit permissions for the Case object. We also need to grant edit access to all fields for the Case object.
Below are the permissions you will have to configure for the said user to administrate the Agent (Setup—Quick Find box—Permission Sets). Without the Permission Set, the Agent won’t be able to create and proceed with cases.
Permission Set for the Agentforce Service Agent in Salesforce, image source: Trailhead
Here’s how your Agent looks in Agent Builder. You can review the instructions inside the topic for relevance. For example, if the customer is not identifiable otherwise, make sure the Agent asks for the customer's email address to attach to the case.
You can test your Agent in the Conversation Preview pane. At this stage, it’s only available to you as an admin user.
Salesforce Agent Builder, image source: Trailhead
5. Add the Action to the Agent
Add the ‘Create Case’ action from Step 2 to the Agent. Deactivate the Agent in the Agent Builder, then switch to the tab ‘This Topic’s Actions,’ click New, and choose ‘Add from Asset Library’ to add the Action created in step 2.
Adding Actions for Agentforce Service Agent, image source: Trailhead
6. Create a Messaging Queue
Before the next step, please make sure to activate your Agent in Agent Builder.
Next, let’s create a Messaging Queue to manage the order in which the cases will be assigned to appropriate Agents in Setup—Queues. Later, the created instances will be assigned to this queue for processing.
Messaging Queue for Service Agent in Salesforce, image source: Trailhead
7. Create an Omni-Channel Flow for Case Routing
Let’s create an Omni-Channel Flow to control routing settings in OpenFlow—Builder—Setup—Quick Find box, find and select Flows under Process Automation.
Click the All + Templates tab. In the left pane, select Omni-Channel Flow. Edit the template to reflect your routing preferences. You can customize the flow to route chats, messages, or cases to Agents.
In this flow, create a Variable with API Name = recordId, Data Type = 'Text,' and Enable 'Available for input’. These parameters are necessary for the session with the customer to be searchable within the system.
Then, add a Route Work action to route the work item. This action is the last object in the flow. Save your flow and activate it.
Salesforce Omni-Channel Flow for Case Routing for Service Agent, image source: Trailhead
8. Set Up a Messaging Channel
To make sure customers have a way to interact with a Service Agent, let’s create a Channel in Setup—Messaging Settings—New Channel.
For now, choose Messaging for In-App and Web for your customers to contact the Agent on the website. Ensure the channel is active.
Setting Up a Messaging Channel for Salesforce Service Agent, image source: Trailhead
Pay close attention to the Omni-channel routing settings pane because they define which Agent is linked to this messaging queue.
Setting up a Messaging Channel for Salesforce Service Agent, image source: Trailhead
A channel cannot be assigned to multiple Agents, but a single Agent can be assigned to various channels. This way, you can distribute the load between the Agents according to their primary tasks, like customer support, order placement, etc., and avoid confusion.
Make sure the messaging channel is active before proceeding.
9. Create Embedded Service Deployment
Next, let’s create an Embedded Service deployment (Setup—Embedded Service Deployment) that will utilize the messaging channel connected to the Agent. Basically, it is a link between the customer-facing chat and your Agent.
Create Embedded Service Deployment for Salesforce Service Agent, image source: Trailhead
You must specify the domain where the interaction will take place and the messaging channel created earlier in step 8.
Create Embedded Service deploymentfor Salesforce Service Agent, image source: Trailhead
For reference, here’s where you can find your domains for Embedded Service Deployment (Setup—All Sites):
Domains for Embedded Service Deployment Salesforce, image source: Trailhead
In the next step, ensure the Web Deployment is Active and published. On this screen, you can review the settings and branding features if you have any, as well as pre-chat forms in case you ask for a name or other info before chatting. Hit the Publish button every time you make a change. Keep in mind that it might take up to 10 minutes to apply your changes.
Salesforce Embedded Service Deployment, image source: Trailhead
10. Deploy the Chat Feature on your Website
To deploy the chat on your website, go to Setup—All Sites—Builder, and add the Embedded Messaging component from the Components menu where you want it to be on the page.
Components Menu in Site Builder in Salesforce, image source: Trailhead
Embedded Messaging Component Settings in Salesforce Site Builder, image source: Trailhead
Click Publish.
11. Demo Your Service Agent
Now, you can test your Agent in your production environment. It might go like this:
Customer chat with Salesforce Service Agent, image source: Trailhead
As a result of this interaction, there’s the case created by the Agent in your Salesforce org:
Case Created by Salesforce Service Agent, image source: Trailhead
To Wrap Up
By following this guide, you can gain valuable insights on how to streamline your customer service operations with Agentforce.
Remember to test your configurations thoroughly to ensure everything runs smoothly.
For more information on Agentforce and its features, check out our Agentforce overview.
For any further assistance on configuring Service Agents in Salesforce, reach out to Twistellar. We have QuickStart packages available for you to kickstart Agentforce fully calibrated for your business use cases.
Twistellar's team has carried out a number of industry-oriented projects and we are always open to discuss yours!
Feeling like teaming up with us at Twistellar? We are excited too!Whether you'd like to customize your org, build a bespoke application or integrate a third-party tool, Twistellar is ready to help you.