build_models
Run seeds, models, snapshots, and tests in correct dependency order using dbt build, simplifying data pipeline management.
Instructions
Run dbt build (execute models and tests together in correct dependency order).
When to use: This is the recommended "do everything" command that runs seeds, models, snapshots, and tests in the correct order based on your DAG. It automatically handles dependencies, so you don't need to run load_seeds() → run_models() → test_models() separately.
How it works: Executes resources in dependency order:
Seeds (if selected)
Models (with their upstream dependencies)
Tests (after their parent models complete)
Snapshots (if selected)
State-based selection modes (uses dbt state:modified selector):
select_state_modified: Build only resources modified since last successful run (state:modified)
select_state_modified_plus_downstream: Build modified + downstream dependencies (state:modified+) Note: Requires select_state_modified=True
Manual selection (alternative to state-based):
select: dbt selector syntax (e.g., "customers", "tag:mart", "stg_*")
exclude: Exclude specific models
Args: select: Manual selector exclude: Exclude selector select_state_modified: Use state:modified selector (changed resources only) select_state_modified_plus_downstream: Extend to state:modified+ (changed + downstream) full_refresh: Force full refresh of incremental models resource_types: Filter by resource types (model, test, seed, snapshot) fail_fast: Stop execution on first failure state: Shared state object injected by FastMCP
Returns: Build results with status, models run/tested, and timing info
See also: - run_models(): Run only models (no tests) - test_models(): Run only tests - load_seeds(): Run only seeds
Examples: # Full project build (first-time setup or comprehensive run) build_models()
# Build only what changed (efficient incremental workflow)
build_models(select_state_modified=True)
# Build changed resources + everything downstream
build_models(select_state_modified=True, select_state_modified_plus_downstream=True)
# Build specific model and its dependencies + tests
build_models(select="customers")
# Build all marts (includes their seed dependencies automatically)
build_models(select="tag:mart")
# Quick feedback: stop on first test failure
build_models(fail_fast=True)Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| select | No | ||
| exclude | No | ||
| select_state_modified | No | ||
| select_state_modified_plus_downstream | No | ||
| full_refresh | No | ||
| resource_types | No | ||
| fail_fast | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||