How to Handle Rate Limits Across OpenClaw Channels
Every messaging platform enforces rate limits: Slack allows 1 message per second, WhatsApp limits template messages, Discord restricts burst sending. This intermediate guide shows you how to configure OpenClaw's rate limiting system to handle per-platform limits, message queuing, retry logic, and overflow scenarios.
Why This Is Hard to Do Yourself
These are the common pitfalls that trip people up.
Per-platform limits vary
Slack, WhatsApp, Discord, Telegram all have different rate limits. A single configuration doesn't work across platforms.
Burst vs sustained limits
Some platforms allow bursts of messages but throttle sustained sending. Others limit both. Configuration must account for both.
Retry logic complexity
When rate limited, should you retry immediately, use exponential backoff, or drop the message? Different scenarios need different strategies.
Monitoring rate limit hits
Without monitoring, you won't know when you're hitting rate limits. Logging and metrics are essential for diagnosing issues.
Step-by-Step Guide
Understand per-platform rate limits
# Common platform rate limits:
# Slack: 1 msg/sec per channel, 100 msg/min workspace-wide
# Discord: 5 msg/5sec per channel, 50 msg/sec account-wide
# Telegram: 30 msg/sec total, 20 msg/min per group
# WhatsApp: 80 msg/sec (business tier), templates limited separately
# Signal: No official limit, but signal-cli throttles ~10 msg/sec
# Teams: 4 requests/sec per threadConfigure message queuing
# config/rate_limits.yaml:
rate_limits:
enabled: true
queue:
type: redis # or "memory", "postgres"
redis_url: "redis://localhost:6379"
max_queue_size: 1000 # Drop messages if queue exceeds this
ttl_seconds: 300 # Discard queued messages older than 5 minutesWarning: Memory queues are lost on restart. Use Redis or Postgres for production to persist queued messages.
Set up per-channel rate limiters
# config/rate_limits.yaml (continued):
channels:
slack:
messages_per_second: 1
burst: 5 # Allow 5-message burst
per_channel: true # Separate limits per Slack channel
discord:
messages_per_second: 1
burst: 5
cooldown_seconds: 5 # Wait 5s after burst
telegram:
messages_per_second: 20
messages_per_minute: 300
whatsapp:
messages_per_second: 80
template_messages_per_day: 1000 # Separate limit for templates
signal:
messages_per_second: 10Configure retry logic with backoff
# config/rate_limits.yaml (continued):
retry:
enabled: true
strategy: exponential_backoff # or "linear", "immediate"
initial_delay_ms: 1000
max_delay_ms: 30000
max_retries: 5
backoff_multiplier: 2 # 1s, 2s, 4s, 8s, 16s, 30s (capped)
jitter: true # Add randomness to prevent thundering herdSet up overflow handling
# config/rate_limits.yaml (continued):
overflow:
strategy: prioritize # or "drop_oldest", "drop_newest", "reject"
priority_field: message.priority # High-priority messages sent first
notify_on_drop: true # Alert admins when messages are dropped
fallback_channel: email # Send to email if primary channel overflowsWarning: Dropping messages means users don't receive responses. Always configure notifications or fallback channels.
Monitor rate limit hits
# config/monitoring.yaml:
monitoring:
rate_limits:
enabled: true
log_level: warn # Log when approaching limits
metrics:
- rate_limit_hits
- queue_depth
- messages_dropped
- retry_attempts
alerts:
- condition: "queue_depth > 500"
action: notify_admin
- condition: "messages_dropped > 10 per hour"
action: page_on_call
# View rate limit metrics:
openclaw metrics --filter rate_limitsRate Limit Issues Cause Message Loss
Per-platform limits, queuing strategies, retry logic, overflow handling, monitoring โ our integration experts configure rate limiting systems that prevent message loss and maintain service quality across all channels.
Get matched with a specialist who can help.
Sign Up for Expert Help โ