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 usedefault(value, fallback)/ optional access (x.?field.orValue(d)) where you'd reach for??.
Collections
| Signature | Description |
|---|---|
join(list, string): string | Join list elements into a string with a separator. |
keys(map): list | List a map's keys. |
values(map): list | List a map's values. |
distinct(list): list | Remove duplicate elements, preserving order. |
reverse(list): list | Reverse a list (copy; never mutates the input). |
flatten(list): list | Flatten one level of nested lists. |
sort(list): list | Sort 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): list | Pair each element with its zero-based position as {index, value}. |
Strings
| Signature | Description |
|---|---|
lower(string): string | Lowercase a string. |
upper(string): string | Uppercase a string. |
trim(string): string | Strip leading/trailing whitespace. |
replace(string, string, string): string | Replace all occurrences of a substring. |
split(string, string): list | Split a string on a separator into a list. |
regexReplace(string, string, string, string?): string | Replace every regex match (RE2 syntax) with a replacement ($1 backrefs); flags like 'i', 'm', 's'. |
regexExtract(string, string, string?): string | First 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): string | Strip a leading prefix if present. |
trimSuffix(string, string): string | Strip a trailing suffix if present. |
Math
| Signature | Description |
|---|---|
abs(dyn): double | Absolute value. |
floor(dyn): double | Round down to an integer. |
ceil(dyn): double | Round up to an integer. |
round(dyn): double | Round to the nearest integer. |
min(list): dyn | Smallest element (by numeric value); null for an empty list. |
max(list): dyn | Largest element (by numeric value); null for an empty list. |
JSON
| Signature | Description |
|---|---|
json(dyn): string | Serialize any value to a JSON string. (host) |
parseJson(string): dyn | Parse a JSON string into a value (numbers come back as doubles). |
Encoding
| Signature | Description |
|---|---|
base64Encode(string): string | Encode a UTF-8 string as base64. (host) |
base64Decode(string): string | Decode a base64 string to UTF-8. (host) |
urlEncode(string): string | Percent-encode a URI component. |
urlDecode(string): string | Decode a percent-encoded URI component. |
Hashing
| Signature | Description |
|---|---|
sha256(string): string | SHA-256 hash, hex-encoded. (host) |
md5(string): string | MD5 hash, hex-encoded. (host) |
sha1(string): string | SHA-1 hash, hex-encoded. (host) |
sha512(string): string | SHA-512 hash, hex-encoded. (host) |
hmac(string, string, string): string | HMAC of message under key for an algorithm (e.g. 'sha256'), hex. (host) |
Null handling
| Signature | Description |
|---|---|
default(dyn, dyn): dyn | Return the value, or the fallback when it is null. |
coalesce(list): dyn | First non-null element of a list, or null. |
Time
| Signature | Description |
|---|---|
nowIso(string?): string | Current time as ISO-8601; UTC by default, or in the given IANA timezone. (non-deterministic) |
today(string?): string | Current calendar date (YYYY-MM-DD); UTC by default, or in the given IANA timezone. (non-deterministic) |
nowMillis(): int | Current time as epoch milliseconds (absolute; timezone-independent). (non-deterministic) |
nowSeconds(): int | Current time as epoch seconds (absolute; timezone-independent). (non-deterministic) |
UUID
| Signature | Description |
|---|---|
uuidv1(): string | Time-based UUID (v1). (non-deterministic) |
uuidv4(): string | Random UUID (v4). (non-deterministic) |
uuidv6(): string | Time-ordered UUID (v6). (non-deterministic) |
uuidv7(): string | Time-ordered UUID (v7). (non-deterministic) |
uuidv3(string, string): string | Name-based UUID (v3, MD5) under a namespace UUID. |
uuidv5(string, string): string | Name-based UUID (v5, SHA-1) under a namespace UUID. |
uuidValidate(string): bool | True if the string is a valid UUID. |
uuidVersion(string): int | The version number of a UUID. |