Skip to main content
Updated Jul 26, 2026

Execute JavaScript

Use this action when a step needs custom logic that CEL cannot express — reshaping data, computing values, or calling an API with code.

Best for

  • Transforming JSON from earlier steps into exactly the shape a later step needs
  • Calculations, parsing, and validation beyond what CEL expressions can do
  • Small integrations using fetch when the HTTP request action is not flexible enough

Main fields

FieldWhat it does
JavaScript codeThe code to run. It is wrapped in an async IIFE, so you can use top-level await and end with return <value> to produce the step result
Input DataOptional CEL expression evaluated before execution. The result is available inside the code as the input variable
PurposeOptional label for what the code does, shown in logs
Timeout (ms)Execution time limit in milliseconds. Defaults to 5000 and is capped at 30000 — code that runs past it (including infinite loops) is terminated
Memory limit (MB)Sandbox memory limit. Defaults to 128 MB, between 8 and 256

The code runs in an isolated V8 sandbox on a separate execution service. There is no access to Node.js APIs (require, process, file system) — only standard JavaScript built-ins plus three bridges:

  • input — the evaluated Input Data value
  • console.log/info/warn/error — captured and returned as the logs output (up to 200 entries of 2,000 characters each)
  • fetch(url, options) — SSRF-guarded HTTP (private and internal addresses are blocked) returning {ok, status, statusText, body}, with body parsed as JSON when possible and returned as text otherwise

What later steps can use

  • step(N).data — the value you return
  • step(N).logs — the captured console output
  • step(N).executionTimeMs — how long the code ran

Tips

  • Always return something — the return value is copied out of the sandbox, so keep it JSON-friendly.
  • Use console.log while building the step; the logs output is the easiest way to debug.
  • If the code throws, the step fails with code_execution_failed; running past the timeout fails with code_execution_timeout.
  • Each fetch call is bounded by the step's timeout as well, so keep third-party calls well within the time budget.
On this page