Slack Bot
Bring GradientHarbor's AI data agent into your Slack workspace. Team members can ask data questions, run queries, and receive charts directly in Slack channels and DMs.
┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐
│ Slack │ │ GradientHarbor │ │ Your Database │
│ │ │ │ │ │
│ @GradientHarbor │────▶│ Agent (slack │────▶│ Execute SQL │
│ "Top products │ │ surface) │ │ against your │
│ by revenue?" │ │ │◀────│ connected DB │
│ │◀────│ Format as │ │ │
│ 📊 Chart posted │ │ Slack blocks │ │ │
│ to thread │ │ │ │ │
└──────────────────┘ └──────────────────┘ └──────────────────┘What the Bot Can Do
- Answer data questions — Ask natural language questions and get SQL-backed answers
- Execute queries — Run queries against your connected databases
- Share results — Post tables and charts as formatted Slack messages
- Thread conversations — Each message creates a dedicated agent thread for follow-up questions
Setup
1. Create a Slack App
- Go to api.slack.com/apps
- Click Create New App > From scratch
- Name it (e.g., "GradientHarbor") and select your workspace
- Note the following credentials from the Basic Information page:
- Client ID
- Client Secret
- Signing Secret
2. Configure OAuth & Permissions
In your Slack app settings:
Go to OAuth & Permissions
Add the following Bot Token Scopes:
app_mentions:read— Receive mentions in channelschat:write— Post messagesim:history— Read DM messagesim:read— Access DM channel infoim:write— Send DMsusers:read— Look up user infousers:read.email— Map Slack users to GradientHarbor accounts
Set the Redirect URL to:
https://api.gradientharbor.com/slack/oauth/callback
3. Configure Event Subscriptions
- Go to Event Subscriptions
- Enable events
- Set the Request URL to:
https://api.gradientharbor.com/slack/events - Subscribe to these bot events:
app_mention— When someone @mentions the bot in a channelmessage.im— When someone sends a direct message to the bot
4. Connect in GradientHarbor
- Go to Administration > Integrations in GradientHarbor
- Click Connect Slack
- Authorize the Slack app with your workspace
- The bot is now active
How It Works
Channel Mentions
Mention the bot in any channel where it's been added:
@GradientHarbor What were our top 10 products by revenue last week?The bot will:
- Identify the Slack user's GradientHarbor account (matched by email)
- Create an agent thread with the
slacksurface - Execute the query using the user's organization context
- Post the results as a formatted Slack message
Direct Messages
Send a DM directly to the bot for private data questions. The same agent capabilities are available — query execution, table/chart results, and follow-up conversations.
User Mapping
The Slack bot maps Slack users to GradientHarbor accounts by email address. For the bot to respond:
- The Slack user's email must match a GradientHarbor user's email
- That user must be an active member of an organization with Slack integration enabled
WARNING
If a Slack user's email doesn't match any GradientHarbor account, the bot cannot process their requests. Ensure team members use the same email for both platforms.
Limitations
- The Slack bot uses the
slackagent surface, which has a slightly different tool set than the web chat - File attachments via Slack are not currently supported — use the web chat for CSV/PDF/image uploads
- Rate limits apply per Slack's API policies
Troubleshooting
| Issue | Solution |
|---|---|
| Bot doesn't respond | Verify the bot is added to the channel. Check that event subscriptions are configured correctly. |
| "User not found" error | The Slack user's email doesn't match a GradientHarbor account. |
| Duplicate responses | Event delivery is deduplicated by event ID. If you see duplicates, check your Slack app's retry settings. |
| OAuth callback fails | Verify the redirect URL matches exactly: https://api.gradientharbor.com/slack/oauth/callback |