Slack Integration
AgenticAnts provides a powerful Slack integration that enables real-time notifications and alerts for your AI agent operations. Get instant updates about critical errors, anomalies, prompt changes, and other important events directly in your Slack workspace.
Overview
The Slack integration allows you to:
- Receive real-time alerts about critical errors and anomalies
- Get notified when prompts are edited or created
- Jump directly from Slack messages to specific prompts in AgenticAnts
- Configure different notification channels per project
- Send test messages to verify your integration
- Customize notification preferences and filters
Features
Real-time Notifications
Stay informed with instant Slack notifications for:
- Critical Errors: Get alerted when AI agents encounter errors
- Anomalies: Receive notifications for unusual behavior or performance issues
- Prompt Changes: Track when prompts are modified or created
- Cost Alerts: Monitor when spending thresholds are exceeded
- Performance Issues: Get notified of latency spikes or failures
Channel Configuration
- Set up different notification channels for different event types
- Configure per-project Slack channels
- Route specific agent notifications to dedicated channels
- Support for both public and private channels
Rich Message Format
Slack messages include:
- Direct Links: Jump straight to the relevant resource in AgenticAnts
- Contextual Information: See key metrics and details at a glance
- Action Buttons: Quick actions directly from Slack
- Threaded Discussions: Keep conversations organized
Setup
Prerequisites
- A Slack workspace where you can install apps
- Workspace admin permissions (or ability to request app installation)
- AgenticAnts project with admin access
Local Development Setup
If you're setting up the integration for local development, you'll need additional tools:
- Node.js and pnpm installed
- macOS (for mkcert) or equivalent SSL certificate tool
- HTTPS enabled for OAuth callback
Creating a Slack App
- Go to Slack API Apps page
- Click Create New App → From an app manifest
- Select your workspace
- Use the following app manifest as a template:
- Click Create to create your app
Adding App Icon (Optional)
Make your app more recognizable:
- In your Slack app settings, go to Basic Information
- Scroll to Display Information
- Upload the AgenticAnts logo as your app's avatar
- Save changes
Environment Variables
Configure your AgenticAnts environment:
- In your Slack app settings, go to Basic Information
- Copy the Client ID and Client Secret
- Add these to your
.envfile:
HTTPS Setup for Local Development
The Slack OAuth flow requires HTTPS. For local development:
macOS Setup
Windows Setup
Linux Setup
Starting Development Server
From the repository root, run:
This starts the Next.js development server with HTTPS enabled on https://localhost:3000.
Configuring OAuth Redirect URLs
- In your Slack app settings, go to OAuth & Permissions
- Under Redirect URLs, add:
- Development:
https://localhost:3000/api/public/slack/oauth - Production:
https://yourdomain.com/api/public/slack/oauth
- Development:
- Save URLs
Configuration
Connecting to Slack
- Navigate to your AgenticAnts project settings
- Go to the Integrations tab
- Find the Slack integration section
- Click Connect to Slack
- Authorize the app in your Slack workspace:
- Review the permissions requested
- Select the workspace to install to
- Click Allow
- You'll be redirected back to AgenticAnts
- Select the default notification channel
Channel Selection
After connecting, configure your notification channels:
- Choose a default channel for general notifications
- Optionally configure specific channels for:
- Error alerts
- Prompt notifications
- Cost alerts
- Performance monitoring
- Test the connection using the Send Test Message button
Notification Preferences
Customize what notifications you receive:
Usage
Receiving Notifications
Once configured, you'll automatically receive Slack notifications for enabled events.
Example error notification:
Example prompt change notification:
Sending Test Messages
Verify your integration is working:
- Go to project settings → Integrations → Slack
- Click Send Test Message
- Check your configured Slack channel for the test message
- If successful, you'll see a confirmation in AgenticAnts
Manual Notifications
Send custom notifications via API:
API Reference
API Endpoints
GET /api/public/slack/install
Initiates the Slack OAuth installation flow.
Query Parameters:
projectId: AgenticAnts project ID
Response: Redirects to Slack authorization page
GET /api/public/slack/oauth
Handles Slack OAuth callback and stores integration details.
Query Parameters:
code: OAuth authorization codestate: Security state token (contains projectId)
Response:
Components
SlackConnectionCard
Displays connection status and provides connect/disconnect actions.
SlackChannelSelector
Allows selection of Slack channels for notifications.
SlackTestButton
Sends a test message to verify the integration.
Server Services
SlackService
Main service for Slack integration operations:
TRPC Routes
slack.getIntegrationStatus
Returns the current connection status for a project.
slack.getChannels
Fetches available Slack channels for the connected workspace.
slack.disconnect
Disconnects the Slack integration for a project.
slack.sendTestMessage
Sends a test message to verify the integration.
Message Templates
Error Alert Template
Prompt Change Template
Best Practices
Channel Organization
- Separate channels by severity: Use different channels for errors vs. informational updates
- Per-environment channels: Create separate channels for dev, staging, and production
- Team-specific channels: Route notifications to relevant team channels
- Use threads: Enable threaded replies to keep channels organized
Notification Management
- Filter noise: Only enable notifications for actionable events
- Set severity thresholds: Avoid alert fatigue by focusing on critical issues
- Use digest mode: For high-volume events, consider daily/weekly summaries
- Mute during maintenance: Temporarily disable notifications during planned downtime
Security
- Rotate tokens regularly: Update OAuth tokens every 90 days
- Limit channel access: Use private channels for sensitive notifications
- Review permissions: Regularly audit what the bot can access
- Monitor usage: Check Slack app audit logs for suspicious activity
Troubleshooting
Common Issues
"Invalid redirect URI" error
- Ensure your Slack app's OAuth redirect URLs include the correct callback URL
- Check that you're using HTTPS (required for OAuth)
- Verify the domain matches exactly (including port for local development)
Certificate errors during local development
- Make sure you've run
mkcert -installto install the local CA - Try accessing
https://localhost:3000directly and accepting the certificate - Restart your development server after generating certificates
- Check that certificate files are in the correct location
Messages not appearing in Slack
- Verify the bot is added to the target channel (
/invite @AgenticAnts) - Check that the channel ID is correct
- Ensure the bot has
chat:writepermission - Test with a public channel first before trying private channels
"Not authenticated" error
- Re-authenticate the Slack integration in project settings
- Verify your OAuth tokens haven't expired
- Check that the Slack app is still installed in your workspace
Test message fails
- Confirm the integration is properly connected
- Check that the selected channel still exists
- Verify the bot has permissions to post in the channel
- Review server logs for detailed error messages
Debug Mode
Enable debug logging for Slack integration:
View logs:
Production Deployment
Pre-deployment Checklist
- [ ] Update OAuth redirect URLs to include production domain
- [ ] Set up proper SSL certificates for production environment
- [ ] Configure environment variables in production
- [ ] Test the integration in staging environment
- [ ] Document the Slack app installation for your team
- [ ] Set up monitoring for Slack API usage
- [ ] Configure rate limiting to avoid API quotas
Scaling Considerations
- Rate Limits: Slack has rate limits (~1 message per second per channel)
- Batch Messages: Group related notifications when possible
- Queue System: Use a message queue for high-volume notifications
- Retry Logic: Implement exponential backoff for failed messages
- Circuit Breaker: Disable integration temporarily if Slack is down
Future Enhancements
Planned features for future releases:
- Interactive Actions: Respond to alerts directly from Slack
- Slash Commands: Query AgenticAnts data from Slack (
/agenticants status) - Scheduled Reports: Daily/weekly summaries sent to Slack
- Thread Management: Automatic threading for related events
- @mentions: Mention specific team members in notifications
- Custom Workflows: Build custom notification workflows
- Bi-directional Sync: Create tickets/tasks from Slack messages
- Voice Alerts: Integration with Slack voice channels
Support
Need help with the Slack integration?
- Documentation: This guide and inline help
- Community: Join our Discord
- GitHub: Report issues
- Email: support@agenticants.ai
For enterprise customers:
- Dedicated Support: Direct access to our integration specialists
- Custom Setup: We'll help configure your Slack workspace
- Training: Onboarding sessions for your team
Related Resources
- JIRA Integration - Create tickets from alerts
- Webhook Integration - Custom integrations
- API Reference - Full API documentation
- Alerting Guide - Configure alert rules
Ready to connect Slack? Head to your project settings and get started!