code · Version: 1 · Category: Data
Author a source block or migrate it to a dedicated Code node. sndbox classifies this node as side-effecting, so tests or automatic runs can require additional confirmation and permission review.
When to use this node
- Transform data when built-in mapping and parser nodes are not enough.
- Author reusable HTML, JavaScript, or CSS source for Web Builder.
Example: Transform mapped JSON with JavaScript
Run JavaScript locally, reading the mapped value from SNDBOX_INPUT and printing a JSON result.Example settings
- Map the source value to input.
- Run in the full editor and resolve diagnostics.
- Inspect result, stdout, and exit behavior before connecting downstream nodes.
Configuration
Edit code opens a dedicated editor for Python, HTML, JavaScript, and CSS with syntax highlighting, live syntax and basic type diagnostics, line and column locations, and AI-assisted code writing.
Source mode returns the complete file through
code without executing it. HTML and CSS always use source mode.Run mode is available for Python and JavaScript, requires command-execution approval, invokes the installed
python or node executable, and waits for completion. Mapped input is available as JSON in SNDBOX_INPUT.Source is limited to 2 MB, timeout is clamped to 100–120000 milliseconds, and captured standard output and error are each limited to 64 KiB.
Workflow JSON
The editor stores this node with the following implemented default configuration:Default node configuration
Inputs
Outputs
Execution behavior
- Source mode returns the file without executing it; HTML and CSS always use source mode.
- Run mode invokes the installed node or python executable and requires command-execution approval.
- The editor catalogue declares
code(string),result(any) for mapping. The execution inspector can contain additional evidence fields; inspect a real result before selecting nested paths from object or any outputs.
Common issues
- SNDBOX_INPUT is a JSON string, so parse it before treating it as an object.
- Keep secrets out of source and stdout because both can appear in workflow or execution records.
Where it can run
- Desktop local runner
- Paired self-hosted runner
- Hosted runner