Description

n8n-nodes-sandbox
This package provides a single custom node: Sandbox Code.
Sandbox Code executes user-supplied code remotely through a sandbox API (/v1/sandbox/run) and returns stdout and error output. It supports Python 3 currently.
Prerequisites
You need the following installed on your development machine:
-
Node.js and npm. Minimum version Node 20. You can find instructions on how to install both using nvm (Node Version Manager) for Linux, Mac, and WSL here. For Windows users, refer to Microsoft's guide to Install NodeJS on Windows.
-
Install n8n with:
npm install n8n -g -
Recommended: follow n8n's guide to set up your development environment.
Node Overview
Sandbox Code Node parameters:
- Language:
python3orjavascript. Python code is auto-wrapped in an async function; JavaScript code is auto-wrapped in an async IIFE for top-levelawait. - Enable Network: toggles outbound network (mapped to
enable_network). - Code: multi-line code string to execute.
Execution response shape:
{
"code": 0,
"message": "success",
"data": { "stdout": "...", "error": "" }
}
The node outputs an item JSON containing: success, language, stdout, error.
Credentials
Create credentials of type Sandbox API providing:
- Base URL (default: https://sandbox.0x2a.top)
- API Key (sent as
X-Api-Keyheader)
Development
Install deps and build:
npm install
npm run build
Link or copy the built package into your n8n instance, then add the Sandbox Code node.
License
MIT