Expressions reference
Complete reference for Kustomer's expression languages. Covers every /#fn function, every Handlebars helper with its arguments and defaults, and the criteria format and operators used by queue rules and satisfaction surveys.
Kustomer has three small expression languages. This page lists everything in each.
For how references, templates and conditions fit together, start with Conditions and variables.
Functions
A function call is a reference that starts with /#fn:. The parts are separated by commas, with no spaces: the function name, a path to the input value, then any arguments.
/#fn:<name>,<path>,<arg1>,<arg2>Because commas separate the parts, arguments can't contain commas (dateFormat's format is the one exception). The path is resolved like any reference, so steps.1.custom.qtyStr means /#steps.1.custom.qtyStr. Write it as a bare path: /#fn:parseInt,steps.1.custom.qtyStr, not /#fn:parseInt,/#steps.1.custom.qtyStr.
Like any reference, a function call only works as the whole value of a param or condition operand. A function name that doesn't exist doesn't fail: it silently returns the input value unchanged, so check spelling carefully.
inBusinessHours
Holidays on the schedule count as closed. If there's no schedule to check against, or the date isn't valid, the result is true.
{
"target": "after-hours-reply",
"condition": { "op": "neq", "values": ["/#fn:inBusinessHours,steps.1.createdAt,64f1c0ffee5ca1ab1e0000aa", true] }
}Handlebars helpers
Use helpers inside templates, with positional arguments first and then key=value options. Wrap them in triple braces, {{{ }}}, so the output isn't HTML-escaped. Arguments can be paths (steps.1.createdAt), quoted strings or numbers.
Dates
dateFormat options: format (Moment.js, default LL, such as "October 21, 2026"), locale (default en-us), inputTimezone and timezone (output; IANA names or UTC). It accepts ISO strings and Unix timestamps in milliseconds, and outputs an empty string for invalid dates.
Signing and encoding
The long hex strings in these examples are workflow variable IDs. Workflows refer to variables by ID, never by name. See Call your own code for signing requests to your own services with authHMAC.
JSON and text
The string helpers from Lodash are available too, each taking one string: camelCase, capitalize, escape, escapeRegExp, kebabCase, lowerCase, lowerFirst, snakeCase, startCase, toLower, toUpper, trim, trimEnd, trimStart, truncate, upperCase and upperFirst.
Conditions accept templates, so these helpers also make text checks case-insensitive: { "op": "contains", "values": ["{{{toLower steps.1.subject}}}", "refund"] }. See Case-insensitive text checks.
Logic
Handlebars' built-ins (if, unless, each, with, lookup) work as documented at handlebarsjs.com.
App settings
In workflows that ship with an app, {{{ setting <app>.<category>.<name> }}} inserts the installing org's value for that setting. Write it with exactly one space inside each set of braces, as shown. To supply a fallback and a type, add them after the path: {{{ setting <app>.<category>.<name> <default> <type> }}}. Settings are resolved before the rest of the template renders, and invalid setting references are rejected when you save the workflow.
Criteria
Queue rules and satisfaction surveys don't use workflow conditions. They use criteria: an object with and and or lists of field checks.
{
"and": [
{ "conversation_channel": { "operator": "in", "value": ["chat"] } },
{ "customer_custom_tierStr": { "operator": "equals", "value": "gold" } }
],
"or": [
{ "conversation_priority": { "operator": "gte", "value": 4 } },
{ "conversation_preview": { "operator": "contains_any_of", "value": ["refund", "chargeback"] } }
]
}The criteria match when every and check passes and at least one or check passes. An empty list doesn't restrict anything, so { "and": [], "or": [] } matches everything.
Field names
A field is <object>_<attribute>, where the object is conversation, customer, message, company or kobject, and the attribute keeps its camelCase name: customer_lastSeenAt, conversation_assignedTeams. Custom attributes are <object>_custom_<name>, such as conversation_custom_orderNumberStr. A few names are shortcuts: conversation_channel checks channels, and customer_email and customer_phone check the primary email and phone.
The queue rules criteria endpoint lists every field you can use, with its type and an operator group (string, number, datetime, boolean, list) that tells you which operators make sense.
Operators
Date comparisons accept ISO 8601 timestamps or relative values: now-2d means two days ago and now+1h an hour from now. The units are s (seconds), m (minutes), h (hours), d (days), w (weeks) and M (months), with up to 99 of each.
{ "customer_lastSeenAt": { "operator": "lt", "value": "now-7d" } }{
"conversation_status": {
"operator": "changes",
"before": { "operator": "equals", "value": "open" },
"after": { "operator": "equals", "value": "done" }
}
}A check on a custom attribute that has since been deleted is ignored, so it passes. Remove such checks when you delete attributes.