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
| Field | Type | Required | Description |
|---|---|---|---|
| Code | Code | Yes | The 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 Params | Key–value pairs | The input params to process | |
| Cache Code Execution | Yes / No | Cache 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
| Field | Type | Description |
|---|---|---|
results | Any | The results of the code execution |
error | Text | The error message if the code execution fails |
logs | List | The logs of the code execution |
duration | Number | The duration of the code execution in milliseconds |
cacheEnabled | Yes / No | Whether cache was enabled for this code execution |