# 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

Canonical URL: https://opennodeflow.dev/wiki/reference-app-core-core-filter/
JSON reference: https://opennodeflow.dev/wiki/reference-app-core-core-filter/index.json
Source snapshot: 2026-10-23

# 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

| Field | Value |
| --- | --- |
| Source key | `app.core.core.filter` |
| Kind | node |
| Family | app-core |
| Pack | See library discovery |

[Integration guide](/wiki/first-workflow/) · [Browse the catalog](/wiki/integration-catalog/)

## Inputs

| Socket ID | Label | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `items` | Items | array | Yes |  |

## Outputs

| Socket ID | Label | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `items` | Items | array | No |  |
| `count` | Count | number | No |  |

## 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](/wiki/versioning/), [connections](/wiki/connections/) and [integration setup](/wiki/integration-setup/).

---

## Documentation provenance

- `../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`

This page describes maintained source, not a live inventory or an authorization to perform actions.
