Skip to content

Re-running only what failed with dbt retry

The dbt retry command re-executes only the nodes that failed or were skipped in the most recent dbt invocation, using the run_results.json file to determine what to rerun. This saves time in development and CI by avoiding a full re-run of successful models, tests, or seeds. It works with any dbt command that produces run_results.json, such as run, build, test, or seed.

1 · Learn the must-know

  • dbt retry reads the run_results.json artifact from the prior invocation to identify nodes with a status of error, fail, or skipped.
  • It reruns the failed/skipped nodes using the exact same command and flags (e.g., full-refresh, target, vars) as the original invocation that produced run_results.json.
  • If no run_results.json is found, or if the prior run had zero failures, dbt retry will raise an error since there is nothing to retry.
  • dbt retry does not accept its own selection criteria (like --select or --exclude); it strictly reuses the failed/skipped node set from the previous run.
  • You must run dbt retry from the same project directory (and target/profile context) as the original failed invocation for the artifacts to be valid.
  • Successful nodes from the prior run are left untouched and are not rerun, which distinguishes retry from simply rerunning the full original command.

2 · Check your understanding

Check this objectiveFree · always available

After a failed dbt build run, a developer deletes the target directory to tidy up local artifacts, then immediately runs dbt retry. The command fails with an error stating that no previous run results could be found. Why does this happen?

Your objective map0 tried · 0 answered correctly · 31 untouched

What you have tried across dbt Analytics Engineering's objectives, not a readiness score.

Developing and optimizing dbt models45.16% of the exam*0 of 14 tried
Managing dbt models governance9.68% of the exam*0 of 3 tried
Debugging data modeling errors16.13% of the exam*0 of 5 tried
Troubleshooting and optimizing dbt pipelines6.45% of the exam*0 of 2 tried
Implementing dbt tests9.68% of the exam*0 of 3 tried
Implementing and maintaining external dependencies6.45% of the exam*0 of 2 tried
Leveraging the dbt state6.45% of the exam*0 of 2 tried

* Our estimate. dbt Labs publishes no section weights.

3 · Keep going