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
-
Open the workflow definition that should receive submissions.
-
Open Variables from the workflow actions.
-
Enter a Variable key using only letters
A-Zora-z, digits0-9, and underscores. Do not use spaces or hyphens. -
Enter a valid Variable JSON value, then select Save variable. Reusing a key updates its value.
-
Expand a saved key to inspect its value. Use its Delete action only after checking the expressions that depend on it.
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.