Skip to main content

Configure a Slack Agent in Salesforce

Learning Objectives

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

  • Add Slack actions to an agent.
  • Add instructions for Slack actions.
  • Activate an agent in Salesforce.
  • Connect an agent in Salesforce to Slack.

Configure an Agent with Slack Actions

Let’s follow Sofia as she configures Agentforce with Slack actions in preparation to deploy the agent to Slack. You’ll want to follow along with the steps outlined in this unit to pass the challenge at the end.

Sofia is a Salesforce and Slack Admin who manages a Product Specialist agent in Agentforce. She wants to incorporate this existing agent into Slack. At Sofia’s organization, many employees need product updates and ask questions to get their jobs done. There’s a lot of helpful product information in Slack channels, but sometimes multiple channels exist or messages get lost, making it difficult for employees to quickly find the answers they need.

Sofia’s portrait, a Salesforcelandian.

Sofia has seen examples of how a Product Specialist agent should interact with users in Slack. When she goes into Agentforce Builder to configure the agent’s actions, she'll be using this example as the model for her agent’s capabilities in Slack.

When an agent is mentioned in a channel, it automatically starts a thread where any channel member can follow and participate in the conversation.

In this example, the Product Specialist agent is mentioned with a question and provides an instant response in a thread that all channel members can benefit from. The agent acts in Slack to create a new canvas and add this information for future reference.

Launch Your Agentforce Org

In the project, Connect Your Agentforce Org with Slack, you provisioned your special Agentforce Developer Edition org and integrated it with Slack. It’s time for Sofia to enable the Product Specialist agent in that org with Slack actions.

  1. Open your special Agentforce org by scrolling down to the hands-on challenge.
  2. Under Choose your hands-on org, ensure your special Agentforce Developer Edition org from Connect Your Agentforce Org with Slack is selected.
  3. Then, click Launch.

Add Slack Actions and Test Your Agent

This is the perfect opportunity for Sofia to add Slack actions to the Product Specialist agent in Agentforce Builder. Let’s see what she does.

  1. Click Setup and click Setup. The Setup page opens in a new tab.
  2. In the Quick Find box, search for and select Agentforce Agents.
  3. Click the agent name TH Product Specialist.
  4. Click Open in Builder.
  5. Click the topic Product Gaps.

Agentforce Builder opens to the existing topics assigned to the agent; Product Gaps topic is highlighted by an orange arrow.

  1. Click the This Topic's Actions subtab under Topic Details.
  2. Click New.
  3. Then click Add from Asset Library.
  4. Search for and select several Slack actions that enable the TH Product Specialist to search public content and create canvases in Slack.
    • Create a Slack Canvas
    • Update a Slack Canvas
    • Search Slack
    • Send a Slack Direct Message
  5. Click Finish.

Standard Slack actions have been added to the list of actions the TH Product Specialist agent can take. They’re highlighted by an orange box and arrow.

While the TH Product Specialist agent now has Slack actions it can take, there’s no context for them yet. Sofia needs to enable the agent on when to use these actions. This is done via instructions under the Topic Configuration subtab. Let’s go there now.

Add Instructions for Slack Actions

Sofia uses agent topic instructions and agent action instructions to create boundaries, set context, and define agent behavior. Each agent will have their own set of instructions and settings to dictate how they operate. In all cases, AI agents respect standard Salesforce access controls, such as licenses, permissions, field-level security, and sharing settings, ensuring secure operations.

  1. In Agentforce Builder for TH Product Specialist, click the topic Product Gaps.
  2. Within the Topic Details, click the Topic Configuration subtab.
  3. Scroll down to the end of the topic instructions, and click Add Instructions.
  4. Enter this info as new instructions:
    • If the user requests to add the product gap details to a canvas, then create a canvas in Slack.
  5. Click Add Instructions once more.
    • Always ask for a title when a user asks you to create a canvas.
  6. Click Save.

Test the Agent

Use the Conversation Preview in Agentforce Builder to enter realistic prompts and check the agent’s outputs. Testing before activating and deploying is crucial to ensure that your agent functions correctly and reliably. By identifying and fixing issues, removing duplicates, and refining the agent’s components, you can enhance its performance and user experience. This process also helps build trust and ensures the agent is accurate, unbiased, and secure.

  1. In the Conversation Preview panel, click Refresh to refresh the agent so it can access the new instructions and Slack actions.
  2. Walk the agent through creating a product gap case. Remember, clear and detailed instructions for what you want the agent to do work best. You can copy one of the following examples to start the chat:
    • Log a product gap for the Trailhead Escape Room badge. Bring it back!
    • Product gap for a new business unit. We’re expanding!
    • I want to automate the bookings process. Please log a gap.

Conversation Preview with the admin requesting a product gap for a new business unit and app; the admin offers clear details about what she wants the agent to do, which is log a product gap, and how a new app can use the existing one as a template; in response, the agent logged a case and responded with the case details.

The test goes well. But when Sofia asks the agent to create a canvas, there’s an error. This is expected since she’s testing in her Salesforce org. This needs to be done in Slack.

Note

Limited Output

Due to the limited configuration of this agent for playground purposes, you might not receive accurate responses to all Product Specialist agent queries. Follow the instructions in the challenges to understand what outputs you can expect from this agent.

Activate the Agent

Once an agent is activated, it becomes instantly accessible to your users wherever it’s been shared. To modify a live agent (for example, adding or removing topics or actions), you need to deactivate it first. This ensures that updates can be made without interrupting the agent’s ongoing functions. After making the necessary changes, you can reactivate the agent to implement the new settings.

  1. From Agentforce Builder, click Activate.
  2. Click the back arrow to exit the builder, back into Setup.

Connect Your Agent to Slack

Once Sofia’s agent is configured with all the topics, actions, and guardrails for her Product Specialist use case, she establishes a connection to Slack for her agent in Salesforce. Note that we don’t check this in the challenge, but it’s a critical step to successfully deploy the agent to Slack and earn the badge.

  1. Click the agent TH Product Specialist.
  2. Click the Connections subtab.
  3. Scroll down to the Connections section, and click Add.
  4. In the modal, configure the Connection as follows:
    • Connection: API
    • Integration Name: SlackProductSpecialistAgent
    • Connected App: Slack

The modal for adding a connection asks for the connection type, the integration name, and the connected app.

  1. Click Save.

By saving the connection, Sofia makes the agent available to install in the associated Slack org. Sofia happens to be the Slack admin at her organization. If you are not a Slack admin, enlist their help to complete the next unit.

Resources

在 Salesforce 帮助中分享 Trailhead 反馈

我们很想听听您使用 Trailhead 的经验——您现在可以随时从 Salesforce 帮助网站访问新的反馈表单。

了解更多 继续分享反馈