For the complete documentation index, see llms.txt. This page is also available as Markdown.

Abort a pipeline, stage, or step

Abort pipeline, stage, or step execution.

This topic explains how to stop an in-progress pipeline, stage, or step. Use this option with caution, as aborting an execution can have additional impacts.


What you will learn from this topic


Before you begin

To abort a pipeline, stage, or step, you need permission to abort pipelines. There are two primary ways you can configure this with Harness RBAC:

  • Pipeline Execute permission: By default, this permission grants you the ability to initiate and interact with pipeline executions, including running pipelines, aborting pipelines and pipeline components (stages and steps), retrying/rerunning pipelines, and so on.

  • (Beta) Abort permission: To control the Abort permission separately from other pipeline execute functions, you can enable the Feature Flag CDS_PIPELINE_ABORT_RBAC_PERMISSION by contacting Harness Support.

    • Enabling this feature flag can take several days because it requires migrating your existing users to this permissions structure.

    • If the Abort permission is not listed in your account's RBAC settings, then your account is using the default Pipeline Execute permission functionality to control all pipeline execution functions (run, abort, retry, and so on).

Permissions are contained in roles, which can be narrowly scoped, such as the Pipeline Executor role, or broadly scoped, like the Account Admin role.


Abort a pipeline

When you abort a pipeline:

  • The pipeline finishes executing the current task and then stops.

  • The pipeline status becomes Aborted.

  • Harness does not clean up resources created during pipeline execution, such as pods.

To terminate a running pipeline, go to the pipeline's execution details, select More Options (⋮), and then select Abort Pipeline.

Abort a stage

When you abort a stage:

  • The stage finishes executing the current task and then stops. Then the pipeline stops, and the pipeline status becomes Aborted. Stages after the aborted stage do not run.

  • Harness does not clean up resources that were created during stage execution, such as pods.

To terminate a running stage in a running pipeline, go to the pipeline's execution details, select the stage you want to terminate, and select the Stop icon next to the stage name.

Abort a step

You can initiate an abort on the Verify step. For more information, go to Abort verification.

Pipeline abort process

Although an abort process may be initiated, there are multiple steps that need to be completed as a part of an abort. This can mean that delays can occur in the timing of when tasks become aborted, and whether the receiving environments will abort their processes.

As an example, a pipeline may have multiple parallel stages, doing a variety of tasks. A bash job, a build in Artifactory, and possibly other processes could be running concurrently.

They all may have different timings for when those abort process will be received and completed.

Abort completion process

The abort event to the delegate has its own delay due to network and infrastructure and can take time to arrive.

After that, the delegate still has the possibility of additional delays in sending that "abort" message to the destinations. Network and infrastructure can add further delays and then the abort process is also dependent on the task itself.

For example, aborting a BASH execution should be relatively simple, whereas, stopping a build process from Artifactory would be a larger process. Harness can initiate a command to abort, but it may ultimately be controlled by the other service that it is connecting to, and how it would handle the abort command.

During that time, the task that is supposed to be stopped can be completed or partially completed. Review your environments to confirm whether any artifacts or builds were created before the abort commands completed.

You should weigh whether aborting a pipeline or failing stages to trigger a rollback is a better option to stop execution.


Next steps

You can now manually stop pipeline, stage, or step execution when needed. Aborting immediately terminates execution without triggering failure strategies.

Last updated

Was this helpful?