POST /v1/capabilities/{id}/run, or use it as a step in a
workflow.
Prices are on the live catalogue — they change, and a stale price here would be
worse than none.
code.run_node
any → text · Billed per second
Execute a Node.js snippet in an isolated sandbox and return the value of result (or output).
When to use
- JSON manipulation — parse, transform, or validate JSON payloads with native JS tooling.
- String processing — use regex, template literals, or Buffer operations.
- Lightweight scripting — run any logic that benefits from the Node.js standard library.
Inputs & outputs
Input
Parameters
Output
Runtime
- Standard library only. The sandbox image has no package manager;
numpy,pandasandrequestsare not available. - No network. Outbound connections, including DNS, are blocked.
- No persistent filesystem. Anything written is discarded when the run ends.
- Memory is capped at 512 MB (Python) / 1 GB (Node) and the run is killed at
timeout_seconds.
Examples
Simple arithmetic
Transform an array with input variables
Print progress while returning a value
Multi-file projects
Instead ofsource, a step can carry files — a map of path to content — with
entrypoint naming which of them runs. source and files are mutually
exclusive: set exactly one.
The files are written into a fresh working directory for the run, and the entry
point executes from there, so one file can import another
(require('./lib/util') in Node). The directory is deleted when the run ends;
nothing is shared between runs.
In a multi-file run the entry point does not execute as a plain script: it runs
inside a wrapper with a real module/exports pair bound, the way an ordinary
CommonJS module does. The run’s answer is chosen in this order: result, then
output, then module.exports (counted as an answer when it was reassigned —
module.exports = {...} — or when the initially-empty object was populated in
place — exports.foo = ...), then null. Files other than the entry point that
you load with require('./lib/util') are ordinary CJS modules with no such
caveat — their own module.exports behaves exactly as Node normally behaves,
independent of this priority order.
Paths must be relative, use / as the separator, and stay inside the working
directory — no leading /, no ...
Limits: at most 64 files, 64 KiB per file, and 96 KiB for the whole request
(files, vars and all). Exceeding one is a validation error, not a failed run.
Dependency packages are not available: only the standard library and whatever
the runtime image already ships. If you need a third-party package, see
Vendored dependencies below.
Vendored dependencies
Archive support is off by default on this deployment — an operator must explicitly enable it, or a run usingarchive_file_id refuses with archive_mode_disabled regardless of anything an author sets.
Instead of source or files, a step can carry archive_file_id — the id of
a previously-uploaded archive whose unpacked contents become the working
directory. entrypoint names which unpacked file runs (a relative path, e.g.
src/main.js).
Upload a .zip or a .tar.gz/.tgz to get the id — those are the two
formats the file upload endpoint accepts for this purpose. The sandbox can
also unpack a .rar (and one can still reach it through a worker-registered
file), but the upload endpoint does not admit one directly, so an author
cannot get a .rar into archive_file_id by uploading it. Re-pack as .zip
or .tar.gz if that’s what you have.
This is how you bring a third-party package into the sandbox: pack your
project together with its dependencies already installed (e.g. a
node_modules directory checked in ahead of time) into the archive. The
dependencies are vendored inside the archive — nothing is installed, and no
package registry is ever contacted. This is not a shortcut: the sandbox has
no network at all, so npm install, pip install, or any other install step
run inside the sandbox would simply fail. All of a run’s dependencies must
already be sitting on disk, inside the archive, before the run starts.
source, files and archive_file_id are mutually exclusive: set exactly
one. Unlike files, the archive’s contents are not known until it is unpacked
inside the sandbox at run time, so only entrypoint’s presence is checked when
the step is saved — a wrong path is discovered when the run actually executes,
not before.
Archive limits:
Exceeding any of these refuses the upload or the run with a named error — an
oversized archive is refused before it is unpacked, before an unpack slot or
an execution pod is spent on it. A real
node_modules routinely has more
than 20 000 entries; prune devDependencies, .bin, docs and test fixtures
out of the vendored tree if you hit the entry-count limit.
Pricing
Billed per second of sandbox execution time, measured as an exact fraction — a run of 0.42 s is billed for 0.42 s, with no rounding up to a whole second. See pricing dashboard for current rates.Related capabilities
code.run_python— execute Python code in a sandboxweb.search— retrieve live data to process with this capability
Examples
Add 1 to xcode.run_python
any → text · Billed per second
Execute a Python snippet in an isolated sandbox and return the value of result (or output).
When to use
- Data transformation — reshape, filter, or aggregate structured data before passing it downstream.
- Calculations — run numerical or statistical computations without a separate service.
- Scripted automation — generate or manipulate text, JSON, or binary payloads inline.
Inputs & outputs
Input
Parameters
Output
Runtime
- Standard library only. The sandbox image has no package manager;
numpy,pandasandrequestsare not available. - No network. Outbound connections, including DNS, are blocked.
- No persistent filesystem. Anything written is discarded when the run ends.
- Memory is capped at 512 MB (Python) / 1 GB (Node) and the run is killed at
timeout_seconds.
Examples
Add 1 to an input variable
Parse and summarise JSON
Print progress while returning a value
Multi-file projects
Instead ofsource, a step can carry files — a map of path to content — with
entrypoint naming which of them runs. source and files are mutually
exclusive: set exactly one.
The files are written into a fresh working directory for the run, and the entry
point executes from there, so one file can import another
(import lib.util in Python, require('./lib/util') in Node). The directory is
deleted when the run ends; nothing is shared between runs.
Paths must be relative, use / as the separator, and stay inside the working
directory — no leading /, no ...
Limits: at most 64 files, 64 KiB per file, and 96 KiB for the whole request
(files, vars and all). Exceeding one is a validation error, not a failed run.
Dependency packages are not available: only the standard library and whatever
the runtime image already ships. If you need a third-party package, see
Vendored dependencies below.
Vendored dependencies
Archive support is off by default on this deployment — an operator must explicitly enable it, or a run usingarchive_file_id refuses with archive_mode_disabled regardless of anything an author sets.
Instead of source or files, a step can carry archive_file_id — the id of
a previously-uploaded archive whose unpacked contents become the working
directory. entrypoint names which unpacked file runs (a relative path, e.g.
src/main.py).
Upload a .zip or a .tar.gz/.tgz to get the id — those are the two
formats the file upload endpoint accepts for this purpose. The sandbox can
also unpack a .rar (and one can still reach it through a worker-registered
file), but the upload endpoint does not admit one directly, so an author
cannot get a .rar into archive_file_id by uploading it. Re-pack as .zip
or .tar.gz if that’s what you have.
This is how you bring a third-party package into the sandbox: pack your
project together with its dependencies already installed (e.g. a
site-packages-style vendor directory your code adds to sys.path, or
anything else that works without a package manager) into the archive. The
dependencies are vendored inside the archive — nothing is installed, and no
package registry is ever contacted. This is not a shortcut: the sandbox has
no network at all, so pip install, npm install, or any other install step
run inside the sandbox would simply fail. All of a run’s dependencies must
already be sitting on disk, inside the archive, before the run starts.
source, files and archive_file_id are mutually exclusive: set exactly
one. Unlike files, the archive’s contents are not known until it is unpacked
inside the sandbox at run time, so only entrypoint’s presence is checked when
the step is saved — a wrong path is discovered when the run actually executes,
not before.
Archive limits:
Exceeding any of these refuses the upload or the run with a named error — an
oversized archive is refused before it is unpacked, before an unpack slot or
an execution pod is spent on it. A real
node_modules routinely has more
than 20 000 entries; prune devDependencies, .bin, docs and test fixtures
out of the vendored tree if you hit the entry-count limit.
Pricing
Billed per second of sandbox execution time, measured as an exact fraction — a run of 0.42 s is billed for 0.42 s, with no rounding up to a whole second. See pricing dashboard for current rates.Related capabilities
code.run_node— execute Node.js code in a sandboxweb.search— retrieve live data to process with this capability