Start Process
Runs an executable file with or without arguments.
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
info
If ContinueOnError property is true, no error is caught when the project is executed even if Catch node is used.
Input
- Executable Path - The path of the executable file to run.
- Arguments - The arguments to pass to the executable.
- Working Directory - The working directory to be used for the executable.
- Custom Arguments - Custom additional arguments to pass to the executable.
info
As an example, to convert the below curl command into a Start Process:
curl -X POST -H 'Authentication: Bearer <token>' https://example.com
The executable path should the full path of the curl command on the file system like /usr/bin/curl
The arguments must be every space separated value provided as an array of string e.g. msg.arguments=["-X", "POST, "-H", "'Authentication: Bearer <token>'", "https://example.com"]
Output
- Process ID - The ID of the process started.
- Standard Output - Standard output of the executed process.
Options
- Background Process: If selected, node will not wait for the process to complete.
How It Works
The Start Process node executes external programs and commands with full control over their execution:
-
Configuration Phase:
- Receives the executable path, arguments, and working directory
- Validates that the executable path is not empty
- Processes arguments from either the Arguments array or Custom Arguments
-
Process Setup:
- Creates a command with the executable path and arguments
- Sets the working directory if provided
- Prepares to capture standard output and standard error
-
Execution:
- Background Mode: Starts the process and immediately returns (non-blocking)
- Foreground Mode: Starts the process and waits for completion, capturing all output
-
Output Collection:
- In foreground mode, combines stdout and stderr into a single output
- Returns the process ID (PID) for both modes
- Returns the combined output only in foreground mode
Requirements
- Executable Path: Must be a valid, non-empty path to an executable file
- File Permissions: The executable must have execute permissions
- Working Directory: Optional; if provided, must be a valid directory path
- Arguments Format: Must be an array of strings, with each argument as a separate element
Error Handling
| Error Code | Description | Solution |
|---|---|---|
Core.Application.StartProcess.ErrOnCreate | Configuration parsing failed during node creation | Check node configuration in the flow |
Core.Applications.StartProcess.OnErrMessage | Message parsing error | Verify message format is valid JSON |
Core.Applications.StartProcess.ErrInPath | Input file path is empty | Provide a valid executable path |
Core.Programming.Switch.InvalidCondition | Invalid custom argument value | Check custom arguments configuration |
Core.Application.StartProcess.ErrStart | Failed to start process | Verify executable exists, has execute permissions, and arguments are valid |
Core.Application.StartProcess.OutputMarshal | Failed to serialize output | Check output variable configuration |
Usage Examples
Example 1: Run Simple Command
// Execute a simple command with no arguments
msg.executablePath = "/usr/bin/date";
msg.arguments = [];
// After node execution:
// msg.processId contains the PID
// msg.stdout contains the current date/time
Example 2: Run Command with Arguments
// Execute curl with multiple arguments
msg.executablePath = "/usr/bin/curl";
msg.arguments = ["-X", "POST", "-H", "Content-Type: application/json", "https://api.example.com"];
// After node execution:
// msg.pid contains the process ID
// msg.output contains the HTTP response
Example 3: Background Process Execution
// Start a long-running process in background
msg.executable = "/usr/bin/python3";
msg.args = ["script.py"];
msg.workingDir = "/home/user/scripts";
// Background Process option: ENABLED
// After node execution:
// msg.processId contains the PID
// Process runs in background, flow continues immediately
Usage Notes
- Arguments Format: Each argument must be a separate array element, not space-separated
- Quoting: Do not manually quote arguments; each element is automatically treated as a single argument
- Path Requirements: Use absolute paths for executables to avoid ambiguity
- Working Directory: Affects relative paths in arguments and file operations within the process
- Output Capture: Only available in foreground mode (Background Process disabled)
- Error Output: stderr is combined with stdout in the output
- Platform Differences: Executable paths vary by OS (e.g.,
/usr/bin/curlvsC:\Windows\System32\curl.exe) - Process Lifetime: Background processes continue running even after the flow completes
- Exit Codes: Non-zero exit codes are returned as errors with the output
Tips
- Always use absolute paths for executables to ensure portability
- Test commands manually in terminal/command prompt first
- Use Get Env Variable node to find system paths (like TEMP, HOME)
- For complex commands, consider creating a shell script and executing that
- Set appropriate timeout values if the process might hang
- Use Background Process mode for fire-and-forget operations
- Capture the PID when using background mode to track or kill the process later
- Quote individual arguments that contain spaces by making them single array elements
- Use Custom Arguments for dynamic argument building based on flow variables
- On Windows, use
.exeextension and full paths likeC:\Program Files\...
Related Nodes
- Kill Process - Terminate processes started by this node
- Get Processes - Verify process is running after starting it
- Get Env Variable - Retrieve environment variables for use in paths
- File Operations - Check if executable exists before attempting to run it
- String Operations - Build complex argument arrays dynamically