# Allow creating a step that is executed even if the build gets aborted

**URL:** <https://discuss.bitrise.io/t/allow-creating-a-step-that-is-executed-even-if-the-build-gets-aborted/9387>\
**Category:** Steps\
**Tags:** step\
**Created:** [June 21, 2019, 10:52am UTC](https://discuss.bitrise.io/t/allow-creating-a-step-that-is-executed-even-if-the-build-gets-aborted/9387 "2019-06-21T10:52:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mstrzoda](https://avatars.discourse-cdn.com/v4/letter/m/df788c/32.png) [@mstrzoda](https://discuss.bitrise.io/u/mstrzoda)\
**Post date:** [June 21, 2019, 10:52am UTC](https://discuss.bitrise.io/t/allow-creating-a-step-that-is-executed-even-if-the-build-gets-aborted/9387/1 "2019-06-21T10:52:48Z")

</div>

Currently, it’s possible to add a step that is run if the build fails (using `is_always_run: true`).

If the build is aborted though, no steps from that point onwards will run.

We would like to be able to create a step that will be _always_ run, even if build gets aborted, i.e. to perform a necessary cleanup of external services.

---

<div class="post-metadata">

**Author:** ![koral](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/koral/32/357_2.png) [@koral](https://discuss.bitrise.io/u/koral)\
**Post date:** [June 21, 2019, 2:51pm UTC](https://discuss.bitrise.io/t/allow-creating-a-step-that-is-executed-even-if-the-build-gets-aborted/9387/3 "2019-06-21T14:51:26Z")

</div>

Build may be aborted among others due to elapsed build time or lost connection to build VM. So even if such flag is added it may not be possible to run anything from inside affected workflow in some cases.

To achieve such result you can e.g. use Bitrise Start Build step and perform cleanup from parent workflow.

---

<div class="post-metadata">

**Author:** ![minkyiiang](https://avatars.discourse-cdn.com/v4/letter/m/edb3f5/32.png) [@minkyiiang](https://discuss.bitrise.io/u/minkyiiang)\
**Post date:** [May 22, 2020, 5:31am UTC](https://discuss.bitrise.io/t/allow-creating-a-step-that-is-executed-even-if-the-build-gets-aborted/9387/4 "2020-05-22T05:31:26Z")

</div>

Using Bitrise Start Build will use up another concurrency. Ideally we want to be able to run clean up steps after build is aborted. Doesn’t matter if build can be aborted due to elapsed build time/lost connection but 90 percent of the time, aborted builds due to rolling build cancellation or manual trigger, we want to be able to clean up/report build status back to git provider.

---

<div class="post-metadata">

**Author:** ![miteshg](https://avatars.discourse-cdn.com/v4/letter/m/ba8739/32.png) [@miteshg](https://discuss.bitrise.io/u/miteshg)\
**Post date:** [February 24, 2021, 9:05am UTC](https://discuss.bitrise.io/t/allow-creating-a-step-that-is-executed-even-if-the-build-gets-aborted/9387/5 "2021-02-24T09:05:35Z")

</div>

We too wanted such a capability to run a step if build is aborted.

---

<div class="post-metadata">

**Author:** ![siddhantsoni](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@siddhantsoni](https://discuss.bitrise.io/u/siddhantsoni)\
**Post date:** [November 2, 2023, 6:50am UTC](https://discuss.bitrise.io/t/allow-creating-a-step-that-is-executed-even-if-the-build-gets-aborted/9387/6 "2023-11-02T06:50:27Z")

</div>

Having a way to run cleanup steps for a job that gets aborted should be a fundamental feature of any CI orchestration solution. Definitely expected from a paid solution like Bitrise
