Contact Us

January 11, 2025

May 13, 2026 3:57 pm

Sending a Slack Message from Agentforce Script

Share with

Understanding Agentforce and Slack Integration

Agentforce provides an out-of-the-box (OOB) Slack topic that enables users to send messages to Slack channels. However, to use this feature, a Slack team must be connected, and the token must be properly configured. The token error encountered by the community member indicates that the token was not correctly fetched or configured.

The root cause of the token error is the incorrect or missing configuration of the Slack token within the Agentforce script. This can occur if the Slack team is not properly connected or if the token is not correctly specified in the script.

Configuring the Slack Token in Agentforce

To resolve the token error, the community member needs to ensure that the Slack team is connected and the token is correctly configured in the Agentforce script. This can be achieved by following the steps outlined in the Agentforce documentation for Slack integration.

Once the Slack team is connected, and the token is correctly configured, the community member should be able to send Slack messages from their Agentforce script without encountering token errors.

Step-by-Step Solution

To send a Slack message from an Agentforce script, follow these steps:

Agentforce Script

// Ensure the Slack team is connected
// Configure the Slack token in the Agentforce script
// Use the Slack OOB topic to send the message

Heads up: Make sure to handle any errors that may occur during the token configuration or message sending process.

Checklist for Resolving Token Errors

Preventing Token Errors

  • Ensure the Slack team is properly connected
  • Configure the Slack token correctly in the Agentforce script
  • Use the Slack OOB topic to send messages
  • Handle any errors that may occur during token configuration or message sending
  • Verify the Slack channel ID and message content before sending

Frequently Asked Questions

What is the cause of the token error?

The token error is caused by the incorrect or missing configuration of the Slack token within the Agentforce script.

How do I configure the Slack token in Agentforce?

The Slack token can be configured by following the steps outlined in the Agentforce documentation for Slack integration.

Can I use a flow action to send a Slack message?

Yes, you can use a flow action to send a Slack message, but you will still need to ensure that the Slack team is connected and the token is correctly configured.

What if I encounter an error during token configuration or message sending?

If you encounter an error, make sure to handle it properly and verify the Slack channel ID and message content before retrying.

Genetrix Technology · Salesforce Marketing Cloud Partner

Need help shipping this in production?

Genetrix builds and untangles Salesforce Marketing Cloud and Agentforce setups for teams that want it done right the first time. If anything in this post sounds familiar, talk to us before it ships.

Get in Touch with Genetrix →

Blogs for the

Business-Savvy!​

Let’s Connect

A 30 min no cost strategy session
with cloud support expert

Let’s Connect

A 30 min no cost strategy session
with cloud support expert