Limit the number of times a reactor can be triggered in a period of time
Introduction
You can limit the number of times a reactor runs per user or program using Activation limits. When using an activation limit, the limit applies to the number of times a reactor has run in its current form across all time.
If you want to limit a reactor to only run a number of times in a particular period, you can use audiences to achieve this effect. For example, imagine you want to create a reactor which only runs once per week per user. This tutorial provides information on how to achieve this effect.
Tutorial
Ensure that the event type you're working with has the Audience enhancer enabled.
Audience Configuration
Navigate to Users > Audiences. Click 'Create' in the top right corner.
Give the audience a name and description. Switch AUDIENCE_JOINED and AUDIENCE_LEFT events on if needed. Set the 'Refresh rate' to 'Daily Reactive'.
Move to the criteria tab. Click 'Add Group. Configure the criteria as follows.
Event type is SUBMITTED_CODE
Event payload matches JSON schema
{ "type": "object", "$schema": "http://json-schema.org/draft-06/schema#", "properties": { "code": { "const": "ONEPERWEEK" } } }
Event occurrence count is 0
Reported at is later than time ago 7 days ago
Click 'Save'.

Reactor Setup
Navigate to Events > Reactors. Click 'Create' in the top right corner.
Give the reactor a name and choose SUBMITTED_CODE from the event type list. Set an activation limit if needed.
Move to the payload constraints tab. Click 'Constant' in the Code section and enter 'ONEPERWEEK'. Click 'Is Audience' and select the audience you made in the previous step.
Move to the 'Reactions' tab and configure the reaction you need. See the Activation limits article for more information.
Move to the 'Effectivity' tab and set a start date and an end date for the reactor, if needed.
Click 'Save'.

Last updated
Was this helpful?