
Transform Map
CertifiedNormalize and enrich records
Transform Map
Normalize and enrich records
Reshape records by selecting fields, casting types, and deriving new typed values from expressions without scripts.
type: io.kestra.plugin.transform.MapExamples
Normalize records
id: map_normalize_records
namespace: company.team
tasks:
- id: fetch
type: io.kestra.plugin.core.output.OutputValues
values:
records:
- user:
id: c1
createdAt: "2026-01-01T00:00:00Z"
items:
- price: 10.5
- id: map
type: io.kestra.plugin.transform.Map
from: "{{ outputs.fetch.values.records }}"
fields:
customer_id:
expr: user.id
type: STRING
created_at:
expr: createdAt
type: TIMESTAMP
total:
expr: sum(items[].price)
type: DECIMAL
dropNulls: true
onError: SKIP
Map DuckDB stored results
id: map_duckdb_stored
namespace: company.team
tasks:
- id: query1
type: io.kestra.plugin.jdbc.duckdb.Query
sql: SELECT now() as "ts";
fetchType: STORE
- id: map
type: io.kestra.plugin.transform.Map
from: "{{ outputs.query1.uri }}"
outputType: RECORDS
fields:
ts:
expr: ts
type: TIMESTAMP
Map direct output values
id: map_direct_outputs
namespace: company.team
tasks:
- id: query1
type: io.kestra.plugin.jdbc.duckdb.Query
sql: SELECT 1 as "value" UNION ALL SELECT 2 as "value";
fetchType: FETCH
- id: map
type: io.kestra.plugin.transform.Map
from: "{{ outputs.query1.records }}"
fields:
value:
expr: value
type: INT
Download JSON and transform
id: map_http_download
namespace: company.team
tasks:
- id: download
type: io.kestra.plugin.core.http.Download
uri: https://dummyjson.com/products
- id: map
type: io.kestra.plugin.transform.Map
from: "{{ outputs.download.uri }}"
outputType: RECORDS
fields:
first_title:
expr: products[0].title
type: STRING
Properties
fields *object
Fields
Output field definitions keyed by target field name. Each value can be a shorthand expression string or an object with expr, optional type, and optional.
io.kestra.plugin.transform.Map-FieldDefinition
Expression
Per-record expression used to compute the output field value.
falseOptional
When true, allows the field to be absent from the input record. A field that is present with a null value is always allowed and maps to null, whatever this is set to. Expression and cast errors are still handled by onError.
STRINGINTFLOATDECIMALBOOLEANTIMESTAMPLISTSTRUCTOutput type
Optional type to cast the evaluated value to before writing the output field.
from *object
Input records
Ion list or struct to transform, or a storage URI pointing to an Ion file.
assets
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.
io.kestra.core.models.assets.AssetsDeclaration
IGNOREFAILWARNAsset 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.
Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.
The assets consumed as inputs.
io.kestra.core.models.assets.AssetIdentifier
1The assets produced as outputs.
io.kestra.plugin.ee.assets.Dataset
1150{}1150io.kestra.plugin.ee.assets.File
1150{}1150io.kestra.plugin.ee.assets.Table
1150{}1150io.kestra.plugin.ee.assets.VM
1150{}1150io.kestra.core.models.assets.External
1150{}1150io.kestra.core.models.assets.Custom
11501Custom asset type
{}1150dropNulls booleanstring
trueDrop null fields
Omits output fields whose final value is null after mapping.
keepOriginalFields booleanstring
falseKeep original fields
Keeps input fields not explicitly mapped. If you map a_new: a, the original a is still kept.
onError string
FAILFAILSKIPNULLOn error behavior
FAIL stops the task on the first field error, SKIP drops the current record, and NULL writes null for failing fields.
outputFormat string
TEXTTEXTBINARYOutput format
Experimental: TEXT or BINARY. Only transform tasks can read binary Ion. Use TEXT as the final step.
outputType string
AUTOAUTORECORDSSTOREOutput type
AUTO stores to internal storage when the input is a storage URI; otherwise it returns records.
Outputs
records array
Transformed records
JSON-safe records when output mode is RECORDS or AUTO resolves to RECORDS.
uri string
Stored Ion file URI
URI to the stored Ion file when output mode is STORE or AUTO resolves to STORE.