Do Elementary tests have to run right after models...
# ask-elementary-ai
a
Do Elementary tests have to run right after models run or thye can run idnendpently?
k
A message from kapa.ai
Elementary tests can run independently from your model runs, but there are some important considerations to understand about how Elementary works with your dbt workflow. Elementary uses on-run-end hooks to collect metadata about your dbt runs, tests, and model performance. These hooks automatically run after your dbt commands (like
dbt run
or
dbt test
) to populate the Elementary tables with the necessary data. When running Elementary in your workflow, you have a few options: 1. You can run Elementary CLI commands (
edr monitor
,
edr send-report
) after your dbt commands have completed. This ensures that Elementary has the latest data about your models and tests. 2. You can also run Elementary periodically in a separate workflow if you prefer to get alerts and reports on a schedule rather than immediately after each dbt run. As one support staff member explained: "Elementary will pick all of your runs! The way elementary works is by collecting all of your results and insert them into alerts tables. Each new alert is marked as 'pending' until
edr monitor
is running and sending it (which afterwards it will be marked as 'sent')." [Elementary Slack Support](https://slack.com/archives/C02CTC89LAX/p1685463491192549) If you're running multiple dbt commands in sequence (like
dbt run
followed by
dbt test
), you can simply run Elementary at the end of your entire workflow rather than after each individual command. As confirmed by Elementary support: "Running
edr
in the end of the pipeline, the docs refer to scenarios where you run
run/test
separately." [Elementary Slack Support](https://slack.com/archives/C02CTC89LAX/p1709134617550489) So in summary, Elementary tests can run independently, but they rely on the data collected by the on-run-end hooks that execute after your dbt commands.