Overview
The Webhook notifier provides:- Generic HTTP POST to any endpoint
- Structured JSON payload format
- Automatic retry with exponential backoff
- Custom header support (authentication, etc.)
- Smart retry logic (only retries 429 and 5xx errors)
- Configurable retry behavior
This is the most flexible notifier plugin. Use it to integrate with any service that accepts HTTP webhooks: Discord, Microsoft Teams, custom dashboards, alerting systems, etc.
Configuration
Add the webhook notifier to youragent-orchestrator.yaml:
Configuration Options
The HTTP endpoint to POST notifications to. Must be a valid HTTP/HTTPS URL.
Custom HTTP headers to include with every request. Useful for:
- Authentication:
Authorization: Bearer <token> - API keys:
X-API-Key: <key> - Custom routing:
X-Environment: production - Content hints:
X-Webhook-Source: agent-orchestrator
Maximum number of retry attempts for failed requests. Set to
0 to disable retries.Retry behavior:- Only retries 429 (Too Many Requests) and 5xx (server errors)
- 4xx errors (400, 401, 403, 404) are NOT retried (client errors are permanent)
- Network errors are retried
Initial delay in milliseconds before first retry. Uses exponential backoff:
- Attempt 1:
retryDelayMs * 2^0= 1000ms - Attempt 2:
retryDelayMs * 2^1= 2000ms - Attempt 3:
retryDelayMs * 2^2= 4000ms
Payload Format
The webhook plugin sends JSON payloads with different structures based on the notification type.Standard Notification
Sent vianotify() method:
Notification with Actions
Sent vianotifyWithActions() method:
Custom Message
Sent viapost() method:
Usage Examples
Discord Webhook
Discord’s webhook format differs from the plugin’s default. You may need to use a transformation proxy or build a Discord-specific notifier plugin.
Microsoft Teams
Custom Dashboard
Alerting System (PagerDuty, etc.)
No Retries (Fire and Forget)
Retry Logic
What Gets Retried
✅ Retryable Errors
✅ Retryable Errors
- 429 Too Many Requests - Rate limit, back off and retry
- 500 Internal Server Error - Temporary server issue
- 502 Bad Gateway - Upstream server issue
- 503 Service Unavailable - Server overloaded
- 504 Gateway Timeout - Upstream timeout
- Network errors - Connection failures, DNS issues
❌ Non-Retryable Errors
❌ Non-Retryable Errors
- 400 Bad Request - Invalid payload format
- 401 Unauthorized - Missing/invalid authentication
- 403 Forbidden - Insufficient permissions
- 404 Not Found - Endpoint doesn’t exist
- 422 Unprocessable Entity - Invalid data
- Other 4xx errors - Client errors (permanent)
Exponential Backoff
Retries use exponential backoff to avoid overwhelming the server:Exponential backoff helps prevent cascading failures and respects rate limits on the receiving endpoint.
Error Handling
When all retries are exhausted, the plugin throws an error:Security Best Practices
Troubleshooting
400 Bad Request errors
400 Bad Request errors
The receiving endpoint rejected your payload format. Check:
- Does the endpoint expect the plugin’s JSON structure?
- Review their webhook documentation
- Test with curl:
- Consider building a transformation proxy or custom notifier plugin
401/403 Authentication errors
401/403 Authentication errors
Authentication failed. Check:
- Headers are configured correctly
- Token/API key is valid and not expired
- Token has correct permissions
- Environment variables are loaded properly
Timeout or network errors
Timeout or network errors
Connection issues:
- Verify the URL is accessible from your network
- Check firewall rules
- Test DNS resolution:
nslookup your-endpoint.com - Test connectivity:
curl -v YOUR_WEBHOOK_URL - Increase
retriesandretryDelayMsfor flaky networks
No notifications being sent
No notifications being sent
Check logs for:Ensure
url is set in config and validated successfully.Retries exhausted quickly
Retries exhausted quickly
If retries are being exhausted:
- Check if errors are 4xx (not retryable)
- Increase
retriescount - Increase
retryDelayMsfor better spacing - Monitor server logs on receiving end
Building a Transformation Proxy
If your webhook endpoint expects a different payload format, create a transformation proxy:Source Code
View the plugin source:- Package:
@composio/ao-plugin-notifier-webhook - Location:
packages/plugins/notifier-webhook/src/index.ts
Related
- Slack Notifier - Slack-specific webhook implementation
- Desktop Notifier - OS-native notifications
- Composio Notifier - Unified notifications via Composio
- Building Custom Plugins - Create your own notifier plugin
