Each
Overview
The Each Component iterates over a list and outputs a new message for each item. It allows processing list elements individually, enabling sequential execution of subsequent actions.
Usage
Input Parameters
list
array
/ string
The list to iterate over. If a string is provided, it must be a valid JSON array.
Input Ports
in
Receives the list to iterate over.
Output Ports
item
Emits each item from the list with additional metadata.
done
Fires after all items have been processed, providing the total count and correlation ID.
Output Data for item
Port
item
Portindex
The index of the current item in the list.
value
The value of the current item.
count
Total number of items in the list.
correlationId
Unique identifier for tracking batch processing.
Output Data for done
Port
done
Portcount
The total number of processed items.
correlationId
Unique identifier for tracking batch execution.
Instructions
Provide a List
Ensure the input
list
is an array or a valid JSON string representing an array.
Processing Items
Each item in the list is sent separately to the
item
port.The
done
port is triggered after all items are processed.
Handling Index and Correlation ID
Each item is assigned an
index
and acorrelationId
to track processing.
Notes
Supports JSON Parsing: If
list
is a string, it will attempt to parse it as JSON.State Persistence: Keeps track of progress and resumes processing if interrupted.
Efficient for Iteration: Useful for batch processing workflows requiring individual handling of list elements.
Last updated
Was this helpful?