Skip to content

Foreach remapper


Foreach is a remapper that reopens—or, in other words, extends—a previous context of a splitter or another remapper. The portion of the workflow included in its context, which is the continuation of a previous context, is executed in a loop with a number of iterations equal to that of the iterations already carried out in the previous context.


A Foreach block doesn't have an explicit input, while the blocks inside its context have multiple virtual inputs—one per iteration—, consisting of the outputs of blocks from the previous context, plus the output of any blocks that come after the previous context and before the Foreach block.

Block properties

The properties of a Foreach block are accessed by editing the block and are divided into these groups:

  • Basic properties:

    • Block name
    • Component version (read only)
    • Block ID (read only)
  • Functional:

    • Context to reduce: reference context. It is chosen from a drop-down. To remove the choice, select Clear .
    • Keep same context: read-only, always on. It's a reminder that Foreach re-opens the reference context.
  • Deployment:

    • Timeout: execution timeout expressed in minutes (m) or seconds (s).
    • Replicas: number of required instances.
    • Consumer Number: number of threads of the consumer, the software module of the block that provides input to process by taking it from the block's work queue.
    • Memory: required memory.
    • CPU: thousandths of a CPU required (for example: 1000 = 1 CPU).


A Foreach block doesn't have an output of its own. As with splitters and other remappers, the output of the End Context block that must be placed to mark the end of the context is an empty object and the context output must be "pulled out" of it using a reducer.