ManagementGuide
Common Expression Language (CEL) Guide

Octelium conditions are based on the Common Expression Language (CEL). CEL expressions are used to easily write dynamic, context aware and performant one-liner conditions that evaluate a boolean value used to match a rule without having to actually have to learn a new programming language.

Numbers

2 > 1
3 > 2 && 2 > 1
3 > 2 || 4 < 3
size([1,2,3]) == 3
[1,2,3].size() == 3
1 in [2,1,3]
((25 < 50) ? 'yes' : 'no') == 'yes'
int(3.14) == 3
uint(3.14) == 3u
int("3") == 3

Strings

Strings have their own methods and functions. Here are some examples:

"group-1".startsWith("group")
"other-group".endsWith("group")
"one-more-group".contains("more")
"group-1" in ["group-1", "group-2", "group-3"]
"pet".size() == 3
["group-1", "group-3"].hasAny(["group-1", "group-2"])
["group-1", "group-2", "group-3"].hasAll(["group-1", "group-3"])
"City".toLower() == "city"
"City".toUpper() == "CITY"
"some_val".split("_")[0] == "some"
["hello", "mellow"].join() == "hellomellow"
" \ttrim\n ".trim() == "trim"
"tacocat".substring(4) == "cat"
"gums".reverse() == "smug"
"hello hello".replace("he", "we") == "wello wello"
"cairo".matches('^[a-z]{5}$')
"%s %s".format(["hello", "world"]) == "hello world"
'hello mellow'.indexOf('ello') == 1
'hello mellow'.lastIndexOf('ello') == 7
int("123") == 123
string(123) == "123"
string(3.14) == "3.14"
string(true) == "true"
bool("true")
'a' < 'b'

Lists

Lists have their own methods that provides you with some important utilities. Here are some examples:

[1,2,3,4].min() == 1
[1,2,3,4].max() == 4
[1,2,3].all(i, i > 0)
["group-1", "group-2"].all(x, x.startsWith("group"))
["london", "paris", "berlin"].filter(x, x.contains("in"))[0] == "berlin"
["london", "paris"].exists(x, x.endsWith("is"))
[10, -10, 100].exists_one(x, x < 0)
[1,2,3].map(x, x*2)[2] == 6

Maps

{'a': 10, 'b': 5, 'c': 20}.size() == 3
{'a': 1, 'b': 2, 'c': 3}.exists(key, key == 'b')
has({'a': 1, 'b':2}.a)
'key1' in {'key1': 'value1', 'key2': 'value2'}
{'id': 123, 'age': 42}['age'] == 42

Math

math.least([2,1,3]) == 1
math.greatest([2,1,3]) == 3
math.abs(-1) == 1

Time

Octelium provides you with the function now() to use the current timestamp. Also, the timestamp() function converts a RFC3339 time format to a timestamp. Moreover, you can use the duration() function to compare time durations. Here are some examples:

now() > timestamp(ctx.user.metadata.createdAt)
(now() - timestamp(ctx.user.metadata.createdAt)) > duration("12h")
duration('1h') == duration('60m')
duration("1.5h") - duration("-1.5h") == duration("3h")
timestamp('2024-04-21T12:00:00Z') <= timestamp('2025-02-26T12:00:00Z')

JSON

You can parse/unmarshal a JSON string as a map and use it in your logic. Here is an example:

json.parse('{"key1": "val1"}')["key1"] == "val1"

You can also marshal a JSON object to a string as follows:

json.marshal(json.parse('{"key1": "val1"}')) == '{"key1": "val1"}'
© 2026 octelium.comOctelium Labs, LLCAll rights reserved
Octelium and Octelium logo are trademarks of Octelium Labs, LLC.
WireGuard is a registered trademark of Jason A. Donenfeld