Define failure strategies for stages and steps
A failure strategy defines how steps, stages, and step groups handle different failure conditions.
A failure strategy consists of error conditions that must occur to trigger the strategy and the actions to take when those failure conditions occur.
Failure strategies are a critical pipeline design component that determine what fails a step or stage and what to do when the failure occurs.
Video: Configure failure strategies
Configure failure strategies
You can apply failure strategies to:
- Stages: A stage failure strategy applies to all steps and step groups in the stage that don't have step-level failure strategies.
- Steps: This failure strategy overrides (or enhances) the stage failure strategy.
- Step Groups: You can set up a failure strategy for all steps in the group. Individual steps in the group don't have a failure strategy.
- Pipelines: Pipeline rollback is a failure strategy for all stages in a pipeline. The pipeline rolls back if any of the stages in the pipeline fails.
Add a stage failure strategy
The stage failure strategy applies to all steps in the stage that do not have their own failure strategy configured.
-
In your pipeline, select the stage where you want to add the failure strategy.
-
Select the Advanced tab.
-
Under Failure Strategy, the default stage failure strategy is shown:
On all errors other than those specified in failure strategies defined here, perform action.
You can't remove the default strategy, but you can edit it to choose a different Action, Timeout, and Post timeout action.
-
To add an additional stage failure strategy, select Add, and then configure the failure strategy settings:
- On failure of type: Select one or more of the error types to trigger the failure strategy.
- Perform Action: Select the action that should occur when the specified failure event happens.
- Timeout and Post timeout action: These are available if you selected Manual Intervention for the Action. The manual intervention action allows a user to intervene and choose an Action when the specified failure event occurs. You can enter a Timeout for the user to select an action, and a Post Timeout Action to fallback on if the user doesn't manually select an action in a certain amount of time.
- Retry Count and Retry Intervals: these are available if you selected Retry for the Action. Enter the number of times to retry the step and the retry interval.