Using variables in a workflow
-
- UpdatedAug 1, 2024
- 5 minutes to read
- Xanadu
- Workflow
Within workflow there are several different types of variables that are available.
Some variables define, describe, or compose the pieces of the workflow (such as workflow activities). Some variables are available specifically to facilitate the execution of a workflow (such as scratchpad variables). Some variables define, describe, or compose the data records being manipulated by the workflow process (for example, the elements of a Glide Record that are defined in a dictionary.xml file describing a record, such as an incident).
Activity variables
Activity variables are properties specifically associated with a workflow activity.
Before you begin
Role required: admin
About this task
These are the inputs that appear on the activity definition when a specific activity is dragged onto the workflow canvas. These variables are properties that define, compose or describe the workflow activity, or the work it is designed to perform.
Activity variables are declared in a related list within the Workflow Activity Definition.
To add, view, or modify a variable:
Procedure
Workflow input variables
Workflow variables are external values that are passed into and referenced by a workflow during its execution.
Before you begin
Role required: admin
About this task
Workflow variables are declared in a form available from the Workflow Editor gear menu.
Procedure
Assigning values to variables from outside of workflow
After being declared in a workflow, values can be assigned to the variables from where the workflow is kicked off.
Assigning Values for Subflow Inputs from inside of a Main Workflow
If a workflow that accepts inputs is called from within another workflow, those input values can be set from the workflow canvas within the UI of the workflow activity. Each input variable declared for a subflow will have a text box input area displayed on the activity. Within these text boxes, the variables can be set with any value either from the scratchpad or from within the current record.
For more information, see Workflows used as subflows.
Reading the Value of a Workflow Input Variable
Workflow scratchpad variables
Store and share string-based variables as name-value pairs between workflow activities.
The scratchpad is global to the instance of the running workflow and as such, is available equally to all activities.
Declaration
Display
View activity scratchpad values from the Workflow Activity History Scratchpad [wf_history_scratchpad] table. Workflow Activity History Scratchpad is also an embedded list in Worfklow Activity History records.

Access and Assignment
Current variables
Current is the database GlideRecord that kicked off the workflow, either by association to the table in the Workflow properties table or by being associated with a catalog item.
Declaration
Variables in current are the columns that are defined in the dictionary.xml file that support the database record. There is no way at runtime to add variables to the current record.
Display
Variables of a current record are displayed on the Glide Forms and Lists throughout the applications that use them.