Script
Script (script)
Section titled “Script (script)”Calculated fields.
Transform Scripting Enterprise edition json
Related reference: Scripting Functions.
Discussion
Section titled “Discussion”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.
Minimal example
Section titled “Minimal example”actions: - script: {}JSON
{ "actions": [ { "script": {} } ]}Contents
Section titled “Contents”A ✓ marks a field that accepts a context variable such as
{{ VARIABLE }}.
General
Section titled “General”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
Section titled “Output”Output
| Field | Type | Required | Description |
|---|---|---|---|
overwrite ✓ |
boolean (bool) |
Overwrite a field if it already exists. Default: false |
Runtime
Section titled “Runtime”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
Section titled “Script”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. |
Schema
Section titled “Schema”Bindings Table
Section titled “Bindings Table”| Binding | Value |
|---|---|
webhook_secret |
`${secret |
Key format: unknown. Value format: unknown.
Let Table
Section titled “Let Table”| Field | Expression |
|---|---|
event.field |
value + 1 |
Key format: field. Value format: lua-expression.