Skip to main content
Variables make workflows reusable by parameterizing values that change between runs. They are defined in the workflow’s variables field and resolved when the job is submitted.

Variable types

param

User-provided values passed at submission time:
Required param variables must be provided when the job is submitted. Optional variables use the default value when omitted. A param may also declare a valueType — "string" | "number" | "boolean" | "date" | "array" | "object":
When set, two checks apply:
  • At submission — the value is validated against the declared type before the job is queued, for every step that uses the param. Values are validated strictly, not coerced (date accepts an ISO string or a Date; array and object are checked structurally).
  • At build — a {{var.X}} feeding a typed consumer (a task param’s Zod type, or a serviceCall operation’s declared param type) is cross-checked against the variable’s type. A number variable wired into a string param fails validation. (now and dateOffset count as string.)
Omit valueType to leave a param untyped — validated only by whatever consumes it.

dateOffset

A date relative to the submission time:
days: -30 resolves to an ISO date string 30 days before submission. days: 0 resolves to the current date.

now

The current ISO timestamp at submission time:

Using variables

Reference variables with {{var.variableName}} syntax. In service params:
In SQL steps:
Variables in SQL queries are automatically parameterized to prevent SQL injection and formatting issues.
In branch conditions:

Template syntax

Both can be used together in the same step:

Submitting with variables

When submitting a job programmatically, pass variable values in the params object:
Scheduled workflows define their parameter values in schedules.json:
Variables with type: "dateOffset" and type: "now" are resolved automatically — you don’t pass values for them at submission time.

Validation