# Run Command

The Run Command step type is useful for performing a variety of tasks on the edge device. You may need the Run Command as a prerequisite to other tasks, for example, to create folders on the devices before delivering files or to stop a service before delivering an update.

You might also use Run Command after other steps, for example, to run a script that was delivered in a previous step or to delete artifacts no longer used.

A customer example below illustrates how you might use the Run Command step type in an update flow.

### Example: Run Command in Update Flow

<table><thead><tr><th width="320">Steps (in order)</th><th>Task</th></tr></thead><tbody><tr><td>Run Command</td><td>Safekeeping device-specific configuration files</td></tr><tr><td>Download Artifact</td><td>Pull your update binaries from Artifactory</td></tr><tr><td>Run Command</td><td>Unzip file with your binary artifacts</td></tr><tr><td>Run Command</td><td>Change user permissions for your application</td></tr><tr><td>Run Command</td><td>Restart service that runs your application</td></tr></tbody></table>

### Pull Commands

A pull command used in the Run Command step type cannot be reverted. Therefore, for pulling artifacts, we recommend using one of the pull step types such as Artifacts, Deploy Container or Clone Git Repository.

## Prerequisites

* JFrog Connect account and at least one device registered.
* In the [Create Update Flow](https://docs.connect.jfrog.io/features-new-ui/deployments/update-flow) procedure, completed through Step 3.

## Add a Step and Configure the Step Type

To add a step and configure the step type you have chosen, do the following:

1. In the Create New Flow page, click **Add Step**.
2. In the **Step Type** dropdown list, choose **Run Command**, give the step a **Step Name**, and create the step. You can change the step name afterwards if you need to.
3. Enter the **Command** to run.

<div align="left"><figure><img src="https://1679291640-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOX8HIrQ8f257lv49Od1Z%2Fuploads%2F8QzyfzNe8UySXkTwfqBR%2Frun-command-nui-01.png?alt=media&#x26;token=d67dd69c-847d-445a-b5e5-98207936b193" alt="" width="563"><figcaption></figcaption></figure></div>

4. (Optional) Configure your [On Failure](https://docs.connect.jfrog.io/features-new-ui/deployments/update-flow/on-failure-and-rollback) policy and instructions for rolling back.
5. Save your step configuration.

You can run additional commands in the flow by adding more steps. You can also perform other tasks in the same flow by adding and configuring the relevant step types.

If you plan to run several commands and need to specify a logic that is more complex, you might consider using the Run Script step type.

## What’s Next?

Learn more about using the [Run Script](https://docs.connect.jfrog.io/features-new-ui/deployments/update-flow/step-types/run-script) step type to run a script on your client devices.
