Skip to content
OpenNodeFlow.DocsOpen beta ↗
Agent guide ↗
Docs/Build workflows

Run typed collections with For Each / Map

Publish a pinned per-item body with bounded parallelism, ordered results and explicit failure policy.

23 Oct 2026 · 3 min read
Markdown ↗

For Each / Map executes a published subflow once per input item. It keeps the parent graph compact while retaining exact body contracts and item-level execution provenance. It is a bounded local container, not an unbounded streaming loop or distributed worker service.

Publish a collection#

First publish a subflow exposing a typed item input, an optional separate number index input and a data result output. Other required public inputs must have defaults. Choose For Each / Map and select the exact body version and those sockets.

Set concurrency, maximum items and failure policy. Concurrency 1 is sequential; the maximum parallel setting is 16. Maximum items is between 1 and 1,000. Publish and insert creates the immutable collection node, exact Items/Results types and a Validate Items conversion node, then inserts a draft instance. Save the parent explicitly.

Supply a correctly typed list directly, or place the generated validator between a general array and the collection. It checks values without coercion and rejects bad item shapes or excessive length before processing. A shape-equivalent custom list type does not automatically connect to the generated exact type.

Results and errors#

The results list contains {index,value} entries validated against the pinned body result. Results are sorted by original input index even when parallel items finish in a different order. errors contains {index,message} for failed items. An empty input returns empty lists without executing the body.

Collect errors and continue admits remaining work and returns successful results with failures. Stop scheduling new items stops new admission after the first observed failure, lets active items settle and fails the collection. It cannot undo requests already accepted by a provider. The normal next route emits only when the container succeeds.

Body node retries and handled error routes remain explicit. Whole-collection retries are rejected because they could duplicate earlier successful items. A worker timeout or cancellation also cannot prove that an external action never happened.

One budget for the container tree#

The outer timeout is an absolute budget including pool waiting, connection preparation, process startup and body execution. Nested collections/repeats share limits of 10,000 item/iteration executions and 50,000 body-node visits. Pin closure is captured at run acceptance; publishing a new leaf or body does not change that run.

Durable timers, event waits and approval nodes are rejected anywhere inside a collection body, including nested subflows. Put those waits outside the container. A host failure interrupts an active collection rather than automatically replaying uncertain item work.

Inspect and debug#

Open the exact pinned body from the instance. Progress exposes completed/total, active and failed items. Body logs and storage history include nested item paths so several invocations remain distinguishable.

Safe debugging pauses before an unmocked collection. Supply a fixture for the collection's complete typed outputs, or explicitly permit real execution. In real mode the collection is one debugger step and its body runs normally; per-item interactive stepping is not provided.

Use mapping for one-object field transformation, subflows for reusable interfaces, and run storage history when an item performed durable writes.

Source provenance

Reviewed against maintained source and topic documentation on 23 October 2026. This is a source snapshot; installed versions and provider access may differ.

  • docs/COLLECTIONS.md
  • docs/SUBFLOWS.md
  • docs/CONTROL-FLOW.md
Type to search the documentation.
↑ ↓ to navigate · Enter to openAgent map ↗