Esta página no está disponible en español. Se muestra la versión en inglés.

Slack connector

Post messages and thread replies, add reactions, and read channels, history, and users in Slack from AgentRuntime workflows.

En esta página

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 for slack_get_users, and for slack_list_channels unless you set a channel list.
  • The project_contributor role or higher in your AgentRuntime workspace.

Connect in AgentRuntime

  1. 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:write to post messages and thread replies.
    • reactions:write to add reactions.
    • channels:read and groups:read to list public and private channels.
    • channels:history and groups:history to read channel history and thread replies.
    • users:read to 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.

  2. Find your team ID

    The team ID looks like T0123456789. One way to get it is to call Slack's auth.test method with your token; the response includes team_id. Slack's documentation explains the call.

  3. 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 your xoxb- 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.

  4. 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.

  5. 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.

  6. Smoke test

    In Workflow Studio, add a connector tools step that calls slack_list_channels and run it to see the channels. Then call slack_post_message to 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_message to 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_thread when 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_history and slack_get_thread_replies, then ask an LLM step to summarize decisions or open questions.

Tools

ToolWhat it does
slack_post_messagePost a message to a channel or direct message. Posts to Slack.
slack_reply_to_threadReply to a message thread. Posts to Slack.
slack_add_reactionAdd an emoji reaction to a message. Changes data.
slack_list_channelsList public and private channels, or only the channels in your configured list.
slack_get_channel_historyRead recent messages from a channel, newest first.
slack_get_thread_repliesRead all replies in a thread.
slack_get_usersList users in your Slack workspace.
slack_get_user_profileGet 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 as C0123456789) and text, both required. Returns the channel and message timestamp ts.
  • slack_reply_to_thread: channel_id, thread_ts (the parent message's ts), and text, all required.
  • slack_add_reaction: channel_id, timestamp (the message's ts), and reaction (the emoji name without colons, such as thumbsup), all required.
  • slack_list_channels: optional limit (default 100, maximum 200) and cursor for the next page.
  • slack_get_channel_history: channel_id (required) and limit (default 10). Returns messages and has_more.
  • slack_get_thread_replies: channel_id and thread_ts, both required. The result includes the parent message.
  • slack_get_users: optional limit (default 100, maximum 200) and cursor.
  • slack_get_user_profile: user_id (required, such as U0123456789).

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.

KeyRequiredDescription
slack_api_tokenYesSlack bot token (xoxb-). A user token (xoxp-) is also accepted, but a bot token is the safer choice for automation.
slack_team_idSee descriptionYour Slack workspace ID (T...). Required for slack_get_users, and for slack_list_channels when slack_channel_ids is empty.
slack_channel_idsNoComma-separated channel IDs. When set, slack_list_channels returns only these channels (skipping archived ones) instead of listing the whole workspace.
slack_api_baseNoSlack Web API address. Default https://slack.com/api. Normally leave it empty.

Troubleshooting

IssueFix
resolved config is missing api_tokenThe 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 configAdd slack_team_id to the connection, or for slack_list_channels set slack_channel_ids.
Slack API error: not_in_channelInvite the bot to the channel with /invite @YourAppName.
Slack API error: channel_not_foundThe 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_scopeAdd the scope that Slack names in the error under OAuth & Permissions, then reinstall the app.
Slack API error: invalid_auth or token_revokedThe token is wrong or was revoked. Reinstall the app, copy the new token, and use Rotate on the connection.
Editar esta páginaagentruntime-io/agentruntime-docs