Code

Built-in step · 1 step

Run a small Python script in a secure sandbox.

To learn when to use these steps, with examples, read Call an API or run code.

Run Python code

Run a short Python script for the things no other step covers, such as reshaping data or a custom calculation. It runs offline, with no internet or file access, and returns whatever your script assigns to a variable named output.

Inputs

Python codecodetextRequired
Your script. Read the values you mapped in by name, or from the inputs dictionary, and assign this step's result to a variable named output.
Inputsinputsobject
The workflow values your code can use. Each one gets a name you refer to in the code.
Output typeoutput_typetext
What this step returns. Auto keeps whatever your code produced; picking a type checks it before later steps use it.One of: auto, text, number, boolean (True/False), list, object. Default: auto.

Outputs

Whatever the script assigns to output, converted to the chosen output type.

Example output
{
  "currency": "USD",
  "line_count": 3,
  "total": 1249.5
}

On this page