Flatten
What It Does
Flattens an array of arrays into a single level array, combining all nested elements into one unified list.
Inputs
array
The nested list to flatten
List
Yes
Outputs
array
The resulting flattened list
List

How to Use It
Drag the Array flatten node into your graph.
Connect a nested list (like
[[1, 2], [3, 4]]
) to the "array" input.The node will output a single flattened list (like
[1, 2, 3, 4]
).

Tips
This node only flattens one level deep, not recursively through all nested arrays.
Make sure your input is actually an array of arrays, or the node will throw an error.
See Also
Arrify: For converting any value into an array format.
Concat: For joining multiple arrays together end-to-end.
Use Cases
Merging Token Groups: Combine nested token groups into a flat structure for easier processing.
Simplifying Data Structures: Convert complex nested lists of values into a simpler format for operations.
Processing Multi-dimensional Data: Transform grid-based data into a linear sequence for sequential processing.
Last updated