Variables

Variables hold values shared by runs of one definition. Use them for a common setting such as an escalation threshold; use workflow input for data belonging to one request. Variables are mutable, not a snapshot of one run's original input.

Configure variable

  1. Open the workflow definition that should receive submissions.

  2. Open Variables from the workflow actions.

  3. Enter a Variable key using only letters A-Z or a-z, digits 0-9, and underscores. Do not use spaces or hyphens.

  4. Enter a valid Variable JSON value, then select Save variable. Reusing a key updates its value.

  5. Expand a saved key to inspect its value. Use its Delete action only after checking the expressions that depend on it.

variables.png

For example, use key reviewPolicy with this JSON value:

{
  "approvalThreshold": 500,
  "notifyTeam": "operations"
}

A task's Input Parameters can select one property:

{
  "threshold": "${['swf:variables'].reviewPolicy.approvalThreshold}"
}

JSON values can be objects, arrays, strings, numbers, booleans or null; quote a JSON string.

Changing or deleting a shared variable can affect later expression evaluations, including work already in progress.

Test with a non-production definition first. If a value is rejected, check JSON syntax, the key, count and displayed byte limit.

Do not store credentials in variables when a task has a dedicated credentials field.