Skip to content

Description

While executing workspaces automations, Runtime enforces 4 distincts rate limits :

  • Automations execution
  • Event emits
  • HTTP fetchs
  • repeat loops

Each workspace has its own rate limits for each of these instructions.
Moreover, these rate limits are local to each runtime instance and not shared between multiple runtime instances : thus, global rate limits for a workspace will increase as new runtime instances are created.

For example, with 2 runtime instances and a workspace A that has a 100 automation executions / second rate limit, workspace A might reach 200 automations / s.
In order for this workspace to benefit from this maximum global limit of 200 automations / seconds, it must leverage events emits & triggers to evenly distribute automations executions accross the cluster.

On the contrary, a single automation calling 2000 other automations in a row will be entirely executed by the same and single instance which processed the initial trigger, and thus will be throttled & not exceed 100 automations / seconds :

slug: thisWillBeThrottled
do:
  - repeat:
      on: 2000
      do:
        - callSomeOtherAutomation: {}

Instead, it could be easily rewritten using emits to asynchronously distribute these 2000 calls accross the available instances :

do:
  - repeat:
      on: 2000
      do:
        - emit:
            event: triggerSomeOtherAutomation
            payload: {}

---
# The second automation:  

slug: callSomeOtherAutomation
when:
  events:
    - triggerSomeOtherAutomation
do: []
In this example, note that 2 other rate limits will apply : emits and repeats.

When an automation is throttled (regardless of the type of rate limit reached), a payload.throttled field indicates for how long inside its runtime.automations.executed event.
The same amount of time is also included in the corresponding payload.duration field.

Default limits

Burst rate : During a momentary peak usage, number of times that can be executed before being throttled to the normal rate.

Type Rate/s Environment variable Burst rate Environment variable
Automations execution 100 RATE_LIMIT_AUTOMATIONS 400 RATE_LIMIT_AUTOMATIONS_BURST
Emits 30 RATE_LIMIT_EMITS 100 RATE_LIMIT_EMITS_BURST
HTTP fetchs 50 RATE_LIMIT_FETCHS 200 RATE_LIMIT_FETCHS_BURST
Repeat iterations 1000 RATE_LIMIT_REPEATS 4000 RATE_LIMIT_REPEATS_BURST
  • Setting one of the above environment variables to 0 disable the corresponding rate limit.
  • Rate limits can be entirely disabled with RATE_LIMIT_DISABLED=true environment variable.