SSH

App · 1 action

Run commands on your own servers over SSH and use what they print.

Run a command

Run a command on the connected server, as you would type it at its prompt, and get back what it printed and its exit code. Use it to deploy, restart a service, check disk space, read a log, or run a script that lives on the server.

Inputs

CommandcommandtextRequired
What to run on the server, exactly as you would type it at its prompt. It runs as the connected user, in that user's shell, so chain commands with && and quote values that contain spaces. Values from earlier steps can be put into it.
Working directoryworking_directorytext
Run the command from this folder on the server, such as /var/www/app. Leave it empty to run from the user's home folder.
Time limit (seconds)timeoutnumber
Stop the command and fail the step if it has not finished within this many seconds. A command that waits for input never finishes, so give it none.From 1 to 3600. Default: 60.
If the command failson_errortext
What to do when the command exits with a status other than 0. Continuing lets later steps read the exit code and the error output themselves, which suits a check whose failure is an answer rather than a problem.One of: fail (Stop the workflow), continue. Default: fail.

Outputs

exit_codenumber
The command's exit status: 0 when it succeeded. -1 when it ended without reporting one, which usually means it was killed.
oktrue/false
Whether the exit code was 0.
stderrtext
What the command printed to its error stream, without the line break it ended with. Many commands print progress and warnings here even when they succeed.
stdouttext
What the command printed, without the line break it ended with.
Example output
{
  "exit_code": 0,
  "ok": true,
  "stderr": "",
  "stdout": "Filesystem      Size  Used Avail Use% Mounted on\n/dev/sda1        80G   41G   39G  52% /"
}

On this page