Reference for the CEL expression language used in conditions, actions, validation, and filters.
Sevro uses CEL (Common Expression Language) for all logic: method conditions, actions, computed fields, validation rules, authorization policies, and record filters.
CEL is a simple, fast, and safe expression language designed for embedded use. It's not Turing-complete — no loops, no recursion — which makes it predictable and debuggable.
"paid" // set status to "paid"params.customer_name // copy parameter to fieldnow() // set timestamp to current timerecord.amount * 0.9 // compute discounted price
// Only allow marking as paid if status is draftrecord.status == "draft"// Only allow cancel if not already paidrecord.status != "paid"// Only allow order if amount is positive and customer is activerecord.amount > 0 && record.customer_active == true
// Set a field to a constant"paid"// Copy a parameterparams.customer_name// Set timestampnow()// Compute a valuerecord.price * record.quantity// Conditional valuerecord.status == "draft" ? "submitted" : record.status
// Age must be non-negativerecord.age >= 0// Email must contain @record.email.contains("@")// End date must be after start daterecord.start_date < record.end_date// Discount can't exceed 50%record.discount <= 0.5
// Active usersrecord.is_active == true// Created in the last 30 daysrecord.created_at > "2024-01-15T00:00:00Z"// Name starts with "A"record.name.startsWith("A")// Status is one of several valuesrecord.status in ["draft", "pending", "review"]
Sevro supports registering custom Go functions callable from CEL. This allows extending the expression language with domain-specific logic. Custom functions are registered at the platform level via plugins (WASM modules).