Skip to main content

Run Command

Executes a command on a remote SSH server and returns the result.

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 the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.

Inputs

  • Client Id - The unique identifier of the SSH connection, obtained from the Connect node.
  • Command - The command to execute on the remote server.

Output

  • Result - The output of the executed command.

How It Works

The Run Command node executes a command on a remote SSH server and captures its output:

  1. Validates the provided client ID and command
  2. Retrieves the SSH client associated with the client ID
  3. Executes the specified command on the remote server
  4. Captures the command output and returns it as the result

Requirements

  • A valid client ID from a previously established SSH connection using the Connect node
  • Valid command string that can be executed on the remote system
  • Sufficient permissions for the SSH user to execute the command

Error Handling

The node will return specific errors in the following cases:

  • Empty or invalid client ID
  • No active connection found for the provided client ID
  • Empty or invalid command string
  • Command execution failure on the remote system
  • Network connectivity issues during command execution

Usage Notes

  • The command is executed in the default shell of the remote user
  • Complex commands may need to be properly escaped or quoted
  • Long-running commands will block the node until completion
  • The output is captured as a string and may include both stdout and stderr
  • Be cautious with commands that modify system state as they cannot be easily undone