# fail DBT job if source refreshness fail

**URL:** <https://discourse.getdbt.com/t/fail-dbt-job-if-source-refreshness-fail/7909>\
**Category:** Help\
**Tags:** dbt-cloud\
**Created:** [April 19, 2023, 3:38am UTC](https://discourse.getdbt.com/t/fail-dbt-job-if-source-refreshness-fail/7909 "2023-04-19T03:38:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rjames](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/rjames/32/1656_2.png) [@rjames](https://discourse.getdbt.com/u/rjames)\
**Post date:** [April 19, 2023, 3:38am UTC](https://discourse.getdbt.com/t/fail-dbt-job-if-source-refreshness-fail/7909/1 "2023-04-19T03:38:43Z")

</div>

Hi,  
Why does my dbt job succeeds when there is source freshness failure. The goal is fail the job and notify us if the source is not getting refreshed. How this can be achieved?

 ![image](https://us1.discourse-cdn.com/flex020/uploads/getdbt/original/2X/4/47656519262dbd364016f2b40961b620d9ae2902.png)

---

<div class="post-metadata">

**Author:** ![jaypeedevlin](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/jaypeedevlin/32/638_2.png) [@jaypeedevlin](https://discourse.getdbt.com/u/jaypeedevlin)\
**Post date:** [April 19, 2023, 3:45am UTC](https://discourse.getdbt.com/t/fail-dbt-job-if-source-refreshness-fail/7909/2 "2023-04-19T03:45:55Z")

</div>

If you create a job step `dbt source snapshot-freshness` rather than using the selection in the job settings I believe it will fail as required.

---

<div class="post-metadata">

**Author:** ![rjames](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/rjames/32/1656_2.png) [@rjames](https://discourse.getdbt.com/u/rjames)\
**Post date:** [April 19, 2023, 3:53am UTC](https://discourse.getdbt.com/t/fail-dbt-job-if-source-refreshness-fail/7909/3 "2023-04-19T03:53:24Z")

</div>

That worked! Thank you.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/getdbt/original/1X/a7a7ca1fe379aaf90952b0e13118a817babcd14f.png) [@system](https://discourse.getdbt.com/u/system)\
**Post date:** [April 26, 2023, 3:53am UTC](https://discourse.getdbt.com/t/fail-dbt-job-if-source-refreshness-fail/7909/4 "2023-04-26T03:53:43Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
