AI Rule Engine Docs
Go to App

Rules

A rule pairs a single condition with one or more actions: when the condition is true, the actions run. Rules are the decision points inside a rule set.

Anatomy of a rule

Every rule has a name (up to 30 characters), an optional description, exactly one condition, and a set of actions.

PartDescription
ConditionThe boolean test. A rule uses either a shared condition or an inline condition — never both. See Conditions.
ActionsWhat runs on a match. A rule uses either shared action sets or an inline list of actions — never both. See Actions Overview.

Shared or inline Referencing shared conditions and action sets lets several rules reuse the same logic; inline definitions keep a one-off rule self-contained. The editor enforces the either/or choice for you.

Evaluation order

When a rule set runs, it evaluates its rules in order (or shuffled, if the set randomizes order). For each rule, the engine resolves the condition against the current context. If the condition is true, the rule matches and its actions are scheduled.

The rule set's Max rules to match setting can stop evaluation early once enough rules have matched, and its rule sequence setting decides whether matched rules run sequentially or in parallel.

What happens on a match

  1. The condition evaluates to true.
  2. The rule's actions are gathered — either the referenced action sets or the inline actions.
  3. The actions run in their configured order, or in a randomized order when the rule enables action randomization.
  4. Actions can read and write the shared context, so later rules and actions see the results. See Data & Transform Actions.

The action sequence within a rule can also be Sequential (default) or Parallel. Run actions sequentially when one action depends on a value an earlier action wrote to the context.

Including and excluding rules

A rule takes effect simply by being part of a rule set. To stop a rule from firing, remove it from the set or tighten its condition so it no longer matches. Because conditions are evaluated against live context, you can also gate a rule behind a context flag — for example, a clause that checks an isEnabled context value — to switch behavior on or off without editing the rule set's structure.