ACTIVE rule across every rule set participates when Scrip processes an event.
This example has three rule sets:
trackinghas two rules: Track monthly spend, then Mark threshold crossing.earninghas two rules: Dining cashback, then Base cashback.maintenancehas one rule: Monthly reset.
stop_after_match: true, so a match skips Base cashback. Monthly reset still runs because it belongs to maintenance.
The default rule set
Each program has an automatically created rule set with keydefault.
The default set starts at position 1. Creating another set appends it unless you request a different semantic position.
You can omit rule_set_id when you create a rule. Scrip assigns the new rule to the program’s default set. Omitting the field when you update a rule preserves its current assignment. This keeps single-set integrations compatible while you adopt explicit sets.
The
default set behaves like any other rule set during execution. Its key does not make it run first. Its order determines its position.Create and inspect rule sets
Create a rule set under its program:key is a stable program-scoped identifier. It must start with a lowercase letter and contain only lowercase letters, numbers, hyphens, or underscores. A rule set’s name and position can change, but its key cannot.
List a program’s sets in execution order:
Assign and move rules
Passrule_set_id when you create a rule:
position, Scrip appends the rule to the selected set. If you omit rule_set_id, Scrip selects default before assigning the position.
Move an existing rule with the version-guarded move endpoint:
expected_rule_configuration_version from the program’s complete configuration. The move compacts the source set and inserts the rule into the destination in one transaction. A stale version returns 409 rule_configuration_version_conflict without changing either set.
Execution order
Scrip builds one fixed sequence for each event:- Rule sets sort by
rule_set.order, lowest first. ACTIVErules within each set sort byrule.order, lowest first.- Matching rule actions persist sequentially in that set and rule order.
ACTIVE rules across all sets participate. A lower set position changes when a set runs, not whether another set runs.
Scrip numbers both order fields 1..N with no gaps. ACTIVE and SUSPENDED rules occupy unique positions within their containing set. Archived rules leave the sequence.
For example:
The two tracking rules run before the two earning rules.
Dining cashback can use stop_after_match to skip Base cashback, but it cannot skip a tracking rule or a rule in any other set.
Conflict-safe reordering
Use semantic move endpoints when repositioning one set or rule. Use the atomic reorder endpoints when you have the complete desired list. Both paths require the currentexpected_rule_configuration_version, so a concurrent edit cannot silently overwrite your plan.
Scrip shifts neighboring resources and returns the renumbered sequence. You do not need temporary positions or numeric gaps. See Managing rule configuration for consistent reads, full-list reorders, and atomic multi-resource changes.
Set-local stopping
When a matching rule hasstop_after_match: true and its actions execute successfully, Scrip skips only the remaining rules in that same set. Processing continues with the next set.
This makes one set a useful boundary for mutually exclusive rules. Put dining, grocery, and base earn-rate rules in one earning set. A dining match can stop the other earning rules while tracking, maintenance, or notification rules in other sets still participate.
stop_after_match does not stop earlier rules. It also does not stop actions that already persisted.
A skipped execution does not trigger the stop. For example, when a rule exceeds its budget, its actions roll back and processing continues with the next rule in the same set.
Two mutually exclusive earn rates in one set:
One event-start snapshot
Scrip snapshots participant, program, and group state once at the start of each event, and every condition and dynamic expression in every set reads that same snapshot. A counter incremented by an earlier set is not visible to a later set during the same event. See State Snapshot Evaluation Behavior for the full behavior and the threshold-crossing pattern.Event traces
Event details and impact responses include the execution-timerule_set_id on each recorded rule evaluation. Evaluations are returned in the historical set and rule order used for that event.
This trace is not a census of all applicable rules. Clean false conditions have no row. Later rules in the current set that are not reached after a successful stop_after_match also have no row, while processing continues with the next set. See Get an event for skipped-evaluation filtering.
Use the trace to identify the set that contained a rule when it ran. Moving a rule later does not change the recorded set identity for an existing evaluation.
Simulation boundaries
Single-rule simulation validates one rule’s condition and resolved actions. It does not run the program’s other rule sets. A successful single-rule simulation does not prove cross-set ordering, set-localstop_after_match behavior, or interactions among matching rules. Send representative events to a dedicated development program when you need the full execution path. See Testing multiple rule sets.
Recommended structure
Use a small number of sets with distinct responsibilities:
The Cashback card example shows three named sets executing after an intentionally empty
default set while the earn-rate rules remain mutually exclusive.