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 

  • Interval: the duration of time over which the throttle action schedules its runs. Allowed values are minute (default), hour, and day.

  • Runs per interval: The maximum number of times that the action can run in each interval. Runs will be evenly spaced out across each interval.

  • Events per run: The number of events emitted in each run (1-10).

For example, if there was a throttle action configured with 20 runs per minute and five events per run:

Interval: minute, Runs per interval: 20, Events per run: 5

Then, if it received at least 100 events per minute, we would expect it to emit five events every three seconds.

If the throttle action received more than 100 events per minute on average, it would continue to steadily put out five events every three seconds in the order they were received, but a backlog would begin to amass. If it started receiving less than 100 events per minute, it would eventually consume that backlog and start putting out less than five events every three seconds, and possible none at all for some runs.

Was this helpful?