# Run Script

You might have several reasons to use the Run Script step type, such as preparing the edge devices for installing a new software version or doing some special tasks after a version has been received. You may also have scripts that help to resolve issues in a software version that is running on the device.

### Example: Update Binaries on Device

<table><thead><tr><th width="258">Actions (in order)</th><th>Task</th></tr></thead><tbody><tr><td>Run Command</td><td>Copy and save device-specific configuration files</td></tr><tr><td>Download Artifacts</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 Script</td><td>Verifies configuration and runs tests.<br>If failed, rollback entire update (i.e., runs <a href="../on-failure-and-rollback/rollback-on-failure">general rollback</a>)</td></tr><tr><td>Run Command</td><td>Restart service that runs your application</td></tr></tbody></table>

## Prerequisites

* JFrog Connect account and at least one device registered.
* A script file ready for deployment.
* 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 Script**, give the step a **Step** **Name**, and create the step. You can change the step name afterwards if you need to.
3. Enter the following information:
   * **Script File:** Enter (drag and drop, or browse) the script file in the script box.
   * **Binary Path**: The path on the device where the script should run.
   * **Script Arguments**: The values required for script arguments.

<div align="left"><figure><img src="https://1679291640-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOX8HIrQ8f257lv49Od1Z%2Fuploads%2FzqbFVZEHXRaZDOTREQNh%2Frun-script-nui-01.png?alt=media&#x26;token=ed1636f7-0661-4417-b594-6bd9a38b5a57" 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 add more steps to the workflow.

## What’s Next?

Learn how to deliver one or more files to your client devices using the [Deploy Files](https://docs.connect.jfrog.io/features-new-ui/deployments/update-deployment) step type.
