Introduction
Use Run shell on another device to execute an inline shell script on a selected runner device instead of the device moving through the automation. This is useful when a command needs tools, network access, or resources that are available on a dedicated device.
The automation still keeps the context of the device that entered the workflow. System variables, custom fields, and automation variables resolve from that workflow device before the shell script runs on the runner.
Add the Action
Open the automation and select Edit.
Select + where you want to add the action.
In the System category, select Run shell on another device.
In Runner device, search for and select the device that will execute the shell script.
Select the language, timeout, and Run as context.
Enter the script in the editor.
Configure conditions and additional options, then select Save.
The runner is part of the action configuration. Every workflow device that reaches this action sends its rendered shell script to that selected runner.
Workflow Device and Runner Device Context
Remote execution separates the device being managed from the device doing the work.
Context | Device used |
Trigger and action conditions | Workflow device |
System variables such as | Workflow device |
Custom field values | Workflow device |
Automation variables | Current automation run for the workflow device |
Shell execution, operating system, installed tools, and network access | Runner device |
Run as user context | Runner device |
ℹ️ NOTE: A reference such as {{ level_device_hostname }} returns the workflow device's hostname, not the runner's hostname. Use the runner only as the place where the shell script executes.
Example
An automation runs for a workstation that cannot directly reach an internal management system. A server with the required tools and network access is selected as the runner. The command executes on the server while a variable such as {{ level_device_hostname }} still identifies the workstation moving through the automation.
Configure the Shell Script
Choose the language, timeout, and Run as context for the runner device, then enter your script in the editor. Insert system variables, automation variables, and custom fields with the variable picker. Level renders those values from the workflow device before sending the script to the runner.
See Shell Action for language, editor, output, exit-code, condition, and additional-option details that also apply here.
Capture Output
Use Assign action output to variable to store the runner's standard output in an automation variable. The value becomes available to later actions in the workflow device's automation run.
Runner Availability and Failures
The runner must be available to receive and execute the action. If it does not respond, Level retries before the action times out and is marked as failed. The action's On action failure, retry, and timeout settings determine what the automation does next.
The shell script's exit code is evaluated from its execution on the runner:
Exit code | Result |
0 | Action marked as successful |
Non-zero | Action marked as failed |
Runner Device Usage
Level tracks when a device is used as an automation runner. A runner referenced by an active automation cannot be deleted until you remove or replace that automation usage.
⚠️ WARNING: Before changing or removing a runner, review every automation that uses it. Those automations depend on the runner's availability, tools, operating system, and network access.
FAQ
Does the shell script run on both devices? No. The runner executes the script. The workflow device provides the automation context and variable values.
Which device do system variables describe? They describe the workflow device moving through the automation.
Which operating system and user context apply? The runner device's operating system and the Run as setting selected for the action.
Where is captured output stored? It is stored in the workflow device's automation run and can be used by later actions.
Why can't I delete the runner device? An active automation still references it. Open the device's automation usage, then remove or replace the runner in those automations.
For variable details, see System Variables and Automation Variables.


