Using Expressions in Nodes

View as Markdown

An expression is a small formula that produces a value when a workflow runs. Use one whenever a setting should be worked out from the data in a run rather than typed in ahead of time: a premium with tax added, a condition that checks a score, a label chosen from a status. Under the hood these are written in CEL, the expression language, but you rarely need to think about the name; on this page we just call them expressions.

Expressions show up in many places: the conditions on a Check or Conditional node, the formula on a Map node, inside a string template, and in any node setting that accepts one.

Referencing values

An expression reads values that earlier steps produced by naming the group, the step, and the value:

node.contact.email
config.default_sender
secret.crm_api_key

You usually pick these from the builder’s value picker rather than typing them. See Variables & Data Flow for the full picture of where values come from.

What you can write

Expressions cover the everyday building blocks of logic and math.

You want to…Write something likeResult
Do arithmeticnode.quote.premium * 1.08The premium plus 8% tax
Join text togethernode.contact.first_name + " " + node.contact.last_nameSarah Chen
Compare valuesnode.score.value >= 80true or false
Check textnode.status.value == "active"true or false
Combine conditionsnode.is_verified.value && node.score.value > 70true only if both hold
Either/or conditions`node.is_error.value
Choose between two valuesnode.score.value >= 70 ? "Pass" : "Fail"One of the two labels
Build a list[node.primary.url, node.secondary.url]A list of two values
Build a set of fields{"name": node.contact.name, "age": node.contact.age}A small record
Read a list itemnode.items.list[0]The first item
Count a listnode.items.list.size()How many items

The ? : form reads as “if this, then the first value, otherwise the second.” It is the most common way to pick a value based on a condition.

A worked example

Chen Insurance Group scores each inbound quote request in an earlier step. A Check node then turns that score into a decision using two expressions, tried in order:

node.risk.score >= 80 && node.documents.complete
node.risk.score >= 50

If the applicant’s score is 80 or higher and their documents are complete, the first condition wins and the request is approved. Otherwise, if the score is at least 50, the second wins and it goes to review. If neither is true, the node’s default outcome applies. This is how a run reacts to real data instead of fixed values.

Text inside quotes is compared exactly, including uppercase and lowercase, so "Active" and "active" are not the same. Match the exact value the earlier step produces.

Expressions can also call functions, like counting a list or formatting a phone number. See the Function Reference for what is available.