Script Steps
Run a small Lua transformation inside the engine, in the same commit that starts the Work Item.
Write a Script
A Script Step declares type: script and a Lua script. Its inputs are available as variables named by their invocation names. Return a table keyed by output Attribute name:
{
"id": "format-name",
"name": "Format Name",
"type": "script",
"attributes": {
"first_name": {"role": "required", "type": "string"},
"last_name": {"role": "required", "type": "string"},
"display_name": {"role": "output", "type": "string"}
},
"script": {
"language": "lua",
"script": "return {display_name = first_name .. ' ' .. last_name}"
}
}
A script that returns anything other than a table produces one output named result. Argyll compiles the script when the Step is registered, so a syntax error fails registration.
A Script Step completes in the commit that starts it. That commit can rerun, so keep scripts pure and bounded.
Sandbox
Scripts run inside the engine without the io, os, debug, and package libraries, and without require, dofile, loadfile, load, _G, and getmetatable. The string, table, math, and bit32 libraries are read-only. Every script also has two helpers for lists: has(list, value) tests membership, and has_prefix(list, prefix) tests whether any string in the list starts with the prefix.
Scripts run in the engine process, so use them only for trusted code. Keep larger domain operations in the service that owns them so they retain that service’s tests, deployment lifecycle, and telemetry.
Health
A Script Step reports its own health. A compile or evaluation error marks the Step unhealthy, and the next success marks it healthy.