Slack connector
Post messages and thread replies, add reactions, and read channels, history, and users in Slack from AgentRuntime workflows.
On this page
Slack is a team messaging app. The slack connector lets workflow steps post to channels, reply in threads, add emoji reactions, and read channel history, thread replies, and user profiles, using a Slack app (bot) that you create and install in your Slack workspace.
Typical uses: post an alert when a workflow fails, send a daily digest to a team channel, and pull recent channel messages into an LLM step for a summary.
Prerequisites
- A Slack workspace where you can create and install an app (or an admin who can do it for you).
- A Slack app with a Bot User OAuth Token (it starts with
xoxb-). The steps below show how to get one. - Your Slack workspace (team) ID, which starts with
T. The connector needs it forslack_get_users, and forslack_list_channelsunless you set a channel list. - The project_contributor role or higher in your AgentRuntime workspace.
Connect in AgentRuntime
- Create a Slack app and get a bot token
Go to api.slack.com/apps, click Create New App, choose From scratch, name it, and pick your workspace. Open OAuth & Permissions and add Bot Token Scopes for what you plan to do. Slack documents these scopes for the Web API methods the connector calls:
chat:writeto post messages and thread replies.reactions:writeto add reactions.channels:readandgroups:readto list public and private channels.channels:historyandgroups:historyto read channel history and thread replies.users:readto list users and read profiles.
Then click Install to Workspace, approve, and copy the Bot User OAuth Token. If you change scopes later, reinstall the app.
- Find your team ID
The team ID looks like
T0123456789. One way to get it is to call Slack'sauth.testmethod with your token; the response includesteam_id. Slack's documentation explains the call. - Create a connection
Open Connections in the Console and click New custom connection. Enter a Display name (for example
Slack). Under Credentials, add one row per setting, using Add field for more rows:- Key
slack_api_token, Value yourxoxb-token. - Key
slack_team_id, Value your team ID.
Click Save. The dialog also asks who can use the connection; choose the option that fits your team. See Authentication.
- Key
- Add the slack MCP instance
Open MCP, click Add connectors, find slack, and add it to your workspace. Open the instance, and on Instance config create or open a profile, choose your connection in the Connection picker, set the profile Status to Active, and click Save, then Use this profile for workflows.
- Invite the bot to your channels
In Slack, open each channel the bot should use and type
/invite @YourAppName. A bot generally cannot post to or read a channel it has not joined. - Smoke test
In Workflow Studio, add a connector tools step that calls
slack_list_channelsand run it to see the channels. Then callslack_post_messageto a test channel (see the example below).
What you can build
- Alert routing. When a workflow fails or a metric crosses a threshold, call
slack_post_messageto your alerts channel. - Human task notices. When a human step is waiting, post a message so the right person sees it, and reply in the same thread with
slack_reply_to_threadwhen it is resolved. - Daily digest. Gather news or metrics, let an LLM step write a short summary, and post it each morning.
- Channel summaries. Read
slack_get_channel_historyandslack_get_thread_replies, then ask an LLM step to summarize decisions or open questions.
Tools
| Tool | What it does |
|---|---|
slack_post_message | Post a message to a channel or direct message. Posts to Slack. |
slack_reply_to_thread | Reply to a message thread. Posts to Slack. |
slack_add_reaction | Add an emoji reaction to a message. Changes data. |
slack_list_channels | List public and private channels, or only the channels in your configured list. |
slack_get_channel_history | Read recent messages from a channel, newest first. |
slack_get_thread_replies | Read all replies in a thread. |
slack_get_users | List users in your Slack workspace. |
slack_get_user_profile | Get one user's profile. |
The first three tools write to Slack. The other five only read.
Parameters:
slack_post_message:channel_id(the channel or user ID, such asC0123456789) andtext, both required. Returns thechanneland message timestampts.slack_reply_to_thread:channel_id,thread_ts(the parent message'sts), andtext, all required.slack_add_reaction:channel_id,timestamp(the message'sts), andreaction(the emoji name without colons, such asthumbsup), all required.slack_list_channels: optionallimit(default 100, maximum 200) andcursorfor the next page.slack_get_channel_history:channel_id(required) andlimit(default 10). Returnsmessagesandhas_more.slack_get_thread_replies:channel_idandthread_ts, both required. The result includes the parent message.slack_get_users: optionallimit(default 100, maximum 200) andcursor.slack_get_user_profile:user_id(required, such asU0123456789).
To find a channel's ID in Slack, open the channel's details; the ID is shown at the bottom of the About tab.
Example
Post an alert to a channel:
{
"id": "slack-notify",
"type": "mcp",
"name": "Notify Slack channel",
"instance_id": "YOUR_SLACK_INSTANCE_ID",
"tool_name": "slack_post_message",
"tool_args": {
"channel_id": "C0123456789",
"text": "Deploy {{input.version}} completed successfully."
},
"timeout_s": 30
}In Studio you pick the instance and tool from lists, and Studio fills in instance_id.
Configuration
These are the settings on the instance's config profile. When you use a connection, give its credential rows the same key names. Published key names carry the slack_ prefix.
| Key | Required | Description |
|---|---|---|
slack_api_token | Yes | Slack bot token (xoxb-). A user token (xoxp-) is also accepted, but a bot token is the safer choice for automation. |
slack_team_id | See description | Your Slack workspace ID (T...). Required for slack_get_users, and for slack_list_channels when slack_channel_ids is empty. |
slack_channel_ids | No | Comma-separated channel IDs. When set, slack_list_channels returns only these channels (skipping archived ones) instead of listing the whole workspace. |
slack_api_base | No | Slack Web API address. Default https://slack.com/api. Normally leave it empty. |
Troubleshooting
| Issue | Fix |
|---|---|
resolved config is missing api_token | The active profile has no token. Add the slack_api_token row to the connection and check the profile is Active. |
team_id is required in config | Add slack_team_id to the connection, or for slack_list_channels set slack_channel_ids. |
Slack API error: not_in_channel | Invite the bot to the channel with /invite @YourAppName. |
Slack API error: channel_not_found | The channel_id is wrong, or the bot cannot see that private channel. Use the channel's ID (usually starting with C), not its name, and invite the bot. |
Slack API error: missing_scope | Add the scope that Slack names in the error under OAuth & Permissions, then reinstall the app. |
Slack API error: invalid_auth or token_revoked | The token is wrong or was revoked. Reinstall the app, copy the new token, and use Rotate on the connection. |