AI Rule Engine Docs
Go to App

Conditions

A condition is the boolean test that decides whether a rule fires. Conditions are built from clauses, organized into groups, and combined with AND / OR / NONE logic.

Clauses

A clause is the smallest unit of a condition. It has three parts:

  • Left side — the value to test. Usually a context key, but a clause has a Key / Expression toggle: switch it to Expression to test a computed value such as len(ctx.name). See Expression Language.
  • Operator — the comparison to apply.
  • Value — what to compare against. This is a value input, so it can be a constant, a context key, a variable, or an expression. See Data Types & Values.

A clause reads in plain language as <left side> <operator> <value>, for example “ticket.priority Equals High”.

Comparison operators

When you build a clause you pick one operator. Most come as a positive/negative pair:

CategoryPositiveNegative
EqualityEqualsNot equal
Text containsContainsNot containing
Text edgesStarts with, Ends withNot starting with, Not ending with
OrderingGreater than, Greater than or equal, Less than, Less than or equal
MembershipInNot in
RangeBetweenNot between
PatternMatches RegExNot matching RegEx
AI promptMatches AI PromptNot matching AI Prompt
PresenceIs emptyNot empty

Most operators compare against a single value, but two take a different shape: In and Not in take a list of candidate values and match when the left side equals any (or none) of them, and Between and Not between take two bounds (a lower and an upper). You supply those extra values in the clause editor, or as comma-separated shorthand in a decision-table cell.

AI-evaluated clauses The Matches AI Prompt and Not matching AI Prompt operators ask an AI model whether the context value satisfies the prompt you write in the comparison value. These clauses require an AI selection (provider and model) — see AI Models & Providers. The Is empty and Not empty operators ignore the comparison value entirely.

Array values: aggregate and quantifier

When the left side of a clause resolves to an array, two optional modifiers decide how the comparison applies across its elements. A clause uses at most one of them.

Aggregate

An aggregate reduces the array to a single scalar before the operator runs, so you compare the summary, not the elements:

AggregateReduces the array to
NoneNo aggregation (the default).
CountThe number of elements.
SumThe total of the elements.
AverageThe mean of the elements.
MinThe smallest element.
MaxThe largest element.

Aggregates work only with a comparison operator — Equals, Not equal, Greater than / Greater than or equal, Less than / Less than or equal, Between, or Not between. Choose any other operator and you get “Aggregates need a comparison operator (Equals, Greater/Less than, Between).”

Quantifier

A quantifier applies the operator to each element and folds the per-element results into one true/false:

QuantifierThe clause is true when
Any elementAt least one element satisfies the operator (the default).
All elementsEvery element satisfies the operator.
No elementNo element satisfies the operator.

One or the other Aggregate and Quantifier are mutually exclusive — choosing one clears the other. Neither is available with the AI-prompt operators. Both can also be set from a decision-table cell's popover.

Condition groups and boolean logic

Clauses are combined inside a condition group. Every group has a logic mode that determines how its members are combined:

LogicMeaning
AllAND — the group is true only if every member is true.
AnyOR — the group is true if at least one member is true.
NoneThe group is true only if no member is true.

A group's members can be clauses or other groups. Because groups nest, you can express arbitrarily complex logic — for example, “All of (A, Any of (B, C))” — without losing readability.

Referencing context and variables

Both sides of a clause draw on data resolved at run time. The left side is a context key or an expression; the right side is a value input that resolves to a constant literal, a context key, an environment variable, or an expression. This means a condition can compare two context values against each other — or two computed values — not just a value against a fixed constant.

Inline vs. shared conditions

A condition can be defined inline on a single rule, or saved as a named, reusable condition within the project and referenced from many rules. Shared conditions are edited in the condition editor; inline conditions live with their rule. See Rules.