Dive

Control steps

filter

Splits a list into the items that pass a per-item condition and the items that don't.

How it works

  • over must produce a list. The gate runs once per item, with {{item}} and {{index}} available.
  • Gate it with exactly one of where, infer or decide. See Conditions and bodies.
  • With decide, the result also includes each item's probabilities.

When to use it

  • Narrow a list before map, so later steps only see items they can handle.
  • Prefer where when a field comparison decides. infer and decide make one model call per item; set concurrency to run them in parallel.

Input

Maximum infer verdicts in flight; 1 (default) evaluates one at a time.

decideobject

A per-item yes/no question answered by a decision model (only when one is configured); keeps the element when its probability reaches min_confidence. Results add probabilities, aligned with over.

0 to 1; default 0.5

A decision model role; defaults to decider

decide.questionstringrequired

The data to judge, usually {{item}}

inferstring

A yes/no question about {{item}}; the element is kept on yes. One judge call per item.

modelstring

Model role for infer verdicts (any configured role, standard or custom); defaults to the judge role.

overanyrequired

The list to partition — usually a template like {{E0.issues}} that resolves to an array.

whereobject
where.openum<string>required

Available options: eq, ne, gt, lt, gte, lte, empty, not_empty, contains

Comparison operand (omit for empty/not_empty)

where.valueanyrequired

Usually a template about the current element, like {{item.status}}

Result

Later steps read these as {{<step id>.<field>}}.

countinteger

How many items passed.

droppedobject[]

The items that didn't pass.

How many items didn't pass.

itemsobject[]

The items that passed, in their original order.

With decide: each item's probability, in list order.

- id: E1
  tool_name: filter
  input:
    over: "{{input.over}}"
{
  "count": 2,
  "dropped": [
    {
      "…": "…"
    }
  ],
  "dropped_count": 1,
  "items": [
    {
      "…": "…"
    },
    {
      "…": "…"
    }
  ],
  "probabilities": [
    0.91,
    0.12,
    0.77
  ]
}