Skip to content

Script

Calculated fields.

Transform Scripting Enterprise edition json

Related reference: Scripting Functions.

script evaluates calculated fields in LyftData’s bundled Lua runtime; it is not a shell action. After condition passes, the optional run snippet executes for that event, then the let pairs execute in their declared order. Each pair can read fields written by earlier pairs, so order is part of the action’s behavior.

Before the action runs, the job bundle’s init.lua is loaded automatically, followed by the optional file named by load. Their helpers are available while events are processed. The Lua runtime has hardcoded limits: a 32 MiB heap cap and a 1,000,000-instruction budget per event.

The sandbox does not install require, dofile, load, loadfile, or collectgarbage. The legacy ip2asn() helper is also not installed. Use the generated Functions reference for the supported helper catalog rather than relying on older Lua guides.

actions:
- script: {}
JSON
{
"actions": [
{
"script": {}
}
]
}

A ✓ marks a field that accepts a context variable such as {{ VARIABLE }}.

General
Field Type Required Description
description string describe this step.
condition lua-expression (string) Expression evaluated before anything else; when it returns false neither the optional run logic nor any let pairs execute for that event.
Examples: 2 * count()
Output
Field Type Required Description
overwrite boolean (bool) Overwrite a field if it already exists.
Default: false
Runtime
Field Type Required Description
load path (string) Load a file containing Lua functions into the current context ‘init.lua’ is loaded by default.
Examples: /path/to/file, c:\users\joe\data\file.txt
Script
Field Type Required Description
bindings map (string) Named string values resolved independently from Lua source and exposed through the read-only bindings table. Binding/deploy authority is secret-use authority because trusted Lua code can deliberately reveal a value.
let map (string) field-expression pairs, evaluated sequentially after the optional run snippet; each expression sees fields created earlier in the list.
run multiline-text (string) Per-event logic executed after the condition passes but before the let pairs run; it can set up state but no longer short-circuits the lets.
Binding Value
webhook_secret `${secret

Key format: unknown. Value format: unknown.

Field Expression
event.field value + 1

Key format: field. Value format: lua-expression.