Runs sandboxed JavaScript (Jint engine) against pipeline input and workflow variables. Use for custom logic that declarative Transform nodes cannot express — without spawning a shell process.
When to use
- Compute derived fields from upstream JSON (thresholds, scoring, routing keys).
- Combine
input with vars (workflow + global persistent variables).
- Lightweight data shaping on edge agents and desktop — same engine as on-prem API.
When not to use
- Declarative extract/rename/scale — prefer Transform.
- OS commands, Python, or Node on disk — use Command Line instead.
- Reusable compiled logic versioned in git — use a custom plugin DLL.
Script API
| Name | Description |
input | Value from the upstream node (object, array, string, or number after JSON parse). |
vars | Map of workflow + global variable keys to string values. |
log(...) | Append debug lines (captured in output logs). |
return | Return an object/array/primitive — becomes output downstream. |
Properties
| Property | Type | Description |
| JavaScript | textarea | User script body. Supports {{$var.key}} placeholders in the editor text. Required. |
| Timeout (seconds) | number | Hard limit for script execution. Default: 10, max 60. |
Example
const temp = input?.temperature ?? 0;
const limit = Number(vars.threshold ?? 30);
log(`temp=${temp} limit=${limit}`);
return {
alert: temp > limit,
temperature: temp,
level: temp > 40 ? 'critical' : 'normal'
};
Outputs
| Field | Description |
output | Value returned by the script (or null). |
logs | Array of strings from log(...). |
durationMs | Execution time in milliseconds. |
Runtime export & agent bundles
- Built into Nodlyn.Runtime — no extra plugin DLL required.
- Works in single-workflow exports and multi-workflow agent bundles.
- Not available in cloud execution (on-prem / edge only).
Notes
- Marked Dangerous — operator approval is required at runtime (see Approval Gates).
- Sandbox limits: statement count, call depth, 1 MB output cap. No filesystem or network APIs exposed.
- Cannot be used inside sub-workflows that contain other Dangerous nodes (same rule as Command Line).
- In Dry-Run mode the script is not executed — a preview message is returned.
See also