How to always run a sequential, final job (e.g. Slack notification)?

I’m searching for a solution to run a final job always, i.e. no matter if the previous jobs in a sequence failed. Basically a when: attribute of steps, but as a workflow’s jobs setting:

    - nice-orb/nice-job
    - slack/notify:
          - nice-orb/nice-job
        when: always  # <- This seems not possible, or?

  slack: circleci/slack@3.x  # notify job not there, yet

Without such setting, it would be impossible to use any job of an orb and receiving a notification of the job results with the new UI.


If you are running your jobs sequentially it is not possible to run a final job unconditionally.
As a workaround, you can add a step at the end of every job that uses the when attribute with a value of on_fail to trigger a step that sends a failure message and a final job that sends a success message if none of the previous jobs have failed. This will allow you to trigger a failure message as soon as a job fails and a success message if all jobs run successfully. I hope that’s helpful. Let me know if you have any followup questions. I am happy to help.

Hi @Henna,

thanks for your answer.

Running a final job in a sequential-jobs workflow is a must-have if I want to finally run an orb. E.g. using your slack/notify-orb which is the intended way for Slack-notifications in the new UI.

Your workaround isn’t guaranteed to work for using orbs from someone else, or? Which is a main feature of orbs, isn’t it?

Do you mind clarifying what you mean by using orbs from someone else? Thanks!