Docs/Channels/Slack
Channels

Slack

Connect your agent to a Slack app over Socket Mode β€” no public HTTP endpoint required. Slack has separate access policies for DMs and channel/group messages, enforced through Slack's own policy keys rather than the pairing store.

Requirements

  • A Slack app with Socket Mode enabled.
  • A bot token (xoxb-…) and an app-level token (xapp-…).
  • The slack_sdk library (installed with Flowly's Slack extra).

Configuration

Set under channels.slack in ~/.flowly/config.json:

{
  "channels": {
    "slack": {
      "enabled": true,
      "mode": "socket",
      "botToken": "xoxb-...",
      "appToken": "xapp-...",
      "groupPolicy": "mention",
      "groupAllowFrom": [],
      "dm": {
        "enabled": true,
        "policy": "open",
        "allowFrom": []
      }
    }
  }
}
KeyTypeDefaultDescription
enabledboolfalseStart the Slack adapter at gateway boot.
modestring"socket"Connection mode; socket (Socket Mode) is supported.
botTokenstring""Bot token (xoxb-…).
appTokenstring""App-level token (xapp-…) for Socket Mode.
groupPolicy"mention" | "open" | "allowlist""mention"Access policy for channel/group messages.
groupAllowFromstring[][]Allowed channel IDs (used when groupPolicy is allowlist).
dm.enabledbooltrueAllow direct messages to the bot.
dm.policy"open" | "allowlist""open"DM access policy.
dm.allowFromstring[][]Allowed Slack user IDs (used when dm.policy is allowlist).

Access policies

  • DMs are gated by dm.enabled, then dm.policy (open or allowlist against dm.allowFrom).
  • Channel/group messages are gated by groupPolicy:
    • mention β€” only messages that @mention the bot (or app_mention events) trigger it.
    • open β€” any message in the channel triggers it.
    • allowlist β€” only channels listed in groupAllowFrom.
Slack does

not use the pairing store; manage access via the keys above.

Connect method

The adapter connects over Socket Mode, acks incoming Events API requests immediately, then processes message and app_mention events (ignoring subtypes and the bot's own messages, and de-duplicating channel mentions). It adds an :eyes: reaction to the triggering message. Outbound replies use chat_postMessage; non-DM replies are posted in a thread.

Setup steps

  1. Create a Slack app and enable Socket Mode.
  2. Add a bot user and the required event subscriptions (message, app_mention); install the app to your workspace.
  3. Copy the bot token (xoxb-…) and generate an app-level token (xapp-…).
  4. Set channels.slack.enabled to true, paste botToken and appToken.
  5. Choose groupPolicy and dm settings.
  6. Start the gateway: flowly gateway.