Skip to main content

Expressions

Expressions let you use dynamic values in node parameters instead of fixed text. Toggle any parameter between literal mode (fixed value) and expression mode using the mode switch in the parameter input.

Syntax

Wrap expressions in double curly braces:

{{expression}}

Expressions are evaluated as JavaScript. You can reference item data, do arithmetic, call methods, and use the built-in functions documented below.

Referencing Data

Current item

Access fields on the item being processed:

{{$item.data.name}}
{{$item.data.price * $item.data.quantity}}
{{$item.data.email.toLowerCase()}}

Other nodes

Reference output from a specific upstream node by name:

{{$("Get Table").item.data.name}}
{{$("Get Table").item.data.total + $("Get Table").item.data.tax}}

Item index

Access the index of the current item (zero-based):

{{$itemIndex}}

Date Functions

Expressions include built-in date functions that respect your workflow's timezone setting. All dates and times are interpreted in the configured timezone (defaulting to UTC if none is set).

$today()

Returns a LidoDateTime representing the current date at midnight in the workflow timezone. When used directly in a string context, it returns "YYYY-MM-DD". Use .format() for other formats.

{{$today()}}                          // "2026-03-20"
{{$today().year}} // 2026
{{$today().month}} // 3
{{$today().day}} // 20
{{$today().format("MM/DD/YYYY")}} // "03/20/2026"
{{$today().format("dddd, MMMM D")}} // "Friday, March 20"

$now()

Returns a LidoDateTime representing the current date and time in the workflow timezone. When used directly in a string context, it returns "YYYY-MM-DD HH:mm:ss". Use .format() for other formats.

{{$now()}}                                     // "2026-03-20 14:30:00"
{{$now().hour}} // 14
{{$now().minute}} // 30
{{$now().second}} // 0
{{$now().format("YYYY-MM-DD HH:mm:ss")}} // "2026-03-20 14:30:00" (24-hour)
{{$now().format("YYYY-MM-DD hh:mm:ss A")}} // "2026-03-20 02:30:00 PM" (12-hour)
{{$now().format("h:mm a")}} // "2:30 pm"

$dateAdd(dateString, amount, unit)

Adds a duration to a date string and returns a new date string. Preserves the input format: date-only inputs return date-only strings, datetime inputs return datetime strings.

ParameterTypeDescription
dateStringstringA date ("2026-03-20") or datetime ("2026-03-20 14:30:00") string
amountnumberHow many units to add
unitstringThe unit — "day", "month", "year", "hour", "minute", "second", "week"
{{$dateAdd("2026-03-20", 1, "day")}}          // "2026-03-21"
{{$dateAdd("2026-03-20", -7, "day")}} // "2026-03-13"
{{$dateAdd("2026-01-15", 2, "month")}} // "2026-03-15"
{{$dateAdd($today().value, 30, "day")}} // 30 days from today

LidoDateTime Object

$today() and $now() return LidoDateTime objects with properties and chainable methods.

Properties

PropertyTypeDescription
valuestringThe datetime string
yearnumberFour-digit year
monthnumberMonth (1 – 12)
daynumberDay of month (1 – 31)
hournumberHour (0 – 23)
minutenumberMinute (0 – 59)
secondnumberSecond (0 – 59)

Methods

All methods that return a LidoDateTime can be chained.

.plus(amount, unit)

Returns a new LidoDateTime with the duration added.

{{$today().plus(7, "day")}}                   // 7 days from today
{{$now().plus(2, "hour")}} // 2 hours from now
{{$today().plus(1, "month").plus(5, "day")}} // 1 month and 5 days from today

.minus(amount, unit)

Returns a new LidoDateTime with the duration subtracted.

{{$today().minus(30, "day")}}                 // 30 days ago
{{$now().minus(1, "year")}} // same time last year

.startOf(unit)

Returns a new LidoDateTime set to the start of the given unit.

{{$now().startOf("month")}}                   // first of the current month at 00:00:00
{{$now().startOf("day")}} // today at 00:00:00

.endOf(unit)

Returns a new LidoDateTime set to the end of the given unit.

{{$now().endOf("day")}}                       // today at 23:59:59
{{$now().endOf("month")}} // last day of the month at 23:59:59

.format(pattern)

Returns a formatted string. Uses dayjs format tokens. When called without a pattern, defaults to "YYYY-MM-DD HH:mm:ss".

Common tokens for time: HH (24-hour, 00–23), hh (12-hour, 01–12), h (12-hour, 1–12), A (AM/PM), a (am/pm).

{{$now().format("YYYY-MM-DD")}}               // "2026-03-20"
{{$now().format("MM/DD/YYYY")}} // "03/20/2026"
{{$now().format("dddd, MMMM D")}} // "Friday, March 20"
{{$now().format("HH:mm")}} // "14:30" (24-hour)
{{$now().format("h:mm A")}} // "2:30 PM" (12-hour)
{{$now().format()}} // "2026-03-20 14:30:00"

.diff(other, unit)

Returns the difference between two dates as a number.

{{$today().plus(7, "day").diff($today(), "day")}}   // 7
{{$now().diff("2026-01-01 00:00:00", "day")}} // days since Jan 1

The other parameter can be a LidoDateTime or a date string. The unit parameter defaults to "millisecond" if omitted.

.toISODate()

Returns the date portion as "YYYY-MM-DD".

{{$now().toISODate()}}                        // "2026-03-20"

.toISODateTime()

Returns the full datetime in ISO 8601 format.

{{$today().toISODateTime()}}                  // "2026-03-20T00:00:00"

Examples

Filter items older than 30 days

In a Filter node, use an expression condition:

{{$dateAdd($item.data.created_date, 30, "day") < $today().value}}

Set a due date 14 days from today

In an Edit Item node:

{{$today().plus(14, "day").toISODate()}}

Calculate days until deadline

{{$today().diff($item.data.deadline, "day") * -1}}

Get the first day of next month

{{$today().plus(1, "month").startOf("month").toISODate()}}