> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/harness-platform/3.0/harness-platform-resources/pipelines/re-run-with-original-definition-and-inputs.md).

# Rerun Pipeline with Original Pipeline Definition and Inputs

Harness allows you to rerun a pipeline using the exact same pipeline definition (YAML) and input variables used during the original execution. This ensures accurate reproducibility of past executions, even if the pipeline definition has changed since the original run.

{% hint style="info" %}
**IMPORTANT REQUIREMENTS**

Before using this feature, note the following:

* **Feature flag required**: This feature requires the `PIPE_USE_ORIGINAL_YAML_FOR_EXECUTION` feature flag. Contact [Harness Support](mailto:support@harness.io) to enable it.
* **Data retention**: Reruns are subject to data retention policies. By default, execution data is retained for 30 days, unless your account has a custom retention setting. You can only rerun executions that are still available within this retention window.
  {% endhint %}

***

### What you will learn from this topic <a href="#what-you-will-learn-from-this-topic" id="what-you-will-learn-from-this-topic"></a>

* How to [enable rerun with original definition](#enable-rerun-with-original-definition) for your account.
* How to [rerun a pipeline with original definition and inputs](#rerun-pipeline-with-original-definition-and-inputs) from execution history.
* How rerun with original definition [differs from regular rerun](#difference-from-regular-rerun).

***

### Before you begin <a href="#before-you-begin" id="before-you-begin"></a>

* **Harness project**: You need an existing project. For more information, refer to [Organizations and Projects](https://github.com/iKettles/harness-gitbook/tree/main/docs/platform/organizations-and-projects/projects-and-organizations/README.md).
* **Pipeline**: You need an existing pipeline with at least one completed execution. For more information, refer to [Create your first pipeline](/harness-platform/3.0/harness-platform-resources/pipelines/harness-yaml-quickstart.md).
* **Pipeline permissions**: You need **Pipeline: Execute** permission to rerun pipelines. For more information, refer to [RBAC in Harness](/harness-platform/3.0/harness-platform-resources/platform-access-control/rbac-in-harness.md).

***

### Enable rerun with original definition <a href="#enable-rerun-with-original-definition" id="enable-rerun-with-original-definition"></a>

Perform the following steps to enable rerun with original definition for your account.

1. In Harness, navigate to **Account Settings**.
2. Select **Default Settings**.
3. Select **Pipeline**.
4. In the **Allow using original pipeline YAML for reruns** setting, select **true**.
5. Select **Save**.

***

### Rerun pipeline with original definition and inputs <a href="#rerun-pipeline-with-original-definition-and-inputs" id="rerun-pipeline-with-original-definition-and-inputs"></a>

When you rerun a pipeline with original definition, Harness uses the compiled pipeline YAML from the original execution and auto-populates the original input values.

**Example:**

Imagine you have a pipeline that takes input variables (for example, environment name or version number). You run the pipeline with a specific set of inputs. This is **Execution ID: 1**.

A few days later, you modify the pipeline YAML by adding a new step or changing a stage name. You run the pipeline again with new input values. This is **Execution ID: 2**.

If you want to rerun the pipeline exactly as it was during Execution ID: 1, you can use rerun with original definition. This option uses:

* The original YAML that was in place during Execution ID: 1.
* The exact same inputs you provided during Execution ID: 1.

You do not need to worry about any changes made to the pipeline after Execution ID: 1. When you rerun using the original definition, Harness reproduces the pipeline exactly as it was during that execution.

{% hint style="info" %}
**POINT-IN-TIME SNAPSHOT**

Rerunning with original definition does not revert or affect the current pipeline state. The new YAML you used for Execution ID: 2 remains intact. You are running a point-in-time snapshot of the pipeline as it was during Execution ID: 1.
{% endhint %}

Perform the following steps to rerun a pipeline with its original definition and inputs.

1. In Harness, navigate to your pipeline and select the **Execution History** tab.
2. Select the execution you want to rerun from.
3. Select **Re-run**.
4. Select **Re-run with original definition**.
5. The **Run Pipeline** dialog opens with the original input values auto-populated.
6. Select **Re-run Pipeline**.

The pipeline executes using the original compiled pipeline YAML and input values from the selected execution.

***

### Difference from regular rerun <a href="#difference-from-regular-rerun" id="difference-from-regular-rerun"></a>

Rerun with original definition differs from regular rerun in how it handles pipeline YAML and input values.

* When you use the regular **Re-run Pipeline** or **Re-run from Specific Stage** options, Harness uses the latest version of the pipeline YAML. This means:
  * Any changes made to the pipeline after the original execution are included in the rerun.
  * You must manually re-enter input variables.
* When you use **Re-run with original definition**, Harness uses the pipeline YAML from the specific execution. This means:

  * The pipeline executes with the YAML definition that was in place during the original execution.
  * Input variables are automatically filled in with the values used during the original execution.

  This approach is especially helpful for debugging, validating reproducibility, or comparing past outcomes with current ones.

***

### Next steps <a href="#next-steps" id="next-steps"></a>

* [Run specific stages](/harness-platform/3.0/harness-platform-resources/pipelines/run-specific-stage-in-pipeline.md): Select which stages to run during pipeline execution.
* [Rerun pipeline with no input changes](/harness-platform/3.0/harness-platform-resources/pipelines/re-run-with-no-input-changes.md): Configure pipelines to prevent input changes during rerun.
* [Runtime inputs](/harness-platform/3.0/harness-platform-resources/variables-and-expressions/runtime-inputs.md): Learn how runtime inputs work in pipelines.

***
