{{}} template-string interpolation, the 36 built-in functions, and type coercion rules. Expressions are used in conditions (WHEN, CHECK, constraint rules), value assignments (SET), template interpolation ({{}}), and function calls. For rich content output formats (voice, cards, carousels, interactive actions, templates), see Rich content.
Expression syntax
Comparison operators
Logical operators
Write logical operators in uppercase (
AND, OR, NOT). ! is also accepted as a prefix negation.
Unary operators
Operator precedence
- Parentheses
() - Unary operators (
NOT,IS SET,IS NOT SET) - Comparison operators (
==,!=,>,<,>=,<=,contains,matches) ANDOR
Variable paths and dot notation
Reference variables using dot notation to access nested values.Path resolution rules
- The evaluator looks up the full path in the session context.
- The Platform resolves each segment left to right:
user.address.cityresolvesuser, thenaddresson the result, thencity. - If any segment resolves to
nullorundefined, the entire path resolves toundefined. - Array access uses bracket notation:
items[0],items[2].name.
Template strings
Template strings use{{}} syntax for variable interpolation within RESPOND, summary, and other string properties — including inside a TEMPLATES: block body:
Conditional sections
Templates support conditional rendering with{{#if}}...{{/if}}:
Function calls in templates
You can call built-in functions within template strings:Built-in function reference
ABL provides 36 built-in functions organized into seven categories (plus the CEL-only content-analysis helpers described below). All functions are called withFUNCTION_NAME(arg1, arg2, ...) syntax. Function names are uppercase.
Math functions
Math functions coerce string arguments to numbers automatically:
ADD("2", "3") returns 5.
String functions
The string functions gracefully handle
null and undefined and return an empty string: UPPER(null) returns "".
To prevent memory issues, the limit on string output is 100,000 characters.
Formatting functions
The mask patterns are explained below.
The default mask character is
*. Pass a third argument to use a different character: MASK(ssn, "last4", "x").
The date format uses the following notations:
Example:
FORMAT_DATE("2024-03-15T10:30:00Z", "YYYY-MM-DD HH:mm") returns "2024-03-15 10:30".
FORMAT_DATE formats in UTC by default — a date-time string without an explicit offset is interpreted as UTC, so the output is deterministic regardless of where the runtime executes. Pass an optional IANA timezone name as the third argument to format in that zone instead:
Type checking and coercion functions
Array functions
Object functions
OBJECT_KEYS and OBJECT_VALUES return an empty array for non-object inputs (null, arrays, strings).
OBJECT_MERGE accepts any number of arguments and skips non-object values.
Utility functions
COALESCE considers 0 and false as valid (non-null) values: COALESCE(0, "fallback") returns 0.
UNIQUE_ID generates a random alphanumeric string suitable for reference numbers. It is not cryptographically secure — do not use it for tokens or secrets.
Content-analysis functions (CEL guardrails)
CEL-based guardrail checks have access to an additionalabl.* namespace of content-analysis helpers:
In CEL expressions the core functions above are also available under the
abl. namespace with lowercase names (e.g. abl.upper(x)), and CEL-native operators (&&, ||, !, %, in, ternary ? :) and macros (size(), has()) can be used.abl.pii_equal(left, right) compares two values without ever exposing the underlying plaintext to the expression — both left and right must be live PII-vault tokens (the opaque form a PII-classified value takes once captured, e.g. via a sensitive: true GATHER field), and the comparison happens inside the vault itself. Values are canonicalized before comparing (email lowercased/trimmed, phone/SSN/credit-card digits-only, etc.), so abl.pii_equal(session.data.values.email, caller_provided_email) matches Member@Example.com against member@example.com.
Nested function calls
Functions can be nested as arguments to other functions:Using expressions in ABL
In conditions (WHEN, CHECK, constraint rules)
In SET assignments
In template interpolation
In TRANSFORM pipelines
Type coercion rules
The evaluator applies these coercion rules during expression evaluation:Related articles:
- Rich content — voice configuration, format-specific output, carousels, interactive actions, and templates
- Memory and constraints — condition expressions in constraint rules, variable paths and session context
- Multi-Agent and supervisor — condition syntax for WHEN clauses in routing/escalation
- Data Types and utilities — types used in function signatures, lookup validation functions