> 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.md).

# On Failure & Rollback

In JFrog Connect, you can define what will happen if a step fails, and if a rollback is needed, how the rollback will take place. This ensures that your devices are left in a stable and known state.

## Control and Stability

If a failure occurs during a software update, it is important to return your device to a stable and known state. You can have full control over the process by configuring On Failure instructions in each step in the flow and defining per step the rollback actions to be taken.&#x20;

For each step, you can decide what kind of rollback is triggered (if any), and trigger actions such as a command or a custom script to run. When an update deployment ends, either successfully or due to a failure in the update flow,  the outcome will be that your device is left in a stable state, and you will have full knowledge of that state.&#x20;

## On Failure & Rollback Configurations

You can specify the rollback behavior at two levels:

* **Flow Level**: Use [Rollback on Failure](/features-new-ui/deployments/update-flow/on-failure-and-rollback/rollback-on-failure.md) to configure a rollback of the entire update flow.
* **Step Level**: In the [On Failure](/features-new-ui/deployments/update-flow/on-failure-and-rollback/on-failure-policy-for-step.md) configuration of each step, you can define rollback instructions that relate specifically to that step. If no step-level instructions are configured, the flow-level rollback will run if a failure occurs.

## Free Memory Requirement

In order to enable rollback functionality, your device's free memory must be greater than the update size. To calculate the amount of free memory required, use the relationship below:

**Free Memory Required > (Current Folder Size + Update Size + 10MB)**

## What's Next?

Learn more about the on failure and rollback configurations in [Rollback on Failure](/features-new-ui/deployments/update-flow/on-failure-and-rollback/rollback-on-failure.md) and [On Failure Policy for Step](/features-new-ui/deployments/update-flow/on-failure-and-rollback/on-failure-policy-for-step.md).


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
