> 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-ai/use-harness-platform/pipelines/failure-handling/mark-as-failed.md).

# Mark stage as failed

Mark a stage as failed during pipeline execution to abort running steps and trigger failure strategies.

You can manually mark a specific stage as failed during pipeline execution. When you mark a stage as failed, Harness aborts any currently-running delegate tasks and triggers configured failure strategies.

***

### What you will learn from this topic

* How to [configure a failure strategy](#configure-failure-strategy) for manually marked stage failures.
* How to [mark a stage as failed](#mark-a-stage-as-failed) during pipeline execution.

***

### Before you begin

* **Pipeline permissions:** You must have Execute permissions on pipelines to mark a stage as failed. For more information, refer to [Manage roles](/harness-ai/use-harness-platform/platform-access-control/add-manage-roles.md).
* **Account setting enabled:** You must enable **Allow users to mark a running Step as failure** in your Harness account's [default settings](/harness-ai/use-harness-platform/settings/default-settings.md).

***

### Configure failure strategy

Failure strategies define the actions to take when a stage fails. You can configure failure strategies for different failure conditions.

If a stage marked as failed has no specified failure strategy, Harness uses the default failure strategy.

Perform the following steps to configure a failure strategy for manual stage failure:

1. In your pipeline, select the stage where you want to configure a failure strategy.
2. Click the **Advanced** tab.
3. Under **Failure Strategy**, click **Add**.
4. For **On failure of type**, select **User Marked Failure**.
5. For **Perform Action**, select the desired action to take when the stage is marked as failed, such as **Rollback** or **Retry**.
6. Click **Save**.

![](https://173309742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3F2TpHXhur2QtQnORSM9%2Fuploads%2Fgit-blob-b57e8902e30b2c9b8310f558211db69016b2ef91%2Ffailure-strategy.png?alt=media)

***

### Mark a stage as failed

Perform the following steps to mark a stage as failed during pipeline execution:

1. [Go to the execution details](/harness-ai/use-harness-platform/pipelines/executions-and-logs/view-and-compare-pipeline-executions.md) for a currently-running pipeline.
2. Select the stage you want to mark as failed, and click **Mark Stage As Failed**.

![](https://173309742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3F2TpHXhur2QtQnORSM9%2Fuploads%2Fgit-blob-732bd88486bff2e79efe1f512502f9c8de5947a9%2Fmark-stage-failed.png?alt=media)

In the execution history, the stage's **Error Summary** reports `User Initiated Failure`, and the stage's failure type is `USER_MARKED_FAILURE`.

{% hint style="info" %}
**Parallel stages**

If you need to fail multiple stages running parallel, you must select **Mark Stage as Failed** for each parallel stage.

If you only mark one of the parallel stages as failed, the other stages must complete before the failure strategy applies for the failed stage.
{% endhint %}

***

### Next steps

* [Define a failure strategy on stages and steps](/harness-ai/use-harness-platform/pipelines/failure-handling/define-a-failure-strategy-on-stages-and-steps.md): Configure automated failure handling strategies for different error conditions.
* [Mark pipeline as failed](/harness-ai/use-harness-platform/pipelines/failure-handling/mark-as-failed-pipeline.md): Mark an entire pipeline as failed instead of a single stage.

{% @harness-feedback/feedback module="harness-ai" pagePath="harness-ai/use-harness-platform/pipelines/failure-handling/mark-as-failed" %}
