
GraalVM FileTransform
CertifiedTransform rows with Ruby on GraalVM
GraalVM FileTransform
Transform rows with Ruby on GraalVM
Streams rows from from (kestra:// URI, map, or list), lets Ruby mutate row via Polyglot.import, and writes the result as an ION file. Set concurrent to parallelize (order not preserved). Export row = nil to drop a record; export rows with Polyglot.export('rows', [...]) to emit several rows instead of row (an empty array drops the record).
type: io.kestra.plugin.graalvm.ruby.FileTransformExamples
id: transformRuby
namespace: company.team
tasks:
- id: download
type: io.kestra.plugin.core.http.Download
uri: https://dummyjson.com/carts/1
- id: jsonToIon
type: io.kestra.plugin.serdes.json.JsonToIon
from: "{{outputs.download.uri}}"
- id: transformRuby
type: io.kestra.plugin.graalvm.ruby.FileTransform
from: "{{ outputs.jsonToIon.uri }}"
script: |
row = Polyglot.import('row')
if row[:id] == 55
# remove un-needed row
Polyglot.export('row', nil)
else
# remove the 'products' column
row[:products] = nil
# add a 'totalItems' column
row[:totalItems] = row[:totalProducts] * row[:totalQuantity]
endProperties
from *string
Source file containing rows to transform
Accepts a kestra:// internal storage URI, map, or list; rows stream into the script before being rewritten as ION
script *string
Script body to execute
Template-rendered source code run by GraalVM in the selected language; flow variables are resolved before execution
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
{}1150concurrent integerstring
Parallel transformations to execute
Number of concurrent workers; ordering is not preserved when set and execution defaults to sequential when null
options object
Advanced GraalVM context options
Maps directly to GraalVM's Context.Builder#options: one entry per option key/value, for example python.WarnOptions or js.ecmascript-version.
Keys that would weaken the sandbox already enforced by this task are rejected at execution time: python.PosixModuleBackend, any key related to host access or class loading, and any key prefixed with engine. or sandbox..
Outputs
uri string
uriURI of a temporary result file
The file will be serialized as an ION file.
Metrics
records counter
countNumber of records or entities processed by the Ruby script. This includes both modified and filtered rows from the input file.