Key Benefits
- Run only modified models that have changed since the last successful execution
- Execute models with fresher source data, avoiding unnecessary processing of static data
- Automatically retry failed models from previous runs for quick production recovery
Prerequisites
- Scheduler Environment is connected to your data warehouse provider.
- An existing Bolt schedule that executed
dbt source freshnessfor manifest comparison.- The steps to create this schedule and generate the initial artifacts are covered in Part 1 and Part 2 below.
- If you already have a Bolt schedule that has executed the
dbt source freshnesscommand, you can skip ahead to Part 3: Create “Build and Test Models with New Source Data” from Template.
How to Configure
Implementing the “Build and Test Models with New Source Data” schedule requires a multi-step setup process. Follow these instructions carefully to ensure a successful configuration.Part 1: Create a Source Freshness Schedule (Prerequisite)
Part 1: Create a Source Freshness Schedule (Prerequisite)
If you don’t have an existing Bolt schedule that executes the
dbt source freshness command, you’ll need to set that up first. This provides the necessary artifacts for the optimized build schedule.- From the Bolt home screen, select + New Schedule and then select the “Snapshot Source Data Freshness” template.
- Name: Provide a relevant name (e.g. “Source Freshness Check”)
- Click “Deploy” to publish the new Source Freshness schedule.
Part 2: Generate Initial Artifacts for Source Freshness Schedule (Prerequisite)
Part 2: Generate Initial Artifacts for Source Freshness Schedule (Prerequisite)
The purpose of this part is to execute an initial run of the Source Freshness Check schedule. This generates the manifest files (artifacts) that will be used as the baseline for the optimized build schedule to compare against in subsequent runs.
- From the Bolt home screen, click on the newly created Source Freshness Check schedule.
- Click “Run” to execute an initial run of the schedule and generate the manifest files (artifacts)
- Verify the initial run was successful by checking the run history
- From the Bolt home screen, select + New Schedule and then select the “Build and Test Models with New Source Data” template.
- Schedule Type: Select Deferred, which enables manifest comparison between runs.
- Name: Provide a relevant name (e.g. “Build and Test Models with New Source Data”)
- Description (Optional): Describe the purpose of this schedule (e.g. “Automatically build and test only models with fresher source data”)
- Deferred Schedule: Initially, select the existing “Source Freshness Check” schedule. This allows the first run to have manifest files (AKA artifacts) to compare against.
- Last Run Type: Select Last Run to use the artifacts from the most recent execution.
- Command Settings: Update the existing dbt commands:
Starting with the command
dbt build --select source_status:fresher+ ensures the initial setup is successful in generating the necessary artifacts, before transitioning to the more comprehensive command in the later step.- Notification Settings (Optional): Configure success, failure, and SLA breach alerts via email, Slack, or MS Teams.
- Click “Deploy” to save the new schedule.
- From the Bolt home screen, click on the newly created “Build and Test Models with New Source Data” schedule.
- Click “Run” to execute an initial run and generate the manifest files (artifacts).
- Verify the initial run was successful by checking the run history
- From the Bolt home screen, click on the “Build and Test Models with New Source Data” schedule.
- Click “Edit” to modify the configuration.
- Update the Deferred Schedule to “self” so the schedule can compare against its own previous successful run.
- Command Settings: Reintroduce the full commands:
Reintroducing the full command allows the schedule to compare each run against its own previous successful execution, providing a comprehensive rebuild process. This addresses changes in source data and model code, while retrying failed models to keep the data pipeline up-to-date and healthy over time.
- Click “Deploy” to save the changes.