QuickJS Executor Reference
Technical reference for the QuickJS JavaScript sandbox used to run Code Nodes on Cloudflare Workers.
Written By pvdyck
Last updated 16 minutes ago
QuickJS Executor Reference
indie.money uses QuickJS β a lightweight, embeddable JavaScript engine β to run Code Nodes inside Cloudflare Workers. This page explains why and what constraints it imposes.
Why QuickJS?
Cloudflare Workers do not support Node.js APIs or most browser APIs. QuickJS is a pure JavaScript engine that can be compiled to WebAssembly (WASM) and run inside a Worker. It provides a safe, isolated sandbox for custom code.
Constraint Table
FeatureAvailable?Note async/awaitβ NoCode must be synchronous fetch / XMLHttpRequestβ NoNo network access from Code Node require / importβ NoNo module system console.logβ NoLogs discarded; use return values setTimeout / setIntervalβ NoNo timers File system (fs)β NoNo file access Math, Date, JSONβ YesFull standard library Array, Object, String, RegExpβ YesFull standard library Promisesβ οΈ LimitedCan create Promises but cannot await them Generatorsβ YesSynchronous generators work ES2020 syntaxβ YesArrow functions, destructuring, spread, etc.
CPU Time Limit
Each Code Node execution has a 2-minute CPU time limit. This counts actual CPU computation, not wall-clock time. Infinite loops will be terminated.
Performance
QuickJS is slower than V8 (Chrome's engine). Complex string manipulation or large array operations may be noticeably slower than you'd expect. Keep Code Node logic lean β offload complex processing to upstream HTTP requests where possible.
Available n8n Variables
$inputβ input items (.all(),.first(),.last(),.item(),.context,.params) -$jsonβ shortcut to first item's JSON -$('NodeName')β access other nodes (.first(),.last(),.all(),.item(),.json,.context,.params) -$node['Name']β proxy-based node accessor (.json,.binary,.context,.parameter,.runIndex) -$item(n)β access item by index -$items()β all items asINodeExecutionData[]-$prevNodeβ previous node info (name,outputIndex,runIndex) -$workflowβ workflow metadata (id,name,active) -$envβ environment variables -$varsβ workflow variables -$executionβ execution metadata -$modeβ execution mode -$now,$today,$yesterdayβ Luxon-like dates (.toISO(),.toFormat(),.plus(),.minus()) -DateTimeβ date factory (.now(),.fromISO(),.fromJSDate()) -$nodeVersion,$nodeIdβ node metadata -$itemIndex,$runIndexβ current indices -$getNodeParameterβ access node parameters