Back to Nodes

Sandbox Code

Last updated Aug 14, 2025

n8n community node to execute sandboxed code via remote sandbox API.

1 Weekly Downloads
10 Monthly Downloads

Included Nodes

Sandbox Code

Description

Banner image

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:

  • git

  • 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: python3 or javascript. Python code is auto-wrapped in an async function; JavaScript code is auto-wrapped in an async IIFE for top-level await.
  • 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:

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