Scripts & Programs commands
javascript · run · process
javascript Javascript
Runs JavaScript for quick calculations and data shaping. Inputs become variables in the script; what it returns goes to --output (objects as records, arrays as lists). No file or network access.
Parameters
| Parameter | Value | Default | Description |
|---|---|---|---|
--code required | text | JavaScript; end with return <value>. console.log writes to the execution log Code in javascript, taken as written. | |
--inputs | text | Task values the script sees, e.g. $price$,$items$,rate=0.18,total=$order.Total$ | |
--output | variable name | Variable that receives the result | |
--timeout | number | 30 | Timeout in seconds |
Examples
javascript --code:"return price * (1 + rate);" --inputs:"$price$,rate=0.18" --output:gross
javascript --code:"return orders.filter(o => o.total > 100).map(o => o.id);" --inputs:"orders=$response.Json.data$" --output:bigOrders
run Run
Starts an external program, document or system command. The task goes on without waiting unless --waitforexit is true.
Parameters
| Parameter | Value | Default | Description |
|---|---|---|---|
--program required | text | A file on the agent machine. | |
--arguments | text | ||
--workingdir | text | A folder on the agent machine. | |
--waitforexit | true / false | false | Wait until the program exits (for scripts and tools whose exit code or output you need) |
--timeout | number | 60 | Timeout in seconds |
--captureoutput | true / false | false | |
--output | variable name | Variable that receives the result |
Examples
run --program:"C:\tools\converter.exe" --arguments:"--input file.csv --output file.xlsx" --workingdir:"C:\tools" --waitforexit:true --timeout:120 --output:exitCode
run --program:"cmd" --arguments:"/c dir C:\" --output:cmdOutput
run --program:"powershell" --arguments:"-Command Get-Process" --output:psOutput
process Process
Checks, lists, waits for and stops running programs.
Actions (--action)
--action:exists
true when the program is running.
| Parameter | Value | Default | Description |
|---|---|---|---|
--name required | any value | Program name (notepad or notepad.exe; * and ? allowed) or a process id | |
--output required | variable name | Variable that receives the result |
--action:kill
Stops every matching process without asking it to save; --output receives how many were stopped.
| Parameter | Value | Default | Description |
|---|---|---|---|
--name required | any value | Program name (notepad or notepad.exe; * and ? allowed) or a process id | |
--tree | true / false | false | Also stop the processes it started |
--output | variable name | Variable that receives the result |
--action:list
Running processes as records (Name, Id, WindowTitle, Path, StartTime, MemoryMb).
| Parameter | Value | Default | Description |
|---|---|---|---|
--name | any value | Program name (notepad or notepad.exe; * and ? allowed) or a process id; every process when empty | |
--output required | variable name | Variable that receives the result |
--action:waitexit
Waits until the program is no longer running; fails after --timeout.
| Parameter | Value | Default | Description |
|---|---|---|---|
--name required | any value | Program name (notepad or notepad.exe; * and ? allowed) or a process id | |
--timeout | number | 60 | Timeout in seconds |
Examples
process --action:exists --name:"excel.exe" --output:excelRunning
process --action:kill --name:"excel" --tree:true --output:stopped
process --action:list --name:"chrome*" --output:processes
process --action:waitexit --name:$pid$ --timeout:30