# require\_fresh\_data\_from

### Project YAML file

dbt\_project.yml

```yaml
models:
  <resource-path>:
    +state:
      require_fresh_data_from: any | all
```

### Properties YAML file

models/\<filename>.yml

```yaml
models:
  - name: my_model
    config:
      state:
        require_fresh_data_from: any | all
```

### SQL file config

models/\<filename>.sql

```sql
{{ config(
    state={
      "require_fresh_data_from": "any" | "all"
    }
) }}
```

## Definition

`require_fresh_data_from` controls how many direct parent nodes need fresh data before dbt State considers this node eligible for a rebuild. dbt State still looks for an object to reuse before triggering an actual rebuild.

| Value           | Behavior                                                                                                                         |
| --------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `any` (default) | The node becomes eligible for a rebuild when *any* direct parent has fresh data. Rebuilds more frequently; may increase spend.   |
| `all`           | The node only becomes eligible for a rebuild when *all* direct parents have fresh data. Rebuilds less frequently; reduces spend. |

## Default

`any`

## Examples

### Require all parents to have fresh data

Use `all` for a model that joins multiple sources and should only rebuild when every upstream dependency has updated:

models/fct\_orders.yml

```yaml
models:
  - name: fct_orders
    config:
      state:
        require_fresh_data_from: all
```

### Apply a project-wide default

dbt\_project.yml

```yaml
models:
  +state:
    require_fresh_data_from: all
```

## Related docs

* [About dbt State](../../docs/deploy/dbt-state-about.md)
* [Set up dbt State](../../docs/deploy/dbt-state-setup.md)

## Was this page helpful?

YesNo

[Privacy policy](https://www.getdbt.com/cloud/privacy-policy)[Create a GitHub issue](https://github.com/dbt-labs/docs.getdbt.com/issues)

This site is protected by reCAPTCHA and the Google [Privacy Policy](https://policies.google.com/privacy) and [Terms of Service](https://policies.google.com/terms) apply.
