Throttle mode

Allow events to be emitted at a consistent, limited rate. Throttle mode helps you to respect rate limits when interacting with 3rd party APIs. This logic is applied to all events regardless of which story run they are from.

Features 

  • Emit events at a limited rate and at consistent intervals.

  • This logic is applied to all events across all story runs - separate story runs are not given separate capacity.

  • The newly emitted Event will also contain a capacity_per_minute key which shows how many runs of the action were allowed each minute when the event was emitted.

  • Throttled events are placed in a queue until they are emitted. Events will be dropped instead of being added to the queue if there are 20,000 or more events in the queue already.

Configuration Options 

  • mode: 'throttle'.

  • capacity: When using 'throttle' mode, choose how times the action can run each minute.

    • This option is known as Runs per minute in the UI.

  • events_per_run: How many events can be emitted each time the action runs, up to a maximum of 5.

Emitted Events 

{
  "capacity_per_minute": "10"
}

Example Configuration Options 

Allow 10 events from all story runs to be emitted each minute. With this configuration, an event will be emitted every 6 seconds.

{
  "mode": "throttle",
  "capacity": "10"
}

Allow 300 events from all story runs to be emitted each minute. With this configuration, up to 5 events will be emitted per run, with one run happening every second.

{
  "mode": "throttle",
  "capacity": "60",
  "events_per_run": "5"
}
Was this helpful?