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:
workflows:
jobs:
- nice-orb/nice-job
- slack/notify:
requires:
- nice-orb/nice-job
when: always # <- This seems not possible, or?
orbs:
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.
Thank you for clarifying. You can create a job in which you can call commands from another orb and add a the slack status command to send a notification at the end of the job regardless if it passes or fails. For example, I used the hello-build Orb with the Slack Orb.