Set Variable
The Set Variable node is a utility component that allows users to set a variable during runtime. This variable can be retrieved and used at a later stage in the workflow.
Node Details
-
Name: SetVariable
-
Type: SetVariable_Utilities
-
Version: 2.0
-
Category: Utilities
Input Parameters
-
Input
-
Label: Input
-
Type: string | number | boolean | json | array
-
Optional: true
-
List: true
-
Description: The value to be stored in the variable. Can be of various types.
-
-
Variable Name
-
Label: Variable Name
-
Type: string
-
Placeholder: var1
-
Description: The name of the variable to be set.
-
Outputs
-
Output
-
Label: Output
-
Base Classes: string, number, boolean, json, array
-
Description: The same value as the input, passed through for further use in the workflow.
-
Functionality
-
The node accepts an input of various types (string, number, boolean, JSON, or array).
-
If the input is an array with a single element, it extracts that element.
-
The node sets a dynamic variable with the name specified in the “Variable Name” input.
-
The input value is both set as the dynamic variable and passed through as the output.
Use Cases
-
Storing intermediate results in a workflow
-
Passing data between different stages of a process
-
Temporarily holding user input or API responses
-
Creating named variables for complex workflows
Notes
-
The variable set by this node is only available during runtime and within the current workflow execution.
-
This node is particularly useful in scenarios where data needs to be stored temporarily and accessed by multiple nodes in a workflow.
-
The ability to handle various data types makes this node versatile for different kinds of workflows and data processing tasks.