Skip to main content

How it works

  • over must produce a list. The body (do) runs once per item, in order.
  • {{accumulator}} holds the running value, starting at initial. Each run’s result becomes the next {{accumulator}}.
  • {{item}} and {{index}} are available too.

Limits

  • Always runs one item at a time. For independent per-item work, map first and reduce its results.
  • The body can’t contain another map or reduce.

Input

object | object[]
required
any
Starting accumulator value (any JSON; may use templates). Defaults to null.
any
required
The list to fold — usually a template like {{E1.results}} that resolves to an array.

Result

Later steps read these as {{<step id>.<field>}}.
integer
How many items ran.
object
The final value of the accumulator.