Transform Filter

Transform Filter

Certified

Filter records

Keep or drop records based on a boolean expression.

yaml
type: io.kestra.plugin.transform.Filter

Keep active customers

yaml
id: filter_active_customers
namespace: company.team

tasks:
  - id: normalize
    type: io.kestra.plugin.core.output.OutputValues
    values:
      records:
        - customer_id: c1
          is_active: true
          total_spent: 120
        - customer_id: c2
          is_active: false
          total_spent: 90

  - id: filter
    type: io.kestra.plugin.transform.Filter
    from: "{{ outputs.normalize.values.records }}"
    where: is_active && total_spent > 100
    onError: SKIP
Installation

Our standard Docker images already include this plugin. If you use a -slim image or another setup, install it with the following command:

kestractl plugins get io.kestra.plugin:plugin-transform-records --compatible-for $KESTRA_VERSION

For kestractl, use your Kestra version with --compatible-for, or specify an exact plugin version.

Properties

Input records

Ion list or struct to transform, or a storage URI pointing to an Ion file.

Filter expression

Expression evaluated on each record and required to return true or false. ==, != and in compare numbers by value but never match a string to a number, so "200" == 200 is false. >, >=, < and <= parse a numeric string compared with a number, so "200" > 199 is true, but compare two strings as text.

Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.

Definitions
assetFailureBehaviorstring
Possible Values
IGNOREFAILWARN

Asset failure behavior

Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.

enableAutobooleanstring

Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.

inputsarray

The assets consumed as inputs.

id*string
Min length1
typestring
outputs

The assets produced as outputs.

id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*string
Min length1

Custom asset type

descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
DefaultFAIL
Possible Values
FAILSKIPKEEP

On error behavior

FAIL stops the task on expression errors, SKIP drops the current record, and KEEP emits the original record when the filter expression fails.

DefaultTEXT
Possible Values
TEXTBINARY

Output format

Experimental: TEXT or BINARY. Only transform tasks can read binary Ion. Use TEXT as the final step.

DefaultAUTO
Possible Values
AUTORECORDSSTORE

Output type

AUTO stores to internal storage when the input is a storage URI; otherwise it returns records.

Filtered records

JSON-safe records when output mode is RECORDS or AUTO resolves to RECORDS.

Stored Ion file URI

URI to the stored Ion file when output mode is STORE or AUTO resolves to STORE.