Script Node
Run scripts for data transformations and automation tasks with built-in support for multiple languages and package management
Script Node
The Script node lets you run custom code directly inside your workflows. It supports Bash, Python, and JavaScript/TypeScript - each executed in an isolated sandbox environment.
Scripts are executed using the following runners:
| Language | Runner | Description |
|---|---|---|
| Bash | /bin/bash | Native shell execution |
| Python | uv | Fast Python package runner with inline dependency support |
| JavaScript/TypeScript | Deno | Secure JavaScript/TypeScript runtime with built-in module support |
Configuration
Input
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
language | string | No | "bash" | Script language: bash, python, typescript |
script | string | Yes | - | The script code to execute |
Output
| Field | Type | Description |
|---|---|---|
stdout | string | Standard output from the script |
stderr | string | Standard error output (truncated to 1024 characters on failure) |
exitCode | number | Process exit code (0 = success) |
Basic Usage
Bash
echo "Current date: $(date)"
echo "Files in /tmp:"
ls -la /tmpPython
import json
data = {"status": "ok", "count": 42}
print(json.dumps(data))JavaScript/TypeScript
const result = { transformed: true, timestamp: Date.now() };
console.log(JSON.stringify(result));3rd Party Dependencies
One of the most powerful features of the Script node is the ability to pull in third-party packages without any pre-configuration.
Python - uv inline dependencies
Python scripts are executed with uv, which supports inline script metadata for declaring dependencies. Add a special comment block at the top of your script and uv will automatically install the packages before running:
# /// script
# dependencies = [
# "requests",
# "beautifulsoup4",
# ]
# ///
import requests
from bs4 import BeautifulSoup
resp = requests.get("https://example.com")
soup = BeautifulSoup(resp.text, "html.parser")
print(soup.title.string)JavaScript/TypeScript - Deno imports
JavaScript/TypeScript scripts are executed with Deno, which supports importing third-party modules directly via npm:, jsr:, or URL specifiers - no install step needed:
import { nanoid } from "npm:nanoid@5";
import { camelCase } from "jsr:@luca/[email protected]";
const id = nanoid();
const name = camelCase("hello world");
console.log(JSON.stringify({ id, name }));Error Handling
A script node fails when the process exits with a non-zero exit code. On failure, stderr is captured (truncated to the last 1024 characters) and surfaced as the error message.
Use a condition node after the script to branch on success or failure based on the exit code.
Last updated on