Skip to main content

Variables

Workflow Variables allow you to define reusable values that can be set at run time without editing the workflow. Use them to make your analysis flexible and shareable: collaborators can run the same workflow with different parameters without touching the workflow structure.

Variables use the syntax {{@variable_name}} and can be inserted into most tool parameter fields.

Workflow Variables

Variable Types​

TypeUse for
StringText values: names, labels, filter criteria
NumberNumeric values: distances, thresholds, counts

Creating Variables​

1
Click the {} Variables icon in the toolbar at the bottom of the canvas to open the Variables dialog.
2
Click Add Variable.
3
Enter a Name. Names must start with a letter or underscore and contain only letters, digits, and underscores, no spaces (e.g. buffer_distance, not buffer distance).
4
Select a Type: String or Number.
5
Optionally enter a Default value.
6
Optionally enter a Label. The label is what people see instead of the technical name, wherever they pick the variable or set its value (e.g. Maximum grouping distance for max_grouping_distance). Expressions and SQL keep using the name. To add help text, click the speech bubble Description next to the variable, type a Description (up to 500 characters) and click beside the box to keep it; Esc discards the change. A filled icon Description added shows that a variable has a description, and hovering over it shows the text.
7
Click Done to save. To delete a variable, click the delete icon next to it.

Using Variables in Tool Parameters​

Click the {} icon inside any compatible parameter field and select the variable you want to insert. Once inserted, the field displays the variable reference (e.g. {{@variable_name}}) highlighted in green, indicating the field is driven by a variable.

A variable with a label is listed by its label, with its reference next to it, and its description appears when you hover over it. A field that holds a labelled variable shows the label below it. When you type {{@ in a field, the suggestions match both names and labels; in the SQL editor they match names and show each label next to its name.

tip

Use descriptive names that clearly explain the parameter's purpose: buffer_distance instead of dist, poi_type instead of type.

Running Workflows with Variables from the Map View​

Workflows with variables can be run directly from the Map view without opening the workflow editor.

1
Open the Toolbox and click the Workflows tab.
2
Click on a workflow from the list to open it.
3
A Variables section appears showing all variables defined in the workflow. Set the values you want to use for this run. Each field is titled with the variable's label (or its name, if it has none), and its description is shown below the field.
4
Click Run. The workflow executes with the values you entered. Click Reset to restore the default values.
info

The values you enter here only apply to this run. Next time you open the workflow, the default values are restored.