Code Node (& Function Node)

The Code Node runs synchronous JavaScript in a secure code sandbox. No async, no network, no modules.

Written By pvdyck

Last updated 1 day ago

Code Node (& Function Node)

⚠️ Limitations β€” Works with known restrictions, see details below

Compatibility

On indie.money, the Code node runs in a secure code sandbox instead of Node.js:

FeatureStatus
JavaScript (sync)Supported
All n8n variables ($input, $json, $node, $workflow, etc.)Supported
$now, $today, DateTime (Luxon-like)Supported
$('NodeName'), $node['Name']Supported
PythonNot supported β€” JavaScript only
async/awaitNot supported β€” synchronous execution only
fetch / HTTPNot supported β€” use HTTP Request node instead
this.helpersNot supported β€” n8n helper methods are not available in the sandbox
require / importNot supported β€” no external modules
console.logNot supported β€” use return to output data
process.envNot supported β€” use $env or $vars for environment variables
File systemNot supported β€” no fs access
$getWorkflowStaticDataPartial β€” works within a single execution but not persisted between runs
$jmespathNot supported β€” Use Array methods (filter, map, find) instead
$fromAINot supported
$evaluateExpressionNot supported β€” Expressions must be resolved before the Code node
DateTime.fromFormat()Not supported β€” Use DateTime.fromISO() or new Date(string)
DateTime.fromRFC2822()Not supported
IntervalNot supported
DurationNot supported β€” Use $now.plus({days: 1}) for date arithmetic
$selfPartial β€” Returns empty object. Not populated until after Code node executes

Limits:

  • 30-second CPU time β€” active processing only, not wall-clock. Time spent waiting on network responses (HTTP Request, LLM calls) does not count toward this limit.
  • 5-minute wall-clock timeout β€” total elapsed time including I/O wait. An agent can spend up to 5 minutes total but no more than 30 seconds of that running CPU-bound code.

Status

This integration works on indie.money with known limitations. See the details above for specifics.