The Set Variable node lets you build a new, custom object out of values from earlier steps — combining fields, doing simple math, formatting text and dates, or just renaming things into a tidier shape your later steps can use.
Think of it as your "do some quick spreadsheet-style work" step: instead of writing code, you define a set of fields and the value (and type) each one should have.
Use a Set Variable node whenever you need to reshape or compute data partway through a flow, such as:
Combining a customer's first and last name into one field
Calculating a discounted price or a percentage
Formatting a raw date into something readable
Falling back to a default value when a field might be missing
Pulling specific fields out of a list of items (e.g. just the IDs)
Field Required Description Step name Yes A name for this step's output, used to reference it later in your flow. Must start with a letter or underscore (no spaces or special characters). Fields Yes (at least 1) Each field has a key (its name), a value (a Handlebars expression), and a type (how to interpret the result). Click Add field for more.
Type What it does Text Keeps the result as a plain string Number Converts the result to a number (defaults to 0 if it isn't a valid number) Boolean true if the value is "true" or "1", otherwise false Date Converts the result into a standard ISO date string Array Parses the result as a JSON array — use this with helpers like pluck (see below) Object Parses the result as a JSON object
These are available inside any field's value expression. Click helpers next to a field in the dialog to browse and insert them.
String
Helper Example Does uppercase {{uppercase order.name}} ALL CAPS lowercase {{lowercase order.email}} all lowercase capitalize {{capitalize customer.firstName}} First letter up truncate {{truncate product.title 50}} Trim to N characters, adds … trim {{trim field.value}} Removes surrounding whitespace replace {{replace text "foo" "bar"}} Find & replace concat {{concat first " " last}} Joins strings together split {{split tags ","}} Splits a string into an array pad_start {{pad_start id 5 "0"}} Pads a string to a length
Number
Helper Example Does add {{add order.subtotal 5}} a + b subtract {{subtract price discount}} a − b multiply {{multiply price 1.2}} a × b divide {{divide total quantity}} a ÷ b (returns 0 if dividing by zero) round {{round price 2}} Rounds to N decimal places currency {{currency order.total "$"}} Formats as $1,234.00 percent {{percent sold total}} Percentage of total number_format {{number_format value 2}} Adds thousands separators, e.g. 1,234.56
Date
Helper Example Does format_date {{format_date order.createdAt "MMM DD, YYYY"}} Formats a date (supports YYYY, YY, MMMM, MMM, MM, DD, HH, mm, ss) date_add {{date_add order.date 7 "days"}} Adds time to a date (seconds/minutes/hours/days/weeks) now {{now}} Current timestamp (ISO format) timestamp {{timestamp}} Current timestamp (Unix milliseconds)
Logic
Helper Example Does default {{default customer.phone "N/A"}} Falls back to a value if the field is empty coalesce {{coalesce a b c}} Returns the first non-empty value ternary {{ternary order.paid "Paid" "Unpaid"}} Inline if/else
Array
Helper Example Does first {{first orders}} First item in an array last {{last orders}} Last item in an array count {{count orders}} Number of items join {{join tags ", "}} Joins an array into a string pluck {{json (pluck orders "id")}} Extracts one field from every item in a list sum {{sum orders "total"}} Adds up a field across all items
Each field becomes a property under the Step name you chose.
Example:
Key Value Type fullName {{concat order.first_name " " order.last_name}} Text discountedPrice {{round (multiply order.price 0.9) 2}} Number
If the Step name is customerData, later steps can reference: {{customerData.fullName}} and {{customerData.discountedPrice}}
When using a field type of Array or Object, wrap your expression in the json helper, e.g. {{json (pluck orders "id")}}. Without it, helpers that return a list or object will display incorrectly as plain text instead of being parsed back into real array/object data.
If a field's expression fails to evaluate for any reason, Set Variable won't stop your flow — it quietly sets that field to null and continues with the rest. This is helpful for reliability, but it also means a typo in an expression can fail silently. If a downstream step is getting unexpected null values, check the corresponding field here first.
For Number fields, anything that can't be converted to a valid number becomes 0 rather than causing an error — keep this in mind if a calculation looks off; it may be silently treating bad input as zero.
divide returns 0 instead of throwing an error when dividing by zero, so a calculation involving division won't break your flow, but double-check results if a quantity field could realistically be zero.
Navigate