Nodes
Concat#
The Concat node allows you to concatenate two arrays together into a single output array. It is useful when you need to combine data from multiple sources or when you want to merge arrays in a specific order.
Inputs#
a
(array): The first input array to concatenate. Defaults to an empty array if not provided.b
(array): The second input array to concatenate. Defaults to an empty array if not provided.
Outputs#
result
(array): The concatenated output array containing all elements from thea
andb
input arrays, in that order.
Configuration#
This node does not have any additional configuration options.
Usage#
- Connect the first array you want to concatenate to the
a
input of the Concat node. - Connect the second array you want to concatenate to the
b
input of the Concat node. - The concatenated array will be available at the
result
output of the node.
Example#
Suppose you have two arrays:
["apple", "banana"]
connected to thea
input["cherry", "date"]
connected to theb
input
The Concat node will output the following array at the result
output:
In the context of a spell, you might use the Concat node to combine data from different API responses or to merge user-provided options with default values.
Best Practices#
- Ensure that the data types of the elements in both input arrays are compatible and make sense to concatenate together.
- Be mindful of the order in which you connect the input arrays, as the elements from the
a
input will come before the elements from theb
input in the concatenatedresult
array.
Common Issues#
- If either of the input arrays is not properly connected or contains unexpected data, the Concat node will still output an array, but it may be empty or contain only the elements from one of the input arrays.
- Concatenating large arrays may impact performance, especially if done repeatedly in a loop. Consider alternative approaches or optimize your spell's logic if you encounter performance issues.