Portal Community

$ctx — Context Directive

Reads environment, tenant, application, platform, user, and time values.

ExpressionReturns
{@ $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.

ExpressionReturns
{@ $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).

ExpressionReturns
{@ $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.

ExpressionReturns
{@ $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.

ExpressionReturns
{@ $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

ExpressionReturns
{@ $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.

Arithmetic
{@ $js`return context.input.price * 1.2` }
120 (when price = 100)
String manipulation
{@ $js`return context.vars.fullName.split(' ').map(w => w[0]).join('')` }
"JD" (for "John Doe")
Conditional logic
{@ $js`return context.input.age >= 18 ? 'adult' : 'minor'` }
"adult" or "minor"

$cs — C# Directive

Executes inline C# via Roslyn. Requires Trusted isolation level. The script receives a Globals object.

Math rounding
{@ $cs`return Math.Round(Globals.Input.Amount * Globals.Vars.TaxRate, 2)` }
Date calculation
{@ $cs`return DateTime.UtcNow.AddDays(30).ToString("yyyy-MM-dd")` }

$tpl — Liquid Template Directive

Renders a named Liquid template stored in the database. The template context receives all execution data.

Named template
{@ $tpl.InvoiceEmail }
Rendered HTML email body
Inline Liquid template
{@ $tpl`Dear {{ user.name }}, your order #{{ order.id }} is confirmed.` }

$api — External API Directive

Makes an HTTP call to an allowlisted external endpoint. Requires Trusted isolation.

GET request, extract path from JSON response
{@ $api.CurrencyService/rates/USD.rate }
1.08 (USD/EUR rate from external API)
External lookup with option
{@ $api.UserDirectory/profile.displayName @cache-thread }
Cached for the duration of the workflow thread

$math — Math Functions

ExpressionReturns
{@ $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

ExpressionReturns
{@ $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.

Tenant-wide alias
@company.taxRate
Resolves to stored expression → e.g., {@ $ctx.tenant.taxRate } → 0.15
App-specific override
@hr.maxLeaveBalance
App-scoped alias overrides tenant-wide alias if AppId matches
In a template
Total payable: {@ $var.subtotal } × tax rate @company.taxRate