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

Parameter
Type
Description

list

array / string

The list to iterate over. If a string is provided, it must be a valid JSON array.

Input Ports

Port
Description

in

Receives the list to iterate over.

Output Ports

Port
Description

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

Field
Description

index

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

Field
Description

count

The total number of processed items.

correlationId

Unique identifier for tracking batch execution.

Instructions

  1. Provide a List

    • Ensure the input list is an array or a valid JSON string representing an array.

  2. Processing Items

    • Each item in the list is sent separately to the item port.

    • The done port is triggered after all items are processed.

  3. Handling Index and Correlation ID

    • Each item is assigned an index and a correlationId 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?