Process: Run a script

Run a script in a chosen language and capture its output.

Help Centre › Building Processes

Run a script in a chosen language and capture its output.

Add it to a process

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

Fields

FieldRequiredWhat it does
LanguageYesThe language to run the script in Choices: Python, Powershell, Javascript, Vbscript, Batch, Bash, Csharp.
ScriptNoThe script to run (use this or path, not both)
Or a script fileNoPath to an existing script file to run instead
Output variableNoName of the variable where the result will be stored
Parse output as JSONNoParse the output as JSON into a structured variable
ArgumentsNoArguments passed to the script
Exit-code variableNoVariable to store the exit code, for branching on success
Full-result variableNoVariable to store the full result object (stdout, stderr, exit code, duration)
Timeout (seconds)NoSeconds to wait before the script is stopped (default 60, 0 for no limit)
Standard inputNoText piped to the script's standard input
Working directoryNoWorking directory to run the script in
Environment variablesNoExtra environment variables for the script
Window styleNoConsole window style (Windows only) Choices: Normal, Hidden, Minimized, Maximized.
Fail on non-zero exitNoFail the step when the script exits non-zero (default true) Default: on.
Inherit environmentNoPass the bot's own environment to the script (default true)
Run as AdministratorNoRun elevated. Windows only, and needs a human at the UAC prompt

What it gives back

  • {variable} – The script's output - a string, or the parsed record when json is true
  • {exit_code_variable} – The script's exit code
  • {result_variable} – {command, stdout, stderr, exit code, pid, timed out, duration, succeeded}

See all Process steps.

See it working on your own data

Everything documented here ships with the platform – try the document tools free, or go live in 7 days.