# Retries

In some cases, a run that has already been performed may be performed again, using a **retry**.

When a run is retried, its previous result is permanently discarded. Because of this, runs that already have a meaningful result (i.e. an event run that gave rise to task runs, or a task run that generated actions, or an action run that succeeded) cannot be retried.

Runs are given **automatic retries** when a non-permanent error is encountered. In some cases, Mechanic permits **manual retries** for runs, allowing users to reset a run's result and perform the run again.

## Retry context

Retried event runs will always reflect Mechanic's current configuration, including any [event filters](https://learn.mechanic.dev/platform/events/filters).

Retried task runs will always use a task's latest configuration, including the task's [options](https://learn.mechanic.dev/core/tasks/options), [code](https://learn.mechanic.dev/core/tasks/code), and [Shopify API version](https://learn.mechanic.dev/core/tasks/shopify-api-version).

Retried action runs will always use their original action options, as dictated by the task run that generated them. Action runs are entirely unaffected by updates to their task.

{% hint style="info" %}
Outstanding task and action runs that belong to a newly-disabled task will always fail when performed, whether they're retried or performed normally. This means that disabling a task – as long as it remains disabled – ensures that it will not perform any work, even if it has task or action runs already scheduled.
{% endhint %}

## Automatic retries

When non-permanent errors are encountered, Mechanic will automatically retry a run. For [HTTP actions](https://learn.mechanic.dev/core/actions/http), this might be a connection error. For [Email actions](https://learn.mechanic.dev/core/actions/email), this might be a temporary outage with our email provider.

Mechanic will automatically retry these runs up to 4 times, for a total of 5 attempts. Retries are subject to a variable backoff delay, of approximately 0:30, 1:16, 2:32, and 5:08 respectively, for each of the 4 retries.

## Manual retries

Some task runs may be manually retried, via the Mechanic user interface.

### Task runs

Task runs may be retried...

* ... if the task run itself failed (due to a Liquid error, an API error while reading data, or something else)
* ... or, if the task run did not generate any actions

During task development, it can be useful to set up a task to only render [log objects](https://learn.mechanic.dev/core/tasks/code/log-objects). A task run which only rendered log objects can be retried, and this ability to retry can be convenient when rapidly iterating on task code.

![This example was generated from a task whose code contained only a {% error "Oh no!" %} tag.](https://3145272362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MQrnkixbmVHvKHMwAbm%2Fuploads%2Fgit-blob-b887aacd1b2da38cdc3595cbe15d0c41a11af1c8%2FScreen%20Shot%202022-05-05%20at%203.53.35%20PM.png?alt=media)

### Action runs

Only failed action runs may be retried.

![This example was generated from a task whose code contained only a {% action "echo", \_\_error: "Oh no!" %} tag.](https://3145272362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MQrnkixbmVHvKHMwAbm%2Fuploads%2Fgit-blob-6c92ed63eb00f93fa44a3914e4286c4c43045c8a%2FScreen%20Shot%202022-05-05%20at%203.55.10%20PM.png?alt=media)
