JavaScript
Runs your own JavaScript when expressions cannot do it — map, filter, regex, custom logic.
Settings
Technical details
Written beside the settings, not inside them:
code: Use paths without `{{ }}` here: `input.email`, not `{{ json.email }}`. `input` is the previous step's output; what you `return` becomes this step's output. Your code is the body of `async function run(input)`. `json` is the same value as `input`, and `trigger`, `loop`, `execution`, `flow`, `workspace`, `params` and `$now` are plain values here too — `params` is a copy of the parameters this run started with — changing it changes nothing outside your code, a name the flow does not declare is `undefined`, and your own `params` variable takes its place. `node` holds the earlier steps you name in the code — `node["Step label"]` or `node.stepId` — and a step that did not run is `null`. `secret` is not available in code, and `{{ }}` is never interpreted here — it is JavaScript. No network (use HTTP request), and 4 MiB in and out.
Output
What this node gives depends on the data it gets.
Sample output, and the expression for each field
Errors
When a step of this node stops a run, the run page shows a code. Look it up:
Example step
The step as a flow file holds it. Replace each value in <…>.
{
"code": "return input;",
"config": {},
"label": "JavaScript",
"type": "core.javascript",
"version": 1
}