Expression Samples
Working examples for every built-in directive, from simple reads to chained templates.
$ctx — Context Directive
Reads environment, tenant, application, platform, user, and time values.
| Expression | Returns |
|---|---|
{@ $ctx.env.DATABASE_URL } | Environment variable DATABASE_URL |
{@ $ctx.tenant.id } | Current tenant ID (integer) |
{@ $ctx.tenant.name } | Tenant display name |
{@ $ctx.tenant.timezone } | Tenant IANA timezone string |
{@ $ctx.app.id } | Current application ID |
{@ $ctx.app.name } | Application name |
{@ $ctx.user.id } | Authenticated user ID |
{@ $ctx.user.name } | User display name |
{@ $ctx.user.email } | User email address |
{@ $ctx.platform.region } | Deployment region identifier |
{@ $ctx.now } | Current UTC datetime (ISO 8601) |
{@ $ctx.today } | Current date only (YYYY-MM-DD) |
{@ $ctx.now @date:yyyy-MM-dd HH:mm } | Formatted datetime string |
$var — Memory Variable Directive
Reads variables stored in workflow execution memory. Supports dot-path navigation into JSON objects.
| Expression | Returns |
|---|---|
{@ $var.invoiceTotal } | Variable invoiceTotal from memory |
{@ $var.customer.name } | Nested path in JSON object variable |
{@ $var.items[0].price } | First element of an array variable |
{@ $var.invoiceTotal @json } | Serialized as JSON string |
{@ $var.discount @default:0 } | Returns 0 if variable is null/missing |
{@ $var.status @uppercase } | Variable value uppercased |
$input — Node Input Directive
Reads fields from the current node's input item(s).
| Expression | Returns |
|---|---|
{@ $input.current.email } | email field from the current active item |
{@ $input.current.address.city } | Nested path in current item |
{@ $input.first.id } | id from the first item in the input collection |
{@ $input.last.amount } | amount from the last item |
{@ $input.items } | Full input item array (serialized) |
{@ $input.current._binary.attachment } | Binary field (file attachment) |
$output — Node Output Directive
Reads output from a previously-executed node in the same thread.
| Expression | Returns |
|---|---|
{@ $output.ParseInvoice.total } | Field from ParseInvoice node's output |
{@ $output.FetchUser.profile.email } | Nested path from FetchUser node output |
{@ $output.HttpCall.statusCode } | HTTP status code from a previous HTTP node |
$exec — Execution Metadata
Runtime information about the current execution instance.
| Expression | Returns |
|---|---|
{@ $exec.executionId } | Unique execution ID (GUID) |
{@ $exec.threadId } | Current thread ID |
{@ $exec.nodeKey } | Current node's key |
{@ $exec.startedAt } | Execution start timestamp |
{@ $exec.triggeredBy } | Trigger type (Manual/Webhook/Scheduled) |
{@ $exec.retryCount } | How many times this node has been retried |
$flow — Workflow Metadata
| Expression | Returns |
|---|---|
{@ $flow.current.name } | Workflow display name |
{@ $flow.current.version } | Workflow version number |
{@ $flow.current.id } | Workflow definition ID |
{@ $flow.current.tags } | Workflow tags (JSON array) |
$js — JavaScript Directive
Executes inline JavaScript in a Jint sandbox. The script receives a context object with access to input, variables, and metadata. Available at Sandboxed isolation level.
$cs — C# Directive
Executes inline C# via Roslyn. Requires Trusted isolation level. The script receives a Globals object.
$tpl — Liquid Template Directive
Renders a named Liquid template stored in the database. The template context receives all execution data.
$api — External API Directive
Makes an HTTP call to an allowlisted external endpoint. Requires Trusted isolation.
$math — Math Functions
| Expression | Returns |
|---|---|
{@ $math.abs(-42) } | 42 |
{@ $math.floor(3.7) } | 3 |
{@ $math.ceil(3.2) } | 4 |
{@ $math.round(3.567, 2) } | 3.57 |
{@ $math.min(10, 20) } | 10 |
{@ $math.max(10, 20) } | 20 |
$items — Global Item Collection
| Expression | Returns |
|---|---|
{@ $items.count } | Total number of items in the global collection |
{@ $items.first } | First item |
{@ $items.last } | Last item |
{@ $items.sum.amount } | Sum of amount field across all items |
{@ $items.avg.price } | Average of price field |
{@ $items.max.score } | Maximum value of score field |
{@ $items.min.score } | Minimum value of score field |
@ — Canned Expression (Alias)
Resolves a named alias to its stored expression, then evaluates the underlying expression.