Node reference
Actioncode

Run code

Run JavaScript or Python in the cloud or on a paired device.

When to use it

Use it for custom calculations or data shaping that Transform cannot express.

Configuration

FieldTypeWhat it controls
Run code onCloud | deviceCloud uses an isolated Worker; device uses a configured local interpreter.
Languagejavascript | pythonSandbox runtime. Default: JavaScript.
Code*stringSource code with input in scope.
InputJSONSerializable value exposed to the program.
Wall / CPU timeoutsecondsDefaults: 180 s wall, 30 s CPU; maximums: 600 s and 300 s.

* Required

Output

result, stdout, and stderr.

Example

JavaScript: return input.items.filter((item) => item.total > 100);

Good to know

  • Cloud: no npm/PyPI packages, Node APIs, eval, or sockets. JavaScript may use fetch; Python has no network access.
  • Device: locally installed packages and network access are available. Code has the device user's permissions; the agent must opt in to each interpreter.
  • Source and input are each capped at 256,000 characters; JavaScript may make up to 250 subrequests.