Expand description
§graphrt-code
The code node: runs user-supplied code over workflow variables.
- JavaScript runs in an embedded QuickJS engine (feature
js, on by default). The engine has no file system, network, timers or module loader; memory, stack and execution time are capped. - Other languages (e.g.
python3) run in a host-providedRemoteSandboxservice. The optionalremotefeature providesHttpSandbox, a client for an HTTP sandbox service. The optionalpythonfeature providesSubprocessPython, which runs a localpython3with resource limits — not a security sandbox, for trusted code only.
User code defines main(args), which receives an object with the configured
input variables and returns an object (or a promise of one):
function main({ a, b }) {
return { sum: a + b };
}Inputs are passed with secrets revealed: code nodes frequently need API
keys from env.*. Treat the sandbox as a trusted sink and do not echo
secrets into outputs.
Structs§
- Code
Limits - Resource limits for one code execution.
- Code
Node - The
codenode. - Sandbox
Run - Result of
RemoteSandbox::execute_detailed.
Enums§
- Sandbox
Choice - Where code runs.
Constants§
- KIND
- Node kind handled by this crate.
Traits§
- Remote
Sandbox - A sandbox that executes code out of process (for languages without an embedded engine).
Functions§
- descriptor
- Catalog descriptor of the
codenode. - register
- Register the
codenode kind.