Skip to content
OpenNodeFlow.DocsOpen beta ↗
Agent guide ↗
Docs/Library asset reference

Filter collection

Filter collection Selects items whose JavaScript predicate is truthy, preserving the original item values and order. Unlike Map collection, this asset has no Execute or next control socket. Sockets and configuration - items (array, required

23 Oct 2026 · 2 min read
Markdown ↗JSON ↗

Filter collection#

Selects items whose JavaScript predicate is truthy, preserving the original item values and order. Unlike Map collection, this asset has no Execute or next control socket.

Sockets and configuration#

  • items (array, required): source collection.
  • items (array): accepted source items. count (number): accepted length.
  • expression (string): new-instance default item != null, removing nulls. If configuration is absent or empty, the code instead falls back to true, retaining everything.

Example#

For items [{"value":5},{"value":12}], use item.value > 10. Output is [{"value":12}] with count 1. The index parameter is the source position; filtering does not rewrite or transform accepted values.

Predicate and execution details#

The expression is compiled with new Function(item, index); it cannot close over node-local inputs/config/context. It uses JavaScript Array.filter synchronously. Do not return a Promise: promises are truthy objects and are not awaited, so an asynchronous predicate would select items incorrectly.

A data dependency determines execution readiness; this asset cannot be gated directly by a control wire without publishing a customized version with a control input. Missing required input fails validation; bad predicate syntax/runtime errors fail execution. An empty source array yields count 0. The shipped wrapper has no secret/state/network calls, but expressions are trusted code with JavaScript globals. Prefer pure predicates because retries can repeat any effects an expression introduces.

Catalog identity#

FieldValue
Source keyapp.core.core.filter
Kindnode
Familyapp-core
PackSee library discovery

Integration guide · Browse the catalog

Inputs#

Socket IDLabelTypeRequiredMeaning
itemsItemsarrayYes

Outputs#

Socket IDLabelTypeRequiredMeaning
itemsItemsarrayNo
countCountnumberNo

Configuration schema#

json
{
  "type": "object",
  "properties": {
    "expression": {
      "type": "string",
      "title": "Predicate",
      "default": "item != null"
    }
  }
}

Source and installed versions#

This reference describes the maintained source catalog snapshot, not a live export of your installation. Published definitions use immutable versions; installed graphs retain their exact pins. Discover and read the installed definition and selected version before wiring it. See versioning, connections and integration setup.

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.

  • ../OpenNodeFlow-Library/work/catalog-all.mjs
  • ../OpenNodeFlow-Library/work/azure-pack-consolidation-20261022/catalog-policy.mjs
  • ../OpenNodeFlow-Library/work/developer-packs-20261022/catalog.mjs
  • shared/seed.ts
  • shared/storage-library.ts
  • shared/variable-library.ts
  • shared/control-flow.ts
  • shared/remote-routes.ts
  • server/runtime-library.ts
  • shared/error-library.ts
  • shared/storage-model.ts
  • shared/builtin-documentation.ts
Type to search the documentation.
↑ ↓ to navigate · Enter to openAgent map ↗