# Tags models execution order

**URL:** https://discourse.getdbt.com/t/tags-models-execution-order/8439
**Category:** Help
**Tags:** dbt-cloud, orchestration-and-deployment, bigquery, node-selection, best-practice
**Created:** [May 25, 2023, 4:45pm UTC](https://discourse.getdbt.com/t/tags-models-execution-order/8439 "2023-05-25T16:45:17Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![jorge.sanchez](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/jorge.sanchez/32/2464_2.png) [@jorge.sanchez](https://discourse.getdbt.com/u/jorge.sanchez)
#### Post date: [May 25, 2023, 4:45pm UTC](https://discourse.getdbt.com/t/tags-models-execution-order/8439/1 "2023-05-25T16:45:17Z")

</div>

## The problem I’m having

I have a set of models under a tag, let’s call it `main`. Now, some of these models I would like to run them after all the models in the `main` tag had run, so the idea is to remove them from the `main` tag and assign them the `post-main` tag.

Is there a way supported by dbt-core to force these two tags to be run one after the other (main → post-main)? And in dbt-cloud?

## The context of why I’m trying to do this

I am using Dagster to trigger the model execution in BigQuery. The above can be achieved using Dagster but I am interested to know if this can be directly achieved with dbt-core, as I would like to reduce the interdependency between these two.  
As far as I know, the `--select tag:main tag:post-main` doesn’t imply that the desired order will be followed.

Thank you.

---

<div class="post-metadata">

### Author: ![TomC](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/tomc/32/2466_2.png) [@TomC](https://discourse.getdbt.com/u/TomC)
#### Post date: [May 26, 2023, 11:34am UTC](https://discourse.getdbt.com/t/tags-models-execution-order/8439/2 "2023-05-26T11:34:32Z")

</div>

Hi Jorge,

Unfortunately this is not possible using dbt directly. In order to run one set of models after another set of models, you would need to use two `dbt run` commands with different selectors.

---

<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: [June 2, 2023, 11:35am UTC](https://discourse.getdbt.com/t/tags-models-execution-order/8439/3 "2023-06-02T11:35:08Z")

</div>

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