Dragos Cioata
04/24/2026, 11:16 AMkapa.ai
04/24/2026, 11:16 AMon-run-end hook. This is a fundamental dbt limitation: project-level on-run-end hooks always execute before package-level hooks (like Elementary's). [Custom on-run-end after Elementary]
> "On a dbt level, there is no way to do such a thing, package hooks will always run after the project hooks." [Slack discussion] Recommended Workarounds 1. Run your macro as a separate dbt run-operation after the dbt run Chain your operation in your orchestrator/CI pipeline after the main dbt command:
dbt run && dbt run-operation my_awesome_end_hook
> â ī¸ Note: This approach loses access to the in-memory results context that is available during hook execution. [Slack discussion] 2. Use dbt models that depend on Elementary's result tables Instead of a hook, create a dbt model that depends on Elementary's tables (e.g., elementary_test_results, dbt_run_results). This ensures your logic runs after Elementary has populated its tables. [Slack discussion] 3. Add dbt run-operation as a pipeline step One community member solved a similar problem by adding a dbt run-operation call as a separate step after dbt test in their pipeline job, rather than relying on hooks at all. [on-run-end hook ordering]
In summary, the cleanest and most reliable approach is to use a dbt model depending on Elementary's tables or a separate pipeline step after the dbt run completes. đ 0 button đ 0 button âšī¸ Tip: Mention @elementary.ai in the thread for follow-ups or DM the app for 1-to-1 help.