Assign
Assigns an array to a variable in the specified scope.
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
info
If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.
Inputs
- Array - The array to assign. Can be retrieved from the message scope or defined using JavaScript expressions.
Outputs
- Array - The assigned array result, stored in the specified scope (Message, Flow, Global, or Custom).
How It Works
The Assign node assigns an array to a variable, making it available in the selected scope. When executed, the node:
- Receives an array through the Array input
- Validates that the input is a valid array
- Assigns the array to the output variable in the specified scope
- Handles thread-safe operations when assigning to Global or Flow scopes
- Returns an empty array if the input array has no elements
Requirements
- Valid array as input (can be empty)
Error Handling
The node will return specific errors in the following cases:
- Invalid array input
- Scope-related access issues
Usage Examples
Example 1: Assign Array to Flow Variable
Assign a list of customer names to a flow variable for use throughout the automation:
- Create an array using JavaScript:
["John", "Mary", "David", "Sarah"] - Set Array input to the created array
- Set Array output scope to "Flow" with name "customerNames"
- The array is now accessible throughout the flow as
{{flow.customerNames}}