Skip to main content

CEL Functions

Functions available in Telo CEL expressions (!cel "..." tags and ${{ }} interpolations). This page is generated from the runtime registry, so it matches what the kernel actually provides. Locally, telo cel functions prints the same list and telo cel eval "<expr>" evaluates an expression.

non-deterministic functions re-evaluate per call (in an x-telo-eval: compile field they bake once at load). host functions need the kernel's host handlers (Node crypto / Buffer).

CEL has no assignment or statements. Reuse a subexpression with the cel.bind(name, init, expr) macro, and use default(value, fallback) / optional access (x.?field.orValue(d)) where you'd reach for ??.

Collections

SignatureDescription
join(list, string): stringJoin list elements into a string with a separator.
keys(map): listList a map's keys.
values(map): listList a map's values.
distinct(list): listRemove duplicate elements, preserving order.
reverse(list): listReverse a list (copy; never mutates the input).
flatten(list): listFlatten one level of nested lists.
sort(list): listSort a list numerically (numbers) or lexicographically; copy.
range(int): list<int>Integers [0, n-1] (empty for n <= 0); materializes indices for an unknown-length list.
enumerate(list): listPair each element with its zero-based position as {index, value}.

Strings

SignatureDescription
lower(string): stringLowercase a string.
upper(string): stringUppercase a string.
trim(string): stringStrip leading/trailing whitespace.
replace(string, string, string): stringReplace all occurrences of a substring.
split(string, string): listSplit a string on a separator into a list.
regexReplace(string, string, string, string?): stringReplace every regex match (RE2 syntax) with a replacement ($1 backrefs); flags like 'i', 'm', 's'.
regexExtract(string, string, string?): stringFirst whole match of a regex (RE2 syntax), or '' when there is none.
regexExtractAll(string, string, string?): list<string>Every whole match of a regex (RE2 syntax), in order.
regexGroups(string, string, string?): list<string>Capture groups of the first regex match (RE2 syntax); empty list when there is no match.
trimPrefix(string, string): stringStrip a leading prefix if present.
trimSuffix(string, string): stringStrip a trailing suffix if present.

Math

SignatureDescription
abs(dyn): doubleAbsolute value.
floor(dyn): doubleRound down to an integer.
ceil(dyn): doubleRound up to an integer.
round(dyn): doubleRound to the nearest integer.
min(list): dynSmallest element (by numeric value); null for an empty list.
max(list): dynLargest element (by numeric value); null for an empty list.

JSON

SignatureDescription
json(dyn): stringSerialize any value to a JSON string. (host)
parseJson(string): dynParse a JSON string into a value (numbers come back as doubles).

Encoding

SignatureDescription
base64Encode(string): stringEncode a UTF-8 string as base64. (host)
base64Decode(string): stringDecode a base64 string to UTF-8. (host)
urlEncode(string): stringPercent-encode a URI component.
urlDecode(string): stringDecode a percent-encoded URI component.

Hashing

SignatureDescription
sha256(string): stringSHA-256 hash, hex-encoded. (host)
md5(string): stringMD5 hash, hex-encoded. (host)
sha1(string): stringSHA-1 hash, hex-encoded. (host)
sha512(string): stringSHA-512 hash, hex-encoded. (host)
hmac(string, string, string): stringHMAC of message under key for an algorithm (e.g. 'sha256'), hex. (host)

Null handling

SignatureDescription
default(dyn, dyn): dynReturn the value, or the fallback when it is null.
coalesce(list): dynFirst non-null element of a list, or null.

Time

SignatureDescription
nowIso(string?): stringCurrent time as ISO-8601; UTC by default, or in the given IANA timezone. (non-deterministic)
today(string?): stringCurrent calendar date (YYYY-MM-DD); UTC by default, or in the given IANA timezone. (non-deterministic)
nowMillis(): intCurrent time as epoch milliseconds (absolute; timezone-independent). (non-deterministic)
nowSeconds(): intCurrent time as epoch seconds (absolute; timezone-independent). (non-deterministic)

UUID

SignatureDescription
uuidv1(): stringTime-based UUID (v1). (non-deterministic)
uuidv4(): stringRandom UUID (v4). (non-deterministic)
uuidv6(): stringTime-ordered UUID (v6). (non-deterministic)
uuidv7(): stringTime-ordered UUID (v7). (non-deterministic)
uuidv3(string, string): stringName-based UUID (v3, MD5) under a namespace UUID.
uuidv5(string, string): stringName-based UUID (v5, SHA-1) under a namespace UUID.
uuidValidate(string): boolTrue if the string is a valid UUID.
uuidVersion(string): intThe version number of a UUID.