on_errorBeta
- Project file
- Property file
- SQL config
models:
<resource-path>:
+on_error: skip_children | continue
models:
- name: [<model-name>]
config:
on_error: skip_children | continue
{{ config(
on_error="skip_children" | "continue"
) }}
Definition​
The on_error config is a beta feature in dbt Core v1.12.
The on_error config controls what happens to downstream (child) models when a model fails during a run. This config accepts two values:
skip_children(default): All downstream models are skipped when the model fails.continue: Downstream models continue running when the model fails, instead of being skipped.
Example​
Set on_error: continue when downstream models can still run meaningfully even if an upstream model fails (for example, when they have fallback logic or independent data sources).
{{ config(
materialized='table',
on_error='continue'
) }}
select 1 as id
When on_error is set to continue on a model that fails, dbt runs its downstream models rather than skipping them. The failed model itself still appears as an error in the run results.
The --fail-fast flag takes precedence over on_error: continue. When --fail-fast is set, dbt stops at the first failure and skips all remaining models, regardless of their on_error configuration.
Behavior with multiple upstream models​
When a model has multiple upstream models, skip_children takes precedence over continue. If any failed upstream model uses skip_children, the downstream model is skipped — even if other failed upstream models use continue.
For example, consider a DAG where model_c depends on both model_a and model_b:
model_auseson_error: skip_childrenmodel_buseson_error: continue
The following table shows how model_c behaves based on the outcome of its upstream models:
When model_a errors, model_c is always skipped because model_a uses skip_children. When only model_b errors, model_c still runs because model_b uses continue, which does not block downstream models.
Was this page helpful?
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.