Skip to main content
ZEN is GoRules’ expression language for transforming data and evaluating conditions. It’s designed to be readable by non-programmers while powerful enough for complex business logic.

Two modes

ZEN operates in two modes depending on context:

Standard mode

Full expressions that return values.

Literals

Operators

Arithmetic

Comparison

Logical

Ternary

Null coalescing

Returns the first non-null value:

Range check

Property access

Template strings

String slicing

Extract substrings using [start:end] notation:

Unary test mode

Shorthand syntax used in decision table input columns when a field name is defined. The value being tested is implicitly available, allowing you to write conditions without repeating the field name. When an input column has no field name, standard expression mode is used instead.

Comparisons

Ranges

Lists

Combined conditions

Functions in unary mode

The $ symbol represents the value being tested.

Closures and iteration

The # symbol represents the current element when iterating:

Named aliases

For readability, use as to name the current element:
This is equivalent to using # but clearer when expressions are complex.

Assignment

Create values and build objects within expressions.

Basic assignment

Property assignment

Assign to nested paths — intermediate objects are created automatically:

Multiple assignments

Separate with semicolons:

Assignment with expressions

Returning values

The last expression determines the return value:
Use $root to return the entire context object.