Skip to main content
Trinity
Guides/Slack Integration

Slack Integration

Connect agents to Slack workspaces. Supports DMs, @mentions in channels, multi-agent routing, and thread continuity.

Key Concepts

Channel Adapter — Pluggable abstraction for external messaging platforms. Slack is the first implementation; Telegram and Discord are planned.
Socket Mode — Default transport using a WebSocket connection. No public URL required. Configured via a Slack App Token (xapp-...).
Webhook Mode — HTTP webhook transport for production environments (fallback option).
Multi-Agent Routing — Multiple agents can share one Slack workspace. Each agent is bound to a dedicated channel. DMs are routed to a default agent; @mentions route to the bound agent.
Thread Tracking — The bot automatically responds to thread replies without requiring an @mention.

Platform Setup (Admin)

1

Go to Settings > Slack section.

2

Enter your Slack App Token (xapp-...) for Socket Mode.

3

Click Connect to start the Socket Mode transport.

4

Click Install to Workspace to perform platform-level OAuth and obtain a bot token.

5

The connection status badge shows connected or disconnected.

Per-Agent Channel Binding

1

Open the agent detail page and select the Sharing tab.

2

In the Slack Channel section, click Create Channel.

3

A dedicated Slack channel is created and bound to this agent. All messages in that channel are routed to the bound agent.

4

To disconnect, click Unbind.

Changing the DM-Default Agent

DMs to the Slack bot are routed to the workspace's DM-default agent. By default the first agent bound to a workspace becomes the DM default, but you can reassign it at any time.

To reassign

1

Open the agent detail page for the agent you want to receive DMs

2

Go to the Sharing tab → Slack Channel section

3

Click Set as DM Default

4

The previous DM-default agent retains its channel binding but no longer receives DMs

Rules

Only one agent per workspace can be the DM default at a time
You cannot unbind the current DM-default agent while other agents are still bound to the workspace. Reassign the DM default to another agent first, then unbind
Changing the DM default takes effect immediately — no restart required

Message Flow

Transport -> Adapter -> Router -> Agent -> Response
Message TypeRouting
DM to botDefault agent
@mention in channelBound agent for that channel
Thread reply (no @mention)Same agent that was originally mentioned

Rate Limiting

SettingDefault
Messages per window per Slack user30
Window duration60 seconds
Execution timeout120 seconds
Allowed toolsWebSearch, WebFetch

Rate limit and timeout values are configurable via settings (channel_rate_limit_max, channel_rate_limit_window).

Slack API

EndpointMethodDescription
/api/settings/slack/statusGETConnection state
/api/settings/slack/connectPOSTStart Socket Mode
/api/settings/slack/disconnectPOSTStop transport
/api/settings/slack/installPOSTOAuth install
/api/agents/{name}/slack/channelGETChannel binding status
/api/agents/{name}/slack/channelPOSTCreate and bind channel
/api/agents/{name}/slack/channelDELETEUnbind channel
/api/agents/{name}/slack/channel/dm-defaultPUTSet this agent as the DM default for its workspace

Limitations

Only one Slack workspace can be connected per Trinity instance.
Webhook Mode requires a publicly accessible URL.
Thread tracking applies only to threads started by a bot message or @mention.
Rate limits are per Slack user, not per agent.