[4.0.0](https://github.com/virtool/virtool-workflow/compare/3.0.0...4.0.0) (2022-04-28)
Features
* add `on_error` and `on_terminated` hooks ([699d6fe](https://github.com/virtool/virtool-workflow/commit/699d6fe92cce7897ba3fb25df544e9a677d139c1))
* add `on_terminated` hook that is triggered on SIGTERM ([387f1dd](https://github.com/virtool/virtool-workflow/commit/387f1ddf0bf403e44761707ad2e0a18e005b3961))
* exit gracefully on SIGTERM, timeout, and cancellation ([061eecd](https://github.com/virtool/virtool-workflow/commit/061eecd0e566cf648c34b4da185cb8f03d975aae))
BREAKING CHANGES
The `on_failure` hook is still triggered in any failure condition, but it doesn't require and error having been set and doesn't push a status update. The status push behavior is implemented using the `on_error`, `on_terminated`, and `on_cancelled` hooks.
Workflows may have to be updated to account for this change.