This guide walks you through setting up the Slack channel so your agent can receive and respond to messages in Slack.
- An Inngest account with Event Key and Signing Key
- A Slack workspace where you can create apps
- Go to api.slack.com/apps and click Create New App
- Choose From scratch
- Give it a name (e.g. your agent's name) and select your workspace
- Click Create App
- In your app settings, go to OAuth & Permissions
- Under Bot Token Scopes, add the following scopes:
app_mentions:read- View messages that directly mention the botchat:write— Send messagesreactions:write— Add emoji reactions (used for message acknowledgment)users:read— Look up user display nameschannels:read— Get channel infoim:read— (Optional) Get DM infompim:read— (Optional) Get group DM infoim:history— (Optional) Read direct messagesmpim:history— (Optional) Read group direct messageschannels:history— (Optional) Read messages in public channels
- Click Install to Workspace and authorize the app
- Copy the Bot User OAuth Token (starts with
xoxb-)
Add the following to your .env file:
SLACK_BOT_TOKEN=xoxb-your-token-hereThe SLACK_SIGNING_SECRET is available in your app's Basic Information page under App Credentials, but is not currently required.
Start the worker:
npm startOn startup, the setup script will:
- Validate your bot token via Slack's
auth.testAPI - Create (or update) an Inngest webhook with the Slack transform and response handler
- Print the webhook URL you need for the next step
Look for output like:
💬 Slack Bot: your-bot-name (Team: Your Workspace)
📋 Slack webhook URL: https://inn.gs/...
Configure this URL in your Slack app's Event Subscriptions settings
- Back in your Slack app settings, go to Event Subscriptions
- Toggle Enable Events to On
- Paste the Inngest webhook URL into the Request URL field
- Slack will send a verification challenge — the webhook's response handler answers this automatically
- Under Subscribe to bot events, add:
app_mention- Only subscribe to events that mention the botmessage.im— Direct messages to the botmessage.mpim— Group DMs the bot is inreaction_added- Reactions to messages
- Click Save Changes
The bot will only receive messages in channels it has been invited to:
- For public/private channels: invite the bot with
/invite @your-bot-name - For DMs: just message the bot directly
- Slack sends events to the Inngest webhook URL
- The webhook transform converts Slack payloads into normalized
agent.message.receivedevents - A response handler answers Slack's URL verification challenge
- The agent processes the message and sends replies back via the Slack Web API
- Messages are acknowledged with a 👀 emoji reaction
- Replies are threaded — the bot always replies in a thread
- Long messages are split at ~3,900 characters (Slack's limit is 4,000)
- Slack retries are detected via
x-slack-retry-numheader and filtered out to prevent duplicate processing