<@U088WCP3B4P>,is it possible to run elementary at...
# ask-elementary-ai
e
@kapa.ai,is it possible to run elementary at the end, not at the beginning of dbt run?
k
A message from kapa.ai
Based on the knowledge sources, Elementary already primarily operates at the end of a dbt run by utilizing
on-run-end
hooks
. These hooks are designed to extract data from dbt's
results
and
graph
objects and upload them to the Elementary schema after your models or tests have finished executing [[Elementary dbt package on-run-end hooks](https://docs.elementary-data.com/data-tests/dbt/on-run-end_hooks#page-title)]. However, if you are referring to the Elementary models themselves (the tables where results are stored), there are specific recommendations for when and how they should run: ### 1. Running Elementary Models You do not need to run Elementary models (e.g.,
dbt run -s elementary
) every time you run your production pipeline. These models only need to be built: * During the initial installation. * After a minor version upgrade (e.g., upgrading from 0.7.5 to 0.8.0) [[Slack forum user question](https://elementary-community.slack.com/archives/C02CTC89LAX/p1741272625948369?thread_ts=1741272625.948369&amp;cid=C02CTC89LAX); [Slack forum user question](https://elementary-community.slack.com/archives/C02CTC89LAX/p1689861891276609?thread_ts=1689861891.276609&amp;cid=C02CTC89LAX)]. During standard runs, the
on-run-end
hooks will automatically populate these existing tables with the latest data [[Elementary dbt package on-run-end hooks](https://docs.elementary-data.com/data-tests/dbt/on-run-end_hooks#page-title)]. ### 2. Excluding Elementary from Daily Runs If you notice Elementary models are running at the beginning or middle of your standard
dbt run
or
dbt build
, you can explicitly exclude them to ensure they don't consume resources unnecessarily:
Copy code
bash dbt run --exclude package:elementary
[[Slack forum user question](https://elementary-community.slack.com/archives/C02CTC89LAX/p1747229110843109?thread_ts=1747229110.843109&amp;cid=C02CTC89LAX)]. ### 3. Running the EDR CLI For production observability, it is recommended to run the Elementary CLI (
edr monitor
or
edr send-report
) at the very end of your pipeline, after your dbt runs and tests are complete, to ensure the alerts and reports contain the most up-to-date data [[Slack forum user question](https://elementary-community.slack.com/archives/C02CTC89LAX/p1684518982383579?thread_ts=1684518982.383579&amp;cid=C02CTC89LAX); [Slack forum user question](https://elementary-community.slack.com/archives/C02CTC89LAX/p1709134617550489?thread_ts=1709134617.550489&amp;cid=C02CTC89LAX)]. ### Summary of Order A typical efficient production flow looks like this: 1.
dbt run --exclude package:elementary
(Runs your models) 2.
dbt test --exclude package:elementary
(Runs your tests) 3. Automatically: Elementary
on-run-end
hooks update the metadata and result tables. 4.
edr monitor
(Sends alerts based on the data just collected).