# About dbt running specific models by path

**URL:** <https://discourse.getdbt.com/t/about-dbt-running-specific-models-by-path/3062>\
**Category:** Archive\
**Created:** [September 16, 2021, 4:35am UTC](https://discourse.getdbt.com/t/about-dbt-running-specific-models-by-path/3062 "2021-09-16T04:35:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![raaj](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/raaj/32/856_2.png) [@raaj](https://discourse.getdbt.com/u/raaj)\
**Post date:** [September 16, 2021, 4:35am UTC](https://discourse.getdbt.com/t/about-dbt-running-specific-models-by-path/3062/1 "2021-09-16T04:35:32Z")

</div>

> **[Syntax overview | dbt Docs](https://docs.getdbt.com/reference/node-selection/syntax)**
>
> dbt's node selection syntax makes it possible to run only specific resources in a given invocation of dbt. This selection syntax is used for the following subcommands:

The above states we can run only a subset of models via  
`dbt run --models path/to/models`

Let us take a use case where we have a file `path/to/models/a.sql` such that there is a `ref` function in it that references the output of `path/to/models_new/b.sql`.

`b.sql` is situated anywhere outside the folder `path/to/models`

In such a situation will `b.sql` execute too when `dbt run --models path/to/models` runs?  
Because intuitively it should run as we expect the latest data from the mentioned dependencies (through ref).

---

<div class="post-metadata">

**Author:** ![qbatten](https://avatars.discourse-cdn.com/v4/letter/q/41988e/32.png) [@qbatten](https://discourse.getdbt.com/u/qbatten)\
**Post date:** [September 16, 2021, 4:05pm UTC](https://discourse.getdbt.com/t/about-dbt-running-specific-models-by-path/3062/2 "2021-09-16T16:05:59Z")

</div>

No, `b.sql` wouldn’t run because it’s not one of the selected nodes.

Take a look at the [Graph operators](https://docs.getdbt.com/reference/node-selection/graph-operators#the-plus-operator) sub-subsection of that doc. If you want model b to run (as well as all other models that are upstream of the models in the path/to/models folder), then you should call `dbt run --models +path/to/models`.
