Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.spojit.com/llms.txt

Use this file to discover all available pages before exploring further.

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 code in a sandboxed VM environment.
code
string
required
JavaScript code to execute.
input
any
Input data, available in the code as the data variable.
timeout
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
}
Example response:
{
  "success": true,
  "result": "[object Object]",
  "stdout": "Processing 4 items",
  "stderr": "",
  "executionTime": 3
}
Execute Python code in a sandboxed environment.
code
string
required
Python code to execute.
input
any
Input data, available in the code as the data variable.
timeout
number
default:"5000"
Execution timeout in milliseconds (max 30000).
Example request:
{
  "code": "import re\n\nemails = re.findall(r'[\\w.+-]+@[\\w-]+\\.[\\w.]+', data['text'])\nprint(f'Found {len(emails)} emails')\n{'emails': emails, 'count': len(emails)}",
  "input": {
    "text": "Contact us at support@example.com or sales@example.com for help."
  },
  "timeout": 5000
}
Example response:
{
  "success": true,
  "result": "{'emails': ['support@example.com', 'sales@example.com'], 'count': 2}",
  "stdout": "Found 2 emails",
  "stderr": "",
  "executionTime": 85
}

Tips

  • Use the data variable to access input passed from previous workflow nodes.
  • Keep code focused — for simple transformations, consider using the JSON Tools or Text Tools connectors instead.
  • Both JavaScript and Python run in isolated environments with limited access to system resources.
  • Set an appropriate timeout for long-running computations.