Skip to main content

What is Rate Limiting?

Automater uses a sophisticated token bucket system to protect your Discord server from automation overload. Think of it as a “work budget” that prevents your bot from overwhelming Discord’s API or your server with too many actions at once.

How It Works

Core Concepts

Every automation action costs tokens based on complexity:
  • Send message = 1 token
  • Add/remove role = 2 tokens
  • Kick/ban user = 3-5 tokens
  • Create/delete channel = 10-15 tokens
Rate limiting operates across 5 different scopes:
  • Global: All servers using Automater
  • Guild: Your specific Discord server
  • User: Individual users (prevents spam)
  • Flow: Specific automations (prevents runaway workflows)
  • Action Type: Categories like messaging, moderation, etc.
  1. Reserve: Check if all buckets have enough tokens
  2. Execute: Run the automation if tokens available
  3. Refill: Tokens automatically restore over time

Token Bucket System

Visual Representation

               (refill rate: 2.5 tokens/sec)
                vvvvvvvvvvvvvvvvvvvvvvv
          ┌─────────────────────────────────┐
Tokens →  │■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■│  Capacity: 150 tokens
          └─────────────────────────────────┘
                  ▲  ▲  ▲
             spent by automations

Bucket Scopes Explained

ScopePurposeExample Limits
GlobalProtect entire platform10,000 tokens/minute
GuildProtect your server150 tokens/minute
UserPrevent user spam8 tokens/10 seconds
FlowControl automation rate80 tokens/minute
Action TypeLimit action categories40 HTTP requests/minute

Action Token Costs

Token costs reflect the “weight” of each action on Discord’s API and your server’s performance.
Action CategoryExamplesToken Cost
Light ActionsSend text, simple DB read0.5-1 tokens
Medium ActionsSend embed, add role, variable update1-2 tokens
Heavy ActionsKick/ban, timeout, HTTP request3-4 tokens
AdministrativeCreate/delete channels, roles5-15 tokens

Policy Presets

Choose from three pre-configured rate limiting policies based on your server’s needs:

Conservative Policy

Best for: Small servers, testing, or when stability is paramount
  • Guild limit: 60 tokens/minute (1 token/second refill)
  • Queue threshold: 5 seconds
  • Concurrency: 4 flows maximum
Best for: Most servers with moderate automation usage
  • Guild limit: 150 tokens/minute (2.5 tokens/second refill)
  • Queue threshold: 15 seconds
  • Concurrency: 12 flows maximum
  • Action limits: 80 messages, 40 embeds, 30 role edits per minute

Aggressive Policy

Best for: Large, active servers with heavy automation needs
  • Guild limit: 240 tokens/minute (4 tokens/second refill)
  • Queue threshold: 30 seconds
  • Concurrency: 16 flows maximum
Aggressive policy requires careful monitoring to avoid Discord API rate limits.

Queue & Throttling System

When Automations Queue vs. Throttle

Queue (Wait briefly):
  • ETA ≤ 15 seconds (Balanced policy)
  • System can handle the wait
  • Fair scheduling ensures no automation starves others
Throttle (Drop immediately):
  • ETA > 15 seconds (would take too long)
  • Queue is full (too many waiting)
  • Emergency system protection triggered

Queue Fairness

The system uses Weighted Fair Queuing to ensure no single automation monopolizes resources:
[Guild Queue - Fair Distribution]
┌────┬────┬────┬────┬────┬────┐
│ F1 │ F2 │ F1 │ F3 │ F1 │ F2 │  ← Round-robin by flow
└────┴────┴────┴────┴────┴────┘

[Concurrency Slots: ■■■■■■■■■■□□]

Dashboard Integration

Real-Time Monitoring

The dashboard provides live visibility into your rate limiting status: KPI Cards:
  • Runs: Total automation executions
  • Throttled: Actions blocked by rate limits
  • Queue Wait: Average time automations spend queued
  • Tokens Used: Current token consumption
Token Bucket Visualization:
  • Guild bucket fill level and refill rate
  • Per-action type usage bars
  • Queue depth and estimated wait times
  • Recent throttling events with reasons

Interpreting the Metrics

High Runs + Low Throttled = Healthy heavy usage ✅ Steady token consumption = Consistent automation activity ✅ Short queue waits = System handling load well
⚠️ High Throttled count = Check which bucket is limiting ⚠️ Guild bucket near full = Consider raising capacity or optimizing flows ⚠️ Action type bars pegged = Specific action category saturated
🔴 Persistent throttling = Need to optimize automations or raise limits 🔴 Queue wait increasing = Consider raising concurrency 🔴 Action types constantly maxed = Raise specific action limits

Common Rate Limiting Scenarios

Example 1: Welcome Message Surge

Scenario: 80 new members join in 1 minute
  • Each welcome costs 2 tokens (message + DB write)
  • Total needed: 160 tokens
  • Guild bucket capacity: 150 tokens
  • Result: First 75 welcomes execute immediately, last 5 queue for ~4 seconds

Example 2: Moderation Action Burst

Scenario: Mass ban operation (30 users)
  • Each ban costs 7 tokens (timeout + log + DM)
  • Moderation action limit: 20/minute
  • Result: First 20 execute, remaining 10 throttled with reason “actionType:moderation”

Troubleshooting Rate Limits

Common Issues & Solutions

ProblemLikely CauseSolution
”Guild minute limit” errorsHeavy automation activitySpread out triggers or raise guild capacity
”Action type limit” errorsToo many of one action typeIncrease specific action limits
”Queue full” errorsSystem overloadedReduce automation frequency or raise concurrency
High queue wait timesInsufficient processing capacityOptimize automations or raise concurrency limit

Optimization Strategies

  1. Reduce Action Weights: Combine multiple light actions instead of heavy ones
  2. Spread Triggers: Avoid burst patterns, use delays between actions
  3. Optimize Workflows: Remove unnecessary actions, use conditions to filter
  4. Monitor Patterns: Use dashboard metrics to identify bottlenecks
The rate limiting system is designed to be “hands-off” for most users. The Balanced policy works well for 90% of servers without any tuning required.

Next Steps