> For the complete documentation index, see [llms.txt](https://docs.connect.jfrog.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.connect.jfrog.io/features-new-ui/deployments/update-flow/on-failure-and-rollback/on-failure-policy-for-step.md).

# On Failure Policy for Step

Connect gives you full control of system behavior by enabling you to configure an On Failure policy for each step in your workflow. You can run a customized rollback procedure or opt to just go on to the next step.&#x20;

## Types of Failure & Rollback Actions

The On Failure policy determines which action(s) will be taken if the step fails. The following is a list of different actions you can choose from. Not all of the actions are relevant to every step type in a workflow, so for each step type only a subset is available.

* **Ignore Failure & Continue**: The update flow continues to the next step as if the step succeeded (i.e., the error is ignored). If there are no more steps, the software update will go to completion. In the deployment output, you will see that the step failed and the error that caused the failure.
* **Run Rollback**: The flow-level [Rollback on Failure](/features-new-ui/deployments/update-flow/on-failure-and-rollback/rollback-on-failure.md) runs. You can choose to run both this rollback and an additional action which is defined specifically per step type. The general rollback will run only after all the instructions specific to that step have run.

{% hint style="success" %}
**Tip**: If you mark Run Rollback, you must also enable Rollback on Failure in the flow configuration.
{% endhint %}

* **Run Customized Action**:  You can customize this rollback action, for example, choose to run a command or a script and choose how the action is triggered. You can choose to run only a customized action to roll back the step, or run it in addition to the flow-level rollback. You can choose one of the following triggers:
  * **Any step fails**: If this step or a subsequent step fails, then the rollback action specified will be triggered. If a subsequent step fails and has Ignore Failure & Continue defined, then the action will not be triggered. (This option requires Connect Agent version 6.0 or later.)
  * **This step fails**: The rollback action will run only if the current step fails.
* **Command**: Enter the command to run in the box along with all necessary parameter values.
* **Script**: Drop your script file to run or browse to select the file and enter it in the box.
* **Revert All Files**: Deletes any files that were delivered to the devices in this step and reverts to the files of the previously running version.
* **Revert Docker Compose File**: Reverts to the previous Docker Compose file that was on the device.
* **Restart Previous Container**: Restarts the previous Docker image version that was running.

## Order of Rollback Actions

When there are several actions in an update flow, the rollback actions take place in the following order:

1. The customized actions of the current step that failed.
2. The customized actions that are triggered in any of the previous steps.
3. Rollback on Failure (if enabled).

## Configure On Failure Policy

To configure an On Failure policy for an individual step in the workflow, do the following:

1. Complete the Step Configuration part of the step configuration wizard and any other required parts of the wizard, then click **Next**. The On Failure configuration is the last section in the step configuration wizard.

<div align="left"><figure><img src="/files/8ScbSlh53Pow8PmvgexH" alt="" width="563"><figcaption></figcaption></figure></div>

2. Choose one or more of the On Failure options and save the step.

{% hint style="success" %}
**Tip**: If you don't choose any of the On Failure options and the step fails, the flow will stop and exit. No rollback will take place.
{% endhint %}

## What's Next?

Learn more about [vulnerability scans](/features-new-ui/deployments/update-flow/vulnerability-scans.md) and CVE severity.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.connect.jfrog.io/features-new-ui/deployments/update-flow/on-failure-and-rollback/on-failure-policy-for-step.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
