# Soft Fail for cancelled builds

**URL:** <https://forum.buildkite.community/t/soft-fail-for-cancelled-builds/1400>\
**Category:** Features Requests\
**Created:** [December 22, 2020, 6:31am UTC](https://forum.buildkite.community/t/soft-fail-for-cancelled-builds/1400 "2020-12-22T06:31:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nikrollz](https://avatars.discourse-cdn.com/v4/letter/n/9de0a6/32.png) [@nikrollz](https://forum.buildkite.community/u/nikrollz)\
**Post date:** [December 22, 2020, 6:31am UTC](https://forum.buildkite.community/t/soft-fail-for-cancelled-builds/1400/1 "2020-12-22T06:31:54Z")

</div>

I thought at first (and perhaps I am just doing it wrong), but it would be great if soft fail passed builds that are cancelled. Currently it seems that the UI acknowledges the soft fail (code 255), but still fails the build.

It would be great if cancellation (manual or automated) could be made to step fail and build pass. (soft-fail)

---

<div class="post-metadata">

**Author:** ![shevaun](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/shevaun/32/859_2.png) [@shevaun](https://forum.buildkite.community/u/shevaun)\
**Post date:** [December 22, 2020, 11:09pm UTC](https://forum.buildkite.community/t/soft-fail-for-cancelled-builds/1400/2 "2020-12-22T23:09:27Z")

</div>

Hi @nikrollz and welcome to the forum!

The reason why cancellation is considered a hard fail is because it’s a direct action from the user.

What problem are you trying to solve with soft failures? If you can email [support@buildkite.com](mailto:support@buildkite.com) with more details, we’d love to help you find a solution :)

---

<div class="post-metadata">

**Author:** ![pavanrh](https://avatars.discourse-cdn.com/v4/letter/p/3d9bf3/32.png) [@pavanrh](https://forum.buildkite.community/u/pavanrh)\
**Post date:** [March 5, 2026, 3:13pm UTC](https://forum.buildkite.community/t/soft-fail-for-cancelled-builds/1400/3 "2026-03-05T15:13:44Z")

</div>

Was this ever solved? I am trying to solve a very similar issue where we don’t want to send slack notification (configured in the buildkite UI) if a step is cancelled by running `buildkite-agent step cancel`, thank you

---

<div class="post-metadata">

**Author:** ![Micheal](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/micheal/32/1588_2.png) [@Micheal](https://forum.buildkite.community/u/Micheal)\
**Post date:** [March 5, 2026, 4:06pm UTC](https://forum.buildkite.community/t/soft-fail-for-cancelled-builds/1400/4 "2026-03-05T16:06:04Z")

</div>

Hi @pavanrh basically for this, you can use `soft_fail` here. When a non-running step is cancelled, the `exit_status` is `null`, so you can do something like:

```auto
steps:
  - key: cancel-me
    soft_fail:
      - exit_status: "*"
    commands: |
      sleep 180
  - commands: |
      sleep 15
      buildkite-agent step cancel --step 'cancel-me'
    priority: 100

```

You can also simply use `soft_fail: true`. The downside here is that if the `cancel-me` step has a legitimate failure and exits with a non-zero status then it will also be marked as soft fail.
