---
sourceDocument: Zurich Build workflows
sourceDocumentLink: https://www.servicenow.com/docs/r/zurich/build-workflows

 Release :

    - zurich

ft:locale :

    - en-US

ft:publication_title :

    - Zurich Build workflows

ft:clusterId :

    - crworkflow

bundleId :

    - crworkflow

workflow :

    - Creator


---

# Variables

# Flow variables {#ariaid-title1}

* Release version: Zurich
* 
* Updated September 19, 2025
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 2 minutes to read

Summarize  
![AI sparkle icon](https://servicenow.com/docs/portal-asset/ai-sparkle-icon) Summarized using AI  
This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.  

## Summary of Flow variables

Flow variables in ServiceNow enable you to create and modify variables accessible throughout the entire flow.
They function similarly to Workflow scratchpad variables and are available as data pills in the Data panel, allowing you to set and retrieve values dynamically during flow execution.
Unlike subflow inputs and outputs, which are limited to the start and end of subflows, flow variables maintain accessibility throughout the flow's lifecycle.
Show full answer Show less  

## Creating and Using Flow Variables

You create flow variables via the Flow Variables option in the More Actions menu, allowing multiple variables to be defined simultaneously with specified names and data types. These variables then appear as data pills in the Flow Variables section of the Data panel.

To assign or update values, use the Set Flow Variables flow logic, which takes the variable name and the data value as inputs. Values assigned to flow variables are mutable and can be changed at any time during the flow. If a variable is not assigned a value, its default is *null*.

When assigning multiple variables, the order matters because variables can reference earlier variables or other data pills. The last assigned value for any repeated variable assignment is the one used at runtime. Maintaining the correct order ensures proper referencing and prevents unintended null values.

## Execution and Data Types

During flow execution, the Set Flow Variables action provides detailed information in the execution details pane, displaying variable names, types, configurations, and runtime values. This transparency helps track variable state and usage throughout the flow.

Supported data types for flow variables include:

* Array.Object
* Date/Time
* Decimal
* Floating-point number
* Integer
* JSON Object
* Reference
* String
* True/False

## Practical Implications for ServiceNow Customers

Using flow variables enhances your ability to manage data flexibly across different steps of a flow without the constraints of subflow boundaries. This capability allows for more dynamic and maintainable flow designs, enabling you to track and manipulate state information efficiently throughout process execution.

By leveraging flow variables and the Set Flow Variables logic, you can create complex flows that adapt based on intermediate data, improving automation accuracy and responsiveness.  
Similar to Workflow scratchpad variables, create variables that you can use and modify directly in your flow. Access flow variables as data pills directly in the Data panel.

Use flow variables to set and retrieve values throughout a flow. Flow variables are similar
to subflow inputs and outputs. Both define data available to a flow or subflow. The main
difference between them is when they are accessible. Flow variables are accessible throughout
a flow. Inputs are only accessible at the start of a subflow, and outputs are only accessible
when a subflow completes.

## Creating flow variables {#flow-variables__section_gr1_s5b_gnb}

Create variables with the Flow Variables option on the More Actions
menu. You can create several variables at a time by choosing a name and data type for each
one. Flow variables appear as data pills in the Flow Variables section of the Data panel.

## Assigning values to flow variables {#flow-variables__section_fxm_nq1_knb}

Assign values to variables with the Set Flow Variables flow logic. Set Flow Variables has the following inputs:

* The name of the variable.
* The data value for the variable.
{#flow-variables__ul_jvw_wy1_knb}

You can assign values to all of your variables with a single use of Set Flow Variables.
Unlike other data pills, the values assigned to flow variables are mutable and can be
changed at any time. Using Set Flow Variables overrides the current value of the variable.
If no value is assigned to a variable, the default value is null.

Flow variable values are set in the order in which they're assigned from top to bottom. If you set the value of the same variable multiple times, the flow only uses the last value set. For example, these three variable definitions result in the variable having the runtime
value of <kbd class="ph userinput">last value set</kbd>.  
{#flow-variables__table_acm_3k5_hsb__entry__3}

| Order | Variable | Configuration |
|-|-|-|
| 1 | variable | first value set |
| 2 | variable | second value set |
| 3 | variable | last value set |
[Table 1. Last value set defines flow variable value]

{#flow-variables__table_acm_3k5_hsb}

Variable values can reference any data pill from earlier in the flow, including other variables. If you set variable values by reference to other data pills, you must maintain the order of the variable assignments. The referenced value must always come before the variable that uses the referenced value. Changing the order may produce null values. For example, these variable definitions only produce the expected runtime values when you
maintain the order of the variable definitions.  
{#flow-variables__table_x4c_rm5_hsb__entry__4}

| Order | Variable | Configuration | Runtime Value |
|-|-|-|-|
| 1 | variable1 | One | One |
| 2 | variable2 | {variable1}, Two | One, Two |
| 3 | variable3 | {variable1}, {variable2}, Three | One, Two, Three |
[Table 2. Setting variable values by reference]

{#flow-variables__table_x4c_rm5_hsb}

## Flow execution details {#flow-variables__section_hv4_j1k_3nb}

A summary of the Set Flow Variables flow logic appears in the execution details. The
details show the name, type, configuration, and runtime values for all the variables set
with the action. Execution details also provide information about the variables when they're
used in actions or flow logic. In that case, it shows the type, configuration, and runtime
values.

## Supported data types {#flow-variables__section_ztc_v1j_3nb}

Workflow Studio supports the following data types for flow variables:

* Array.Object
* Date/Time
* Decimal
* Floating-point number
* Integer
* JSON
* Object
* Reference
* String
* True/False
{#flow-variables__ul_p4f_m3j_3nb}
* **[Create a flow variable](https://www.servicenow.com/docs/BGlmZjaRjfEWHezujLWD3A)**   
  Create a flow variable to store and retrieve a value throughout a flow.

