Skip to main content

Filter conditions reference

A filter condition is a Common Expression Language (CEL) expression stored on a function. When an event triggers the function, the expression decides whether the function runs.

Filter conditions apply to event triggers only. A function invoked through the execute endpoint or by a schedule runs regardless of what the expression says.

Expressions use standard CEL, so the operators and methods below are CEL's, not a TaruviBase dialect.

Evaluation rules​

SituationResult
Expression is null, empty, or whitespaceRuns. An absent condition permits execution
Expression evaluates to trueRuns
Expression evaluates to falseSkipped. No task is dispatched and no invocation record is created
Expression is invalid, or evaluation raisesSkipped. An error never lets the function run

Invalid syntax is also rejected when you save the function, so a malformed expression is normally caught on write rather than at trigger time.

Context​

Three namespaces are available to an expression.

NamespaceContents
eventThe parameters carried by the triggering event
userid, username, email, roles, and user attributes
TimeFields including hour, day of week, and year

Access event parameters by name. Dot notation, bracket notation, and array indexing all work, nested at least three levels deep.

Operators​

GroupOperators
Comparison== != < <= > >=
Logical&& || !
Arithmetic+ - * / %
Membershipin, and ! with in to negate

Arithmetic and logical operators follow standard precedence. Parentheses group explicitly.

Comparisons handle integers, floats, negative numbers, booleans, and strings. A comparison against null, or between mismatched types, evaluates to false rather than raising.

String methods​

MethodReturns true when
contains(x)The string contains x
startsWith(x)The string begins with x
endsWith(x)The string ends with x
matches(x)The string matches regular expression x

All four are case-sensitive. Calling a string method on a null value evaluates to false rather than raising. Methods chain.

Examples​

Run only for one table:

datatable == "announcements"

Run when a table matches and a threshold is met:

datatable == "announcements" && record_count >= 10

Run for either of two tables:

datatable == "orders" || datatable == "payments"

Run for a set of tables:

datatable in ["announcements", "posts"]

Run only for temporary tables:

datatable.startsWith("temp_")

Run only for administrators:

"admin" in user.roles

Run only during business hours:

hour >= 9 && hour <= 17

Failure behavior​

Every failure mode resolves to false, so the function is skipped rather than run on bad input. Undefined field access, division by zero, an invalid regular expression, and an out-of-range array index all behave this way.

Because a skipped execution creates no invocation record, a function that never appears to run is often a filter condition that never matched. See Troubleshooting.