Skip to content
Docs

Code step: run JavaScript in a workflow

Write JavaScript that takes named inputs from your data and returns an object for later steps. Runs in a sandbox: 5 seconds, no network, no packages.

Updated

Code runs a bit of JavaScript with inputs from your data and gives back what it returns.

How to set it up

  1. Add a Code step.
  2. Click Add input for each value the code needs: a name, and the data to put in it.
  3. Write the code. Each input is available as inputs.name. return an object; it becomes data for later steps.
  4. Test this step runs it and shows what it returned.
const total = Number(inputs.price) * 1.19;
return { total: total.toFixed(2) };

Limits

  • 5 seconds and 32 MB of memory per run of the step.
  • No network and no packages: no fetch, no await, no npm. Use an HTTP request step to call an API, then pass its response in as an input.
  • Code up to 20,000 characters.