# How to defer upstream references

**URL:** <https://discourse.getdbt.com/t/how-to-defer-upstream-references/9450>\
**Category:** Help\
**Tags:** testing, snowflake, dbt-core\
**Created:** [August 7, 2023, 10:19pm UTC](https://discourse.getdbt.com/t/how-to-defer-upstream-references/9450 "2023-08-07T22:19:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![htz](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/htz/32/878_2.png) [@htz](https://discourse.getdbt.com/u/htz)\
**Post date:** [August 7, 2023, 10:19pm UTC](https://discourse.getdbt.com/t/how-to-defer-upstream-references/9450/1 "2023-08-07T22:19:30Z")

</div>

## The problem I’m having

I saw in the dbt docs that “In v0.19.0, dbt added support for deferring upstream references when testing. If a test selects from a model that doesn’t exist as a database object in your current environment, dbt will look to the other environment instead—the one defined in your state manifest.” - [Caveats to state comparison | dbt Developer Hub](https://docs.getdbt.com/reference/node-selection/state-comparison-caveats)

However, I don’t see where in the docs that functionality is actually explained in terms of how I can use it.

When I run dbt core locally, I don’t want to have to build every upstream dependency of a changed model in my personal snowflake DB clone, and just want to use the existing models that exist in our main snowflake DB. How do I do that?

---

<div class="post-metadata">

**Author:** ![brunoszdl](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/brunoszdl/32/4113_2.png) [@brunoszdl](https://discourse.getdbt.com/u/brunoszdl)\
**Post date:** [August 7, 2023, 10:42pm UTC](https://discourse.getdbt.com/t/how-to-defer-upstream-references/9450/2 "2023-08-07T22:42:30Z")

</div>

Hi @htz , I think this is what you are looking for

> **[Defer | dbt Developer Hub](https://docs.getdbt.com/reference/node-selection/defer#test)**
>
> \- v0.18.0: Introduced --defer and --state flags as beta features.

You have to save the artifacts of your main DB in a folder and pass the folder’s path to the --state flag

```auto
dbt test --select model_b --defer --state prod-run-artifacts

```
