Overview
The Slack integration supports:- Receiving messages from Slack via webhooks
- Message processing by AGO agents
- Real-time response streaming with progressive Slack message updates
- Intelligent caching of Slack users to optimize performance
- Secure authentication and validation of webhooks
- Rich content formatting (images, links, markdown)
Prerequisites
System Requirements
- AGO platform deployed and accessible
- Slack workspace with admin permissions
Knowledge Required
- Slack App configuration basics
- Webhook concepts
- OAuth scopes
Configuration Required
- Slack App created at api.slack.com
- Bot User OAuth Token obtained
- Event Subscriptions enabled
- “slack” enabled as a message channel in AGO admin settings
⚠️ WARNING: You must enable “slack” as a message channel in the admin settings before webhooks will be processed.
Setup Guide
1
Create Slack App
- Go to https://api.slack.com/apps
- Click “Create New App” → “From scratch”
- Name your app and select your workspace
2
Configure OAuth Scopes
Navigate to “OAuth & Permissions” and add these Bot Token Scopes:
3
Set Up Event Subscriptions
Navigate to “Event Subscriptions”:
- Enable Events: On
- Request URL:
https://your-domain.com/public/slack/webhook - Subscribe to bot events:
message.channelsmessage.im
ℹ️ NOTE: The Request URL will be verified by Slack when you save. Ensure your AGO instance is accessible and the Slack message channel is enabled in admin settings.
4
Install App
- Go to “Install App” in the sidebar
- Click “Install to Workspace”
- Copy the Bot User OAuth Token (starts with
xoxb-)
5
Configure AGO
In the AGO admin interface:
- Navigate to Administration > Settings
- In the Slack section, enter your Bot User OAuth Token (starts with
xoxb-)
How It Works
When a user sends a message in Slack, AGO receives the event via a webhook, processes the message through the configured AI agent, and streams the response back to Slack with progressive updates. The system handles authentication validation, user lookup and caching, loop prevention, and rich content formatting automatically.Features
Real-Time Streaming
AGO responses are streamed to Slack with progressive updates:- Initial message: ”🤔 Thinking…” posted immediately
- Periodic updates: Every 2 seconds during generation
- Final message: Full response once complete
Rich Content Support
Image Support
Standalone Images (on their own line):<https://example.com/image.png|alt>
Link Formatting
Markdown links are automatically converted to Slack format: Before:[our docs](https://docs.example.com)
After: <https://docs.example.com|our docs>
Markdown Conversion
User Caching
Slack user information is cached for 24 hours:- Cache hit: Immediate response without API call
- Cache miss/expired: Calls
users.infoand updates cache - Fallback: Generated email (
slack_{user_id}@unknown.com) if no email found
Security Features
Loop Prevention
The system automatically ignores:- Bot messages: Detected via
bot_id,subtype: bot_message,bot_profile - Our own bot: Detected using our bot ID via Slack API
- Edits/deletions:
message_changed,message_deleted - System notifications:
channel_join,channel_leave,file_share - Empty messages: Only whitespace or no content
💡 TIP: Loop filtering prevents infinite response loops when the bot replies to its own messages.
Event Deduplication
Protection against duplicate messages:event_idcache: Each Slack event has a unique ID- 1-hour TTL: Automatic cache cleanup
- Thread-safe: Shared cache across processing threads
Agent Targeting
Query Parameter Targeting
Target a specific agent by adding a query parameter to the webhook URL:- Messages processed by specified agent instead of default
- Fallback to default if agent doesn’t exist or user lacks permission
- Different channels can use different agents
- In Slack App Event Subscriptions, use the targeted webhook URL
- Agent ID must be a valid UUID
- User must have permission to access the specified agent
Troubleshooting
Webhook URL verification fails
Webhook URL verification fails
Problem: Slack can’t verify the Request URL when setting up Event Subscriptions.Solutions:
- Ensure AGO instance is publicly accessible (not localhost)
- Verify “slack” is enabled as a message channel in admin settings
- Check server logs for webhook errors
- Ensure HTTPS is properly configured
Bot doesn't respond to messages
Bot doesn't respond to messages
Problem: Messages are sent but no response appears.Solutions:
- Check that the Slack bot token is configured in AGO admin settings
- Verify the bot has
chat:writescope - Ensure the bot is invited to the channel
- Check server logs for processing errors
- Verify “slack” is enabled as a message channel in admin settings
"Thinking..." message never updates
"Thinking..." message never updates
Problem: Initial message appears but final response doesn’t.Solutions:
- Verify background processing is running
- Verify the agent is configured and active
- Look for errors in worker logs
- Check if knowledge sources are connected
User emails not captured
User emails not captured
Problem: Slack users show generated emails (
slack_xxx@unknown.com).Solutions:- Verify bot has
users:read.emailscope - Check if Slack workspace requires admin approval for email access
- Clear user cache and retry
Duplicate responses
Duplicate responses
Problem: Bot responds multiple times to the same message.Solutions:
- Event deduplication should handle this automatically
- Check if multiple webhook URLs are configured
- Verify only one instance is processing webhooks
Images not displaying
Images not displaying
Problem: Images show as links instead of embedded images.Solutions:
- Ensure images are on their own line for block display
- Verify image URLs are publicly accessible
- Check that image URLs use HTTPS
Related Documentation
- Agents - Configure agents for Slack
- Messenger Integration - Similar chat integration
- WhatsApp Integration - Similar chat integration
- Widget Authentication - Authentication concepts
