Process: Run Python code

Execute custom Python code.

Help Centre › Building Processes

Execute custom Python code.

Add it to a process

In the process designer, open the Add step tab. Find Run Python code under Process, or type its name in the search box, and drag it onto the canvas.

Fields

FieldRequiredWhat it does
CodeYesThe Python to run. Set `result` to return one value, or name several in Values to read back.
Values to read backNoNames the code sets, one per line or comma separated. Each becomes a variable of the same name.
Result variableNoThe variable that gets what the code put in `result`.
InputsNoEach row gives the code a value under a name. With no rows the code can read every process variable.
Run in its own processNoRuns the code in a separate process, so a crash or an endless loop cannot stop the bot. Values cross as plain data, not as live objects. Default: off.
Timeout (seconds)NoOnly when run in its own process: stop the code after this many seconds. 0 means no limit. Default 60.

What it gives back

  • {variable} – Whatever the snippet assigned to `result`

See all Process steps.

Errors

ErrorDescription
File not foundThe Python file does not exist
Function not foundThe function does not exist in the file
Python errorThe Python code raised an exception

Tips

  • Executes a specific function from a Python file
  • Parameters are passed as key-value pairs

Related functions

Get started

See it working on your own data

Everything documented here ships with the platform – try the document tools free, or have your first automation working in 7 days.