Skip to content

JavaScript Code

JavaScript Code node panel in English, with the code editor and the input mapping.

JavaScript Code runs a custom script inside the workflow sandbox.

Purpose and use: Run a custom JavaScript body for a transformation or bounded computation that cannot be expressed with configured workflow nodes.

Configuration: Required non-empty code; editor default example is return { value: input.value };. Source is capped at 64 KiB. No other node-specific fields are listed in the catalog.

Input/output and routing: One input and one output; code receives sandbox inputs and returns an output value. The precise accessible API is the separate code sandbox contract, not the workflow-expression globals.

Expressions: This node does not use the workflow expression parser. It executes code in its own QuickJS sandbox with a guarded fetch/output bridge.

Errors, permissions, and effects: Sandbox timeout, runtime, or request-policy errors fail the node. It is excluded from automatic retries because code may have side effects. Review code and any guarded fetch use as executable behavior; do not assume pure transformation. The complete set of permitted runtime globals is not specified here.

Example configuration — fields validated against the 1.1.1 node schema; replace the identifiers with your own: {"code":"return { value: input.value };"}. Expected result: the object returned by the code, passed to the next node.