Manage variables
Flow variables are used to store, share, and reuse data during the execution of a flow. They allow information to be passed between nodes, dynamically displayed in the UI, and reused throughout the flow logic. IO supports different types of variables, each serving a specific purpose.
Variable types
Generic flow variables
Generic flow variables are always available in any flow and are automatically managed by the system.
They can be referenced directly within nodes using the variable syntax, for example:
{{flow.error.message}} can be used to retrieve or display the error that happened during flow execution.
These variables are typically used to access runtime information, errors, or flow-related metadata.
Flow node variables
Flow node variables are user-defined variables created during flow execution.
They are generated by using the Save in the flow store function available in certain nodes. Once created, they are accessible for the entire execution of the flow.
They can be referenced using the following syntax, for example:
{{customAttribute.customValue}}
These variables are commonly used to store user input or data produced by previous nodes.
Language variables
Language variables are used primarily in frontend forms to display localized text.
They are referenced using the following syntax, for example:
$t(words.credentials_form_title)t$
Translations are loaded into the flow from a JSON file as explained in the languages documentation, allowing the same flow to support multiple languages.
Display available variables
In the IO designer, a dedicated Flow Variables panel is available on the right side, accessible via the corresponding icon. This panel displays the flow variables that can be used, indicates in which node they are created, and allows you to copy them directly using a dedicated button.
Language variables are not displayed in this panel.
Variable naming conventions
When creating custom variables, follow these best practices:
-
Use descriptive names:
userEmailinstead ofvar1 -
Use camelCase or snake_case:
firstNameorfirst_name -
Avoid special characters: Stick to letters, numbers, and underscores
-
Be consistent: Use the same naming pattern throughout your flows
-
Indicate data type:
isActive(boolean),userCount(number)
Variable scope
Understanding variable scope is important:
Node level
-
Created within a specific node
-
Available to all subsequent nodes in the flow
-
Stored in flow session context
Flow level
-
Available throughout the entire flow execution
-
Persists across all nodes
-
Cleared when flow ends
Session level
-
Stored in Redis cache
-
Available for the duration of the session
-
Expires based on session TTL
Using variables in nodes
Accessing variables
Use double curly braces to reference variables:
{{variableName}} # Simple variable
{{user.email}} # Object property
{{user.address.city}} # Nested property
{{items[0]}} # Array element
{{items[0].name}} # Array object property
Setting variables
Variables are typically set using the "Save in the flow store" option in node configurations:
-
Open the node configuration
-
Navigate to "Save in the flow store" tab
-
Select the data fields to save
-
Specify the variable name
-
Save the node configuration
Common patterns
User input storage:
{{formData.username}}
{{formData.password}}
API response storage:
{{apiResponse.userId}}
{{apiResponse.data.profile}}
Computed values:
{{calculatedTotal}}
{{validationResult}}
Variable management best practices
-
Minimize variables: Only store data you'll actually use
-
Clear naming: Make variable purposes obvious
-
Document complex variables: Add comments explaining data structure
-
Avoid conflicts: Don't reuse variable names for different purposes
-
Clean up: Remove unnecessary variables to improve performance
Debugging variables
To troubleshoot variable issues:
-
Check the Variables panel: Verify the variable exists and is created by the expected node
-
Verify spelling: Ensure variable names match exactly (case-sensitive)
-
Check node order: Variables are only available after the node that creates them
-
Review node configuration: Confirm "Save in the flow store" is properly configured
-
Test with simple values: Start with hardcoded values before using variables
Common variable issues
Variable not found
Problem: {{myVariable}} displays as empty or causes an error
Solutions:
-
Verify the variable is created before it's used
-
Check spelling and case
-
Ensure the creating node executed successfully
Variable overwritten
Problem: Variable value changes unexpectedly
Solutions:
-
Check if multiple nodes write to the same variable
-
Use unique variable names for different purposes
-
Review flow logic for unintended assignments
Nested property access fails
Problem: {{user.profile.email}} doesn't work
Solutions:
-
Verify the object structure exists
-
Check that all parent properties are defined
-
Test with simpler paths first (e.g.,
{{user}})