Action
codeRun 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
| Field | Type | What it controls |
|---|---|---|
| Run code on | Cloud | device | Cloud uses an isolated Worker; device uses a configured local interpreter. |
| Language | javascript | python | Sandbox runtime. Default: JavaScript. |
| Code* | string | Source code with input in scope. |
| Input | JSON | Serializable value exposed to the program. |
| Wall / CPU timeout | seconds | Defaults: 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.
