Overview
The Slack notifier provides:- Rich Block Kit formatted messages
- Priority-based emoji indicators
- Pull request and CI status integration
- Interactive action buttons (URL and callback)
- Automatic timestamp formatting
- Per-project channel routing
This plugin uses Slack’s incoming webhook API, which is simpler but less powerful than the full Slack API. For advanced features like updating messages or threading, consider building a custom notifier.
Configuration
Add the Slack notifier to youragent-orchestrator.yaml:
Configuration Options
Slack incoming webhook URL. Get this from your Slack workspace:
- Go to https://api.slack.com/apps
- Create a new app or select existing
- Enable “Incoming Webhooks”
- Add webhook to your workspace
- Copy the webhook URL
Default channel to post to (e.g.,
#agent-notifications or @username). If not specified, uses the webhook’s default channel.You can override the channel per-notification using the
context.channel parameter in the post() method.Display name shown in Slack for the bot. Customize this to distinguish between multiple orchestrators or environments.
Notification Format
Message Structure
Slack notifications use Block Kit for rich formatting:Priority Emoji
Each notification includes a priority indicator:🚨 urgent
🚨 urgent
Critical issues requiring immediate attention
👉 action
👉 action
Actions waiting for human decision
⚠️ warning
⚠️ warning
Warning conditions to be aware of
ℹ️ info
ℹ️ info
Informational updates
Action Buttons
The plugin supports two types of action buttons:- URL Buttons - Direct links that open in browser
- Callback Buttons - Trigger callback endpoints when clicked
Callback buttons require setting up a Slack interaction endpoint to handle button clicks. The button
action_id is prefixed with ao_ and includes a sanitized version of the action label.Usage Examples
Basic Setup
Multiple Environments
Team-Based Routing
Event Data Integration
The Slack notifier automatically includes rich metadata when available:Pull Request Links
When event data includesprUrl, a clickable link is added:
CI Status
When event data includesciStatus, a status indicator is added:
Timestamp Formatting
Timestamps use Slack’s dynamic formatting for user timezone localization:Advanced Features
Post Raw Messages
Thepost() method allows sending custom messages:
The
post() method uses simple text formatting instead of Block Kit. For rich formatting, use the standard notify() and notifyWithActions() methods.Action Button Sanitization
Action labels are automatically sanitized for use as Slack action IDs:- Converted to lowercase
- Non-alphanumeric characters replaced with
_ - Leading/trailing underscores removed
- Index appended for uniqueness
"Request Changes" → "ao_request_changes_0"
Troubleshooting
Webhook returns 404 or invalid_token
Webhook returns 404 or invalid_token
Check your webhook URL:
- Verify the URL is complete and correct
- Ensure the webhook hasn’t been deleted in Slack settings
- Test the webhook with curl:
Messages not appearing in expected channel
Messages not appearing in expected channel
The
channel parameter in config only works if your webhook’s “Post to Channel” setting in Slack allows override. Check:- Slack App Settings → Incoming Webhooks
- Verify webhook permissions
- Try without
channelparameter to use default
Action buttons not working
Action buttons not working
No notifications being sent
No notifications being sent
Check the logs for warnings:Ensure
webhookUrl is set in your config and properly loaded from environment variables.Messages are too long or cut off
Messages are too long or cut off
Slack has message limits:
- Text blocks: 3000 characters
- Total message: 40,000 characters
Security Considerations
Source Code
View the plugin source:- Package:
@composio/ao-plugin-notifier-slack - Location:
packages/plugins/notifier-slack/src/index.ts
Related
- Desktop Notifier - OS-native notifications
- Webhook Notifier - Generic HTTP webhooks
- Composio Notifier - Unified notifications including Slack via Composio
- Slack Block Kit - Official Slack documentation
