Execute JavaScript and Python code snippets within your workflows.
The Code Runner connector lets you run custom JavaScript or Python code inside your workflows. Use it for custom logic, data transformations, and calculations that aren’t covered by the built-in utility connectors.
No connection required. This utility connector works out of the box.
Tools
execute-javascript: Run JavaScript
Execute JavaScript code in a sandboxed VM environment.
string
required
JavaScript code to execute.
any
Input data, available in the code as the data variable.
number
default:"5000"
Execution timeout in milliseconds (max 30000).
Example request:
{ "code": "const total = data.items.reduce((sum, n) => sum + n, 0);\nconsole.log('Processing', data.items.length, 'items');\nreturn { total, average: total / data.items.length };", "input": { "items": [10, 20, 30, 40] }, "timeout": 5000}