Skip to main content
The Execute Code node lets you run your own code (Python or JavaScript) when you need something the other nodes can’t do. It’s like having a custom tool that does exactly what you need. Don’t know how to code? No problem! There’s a “Generate with AI” button that writes the code for you - just describe what you want in plain English.
Execute Code node configuration form

Execute Code configuration — pick Python or JavaScript and write the snippet. Inputs from earlier nodes are available as variables.

When to Use

  • Changing data formats - Rearrange, filter, or combine data
  • Calculations - Math, percentages, date calculations
  • Text processing - Find and replace, split text, format names
  • Connecting to special services - Talk to services not in the app list
  • Creating files - Make CSV files, JSON files, etc.
  • Custom rules - Anything specific to your business
Click “Generate with AI” and describe what you want in plain English. The AI will write the code for you!

Accessing Input Data

All previous node outputs are available in the input object:

Python

JavaScript

Returning Data

Return a JSON-compatible value to pass data to subsequent nodes:

Python

JavaScript

Example: Data Transformation

Transform API response data into a specific format:

Example: CSV Generation

Create a CSV file from data:

Example: Regex Extraction

Extract patterns from text:

Example: API Call

Make HTTP requests to external services:

Python

JavaScript

Example: Date/Time Calculations

Calculate business days, deadlines, etc:

Let AI Write the Code For You

Click the “Generate with AI” button and describe what you want in plain English: Example: “Find all phone numbers and email addresses in the text” Example: “Calculate the total of all the prices and add 10% tax” Example: “Turn this list of items into a CSV format” The AI will write the code for you based on what’s available from previous nodes.
Be specific about what you want. The more detail you give, the better the code will be.

Available Libraries

Python

Pre-installed packages include:
  • requests - HTTP client
  • json - JSON parsing (built-in)
  • re - Regular expressions (built-in)
  • datetime - Date/time handling (built-in)
  • csv - CSV processing (built-in)
  • pandas - Data analysis
  • numpy - Numerical computing

JavaScript

Node.js built-ins plus:
  • fetch - HTTP client (built-in)
  • lodash - Utility functions
  • moment - Date handling
  • csv-parse - CSV processing
Need a package that’s not available? Contact support to request additions.

Error Handling

Use try-catch to handle errors gracefully:

Python

JavaScript

Security

Code runs in a sandboxed environment with limited permissions. You cannot:
  • Access the file system beyond temp directories
  • Make unlimited network requests
  • Run indefinitely (timeout enforced)
This sandboxing protects your workflows and prevents accidental damage.

Tips

Use print() (Python) or console.log() (JavaScript) for debugging. Output appears in stdOut.
Keep code focused on one task. For complex logic, use multiple Execute Code nodes with clear purposes.
Return structured objects rather than strings when possible. This makes it easier for subsequent nodes to access specific values.

Settings

name
string
default:"Execute Code"
What to call this node (shown on the canvas).
key
string
default:"execute_code_1"
A short code to reference this node’s result.
language
string
required
Which coding language to use:
  • python - Good for data work, popular and readable
  • javascript - Good for web stuff
code
string
required
Your code. You can access data from previous nodes using input["node_name"]["value"].
timeout
number
default:"30000"
How long to let the code run before stopping it (in milliseconds). 30000 = 30 seconds.

Outputs

result
any
Whatever your code sends back (using return).
stdOut
string
Anything you printed (using print() in Python or console.log() in JavaScript).
stdErr
string
Error messages if something went wrong.
exitCode
number
0 if everything worked, something else if it didn’t.
success
boolean
True if the code ran without crashing.
executionTime
number
How long it took to run (in milliseconds).
files
array
Any files your code created.

Ask AI

For text understanding tasks, Ask AI may be more appropriate than code.

HTTP Request

For simple API calls, HTTP Request node is easier than code.