Skip to content

Code ​

Execute custom script code

Actions ​

Steps this node can perform. Add one from Add a step, then pick the action.

Run JavaScript ​

Executes custom JavaScript code within the workflow

Settings

FieldTypeRequiredDescription
CodeCodeYesThe code to execute
Default: // Available built-in libraries: radash, dateFns, dateFnsTz, Decimal, nanoid // Hover over them or type "radash." to see methods and docs.
Input ParamsKey–value pairsThe input params to process
Cache Code ExecutionYes / NoCache execution results when the same code and input are run again. Disable this for code that uses random values, current time, external APIs, or other changing state.
Default: false

Output

Later steps use this data by picking this step in the $ picker. For example, results is $.<step ID>.output.results.

json
{
  "results": null,
  "error": "string",
  "logs": [],
  "duration": 0,
  "cacheEnabled": false
}

Example values show the shape of the data, not real values. See Using data from earlier steps.

Field descriptions
FieldTypeDescription
resultsAnyThe results of the code execution
errorTextThe error message if the code execution fails
logsListThe logs of the code execution
durationNumberThe duration of the code execution in milliseconds
cacheEnabledYes / NoWhether cache was enabled for this code execution