Skip to content

dbt Jobs

Quick Summary

dbt jobs schedule dbt commands on a cron. They run against the container image built at deploy time, with warehouse credentials injected at runtime. Jobs are created and managed through the web UI.

Setting Recommended Why
Command dbt build Runs models and tests together in dependency order
Schedule Match your source data cadence No point running more frequently than your sources update
Slack Alerts Enabled on failures Know immediately when production data is broken

Key Takeaways

  • dbt build is the default command — it runs models, tests, snapshots, and seeds in dependency order in a single pass
  • Jobs run from the image built at deploy time — to pick up code changes, create a new plan first
  • Environment variables are injected at runtime — warehouse credentials never live in your container image

Available Commands

Command What it does
dbt build Runs models, tests, snapshots, and seeds in dependency order. Recommended default.
dbt run Executes models only. Does not run tests.
dbt test Runs tests only against already-materialized models.
dbt snapshot Executes snapshot models only.
dbt seed Loads CSV seed files into your warehouse.

Creating a dbt Job

  1. Navigate to your project in the dagctl web UI
  2. Click the Jobs tab
  3. Click Create Job
  4. Select the dbt command to run
  5. Set the cron schedule (e.g., 0 * * * * for hourly)
  6. Optionally configure Slack alerts for failures
  7. Click Save

The job starts executing on its next scheduled trigger. You can also trigger a manual run from the Jobs tab.

How Execution Works

When a job triggers:

  1. Kubernetes creates a Job in your organization's namespace
  2. Kyverno intercepts pod creation and mutates the pod spec: - Injects warehouse credentials from your organization's Secrets - Mounts the git-sync init container to clone your repository - Sets resource limits from project configuration
  3. The git-sync init container clones your repository at the pinned commit
  4. The main container executes the configured dbt command
  5. Job Watcher monitors the Kubernetes Job, parses execution output, and reports status back to the control plane
  6. Results are visible in the web UI with full logs

Warning

Jobs run against the container image from your last successful plan. If you push code changes without creating a new plan, the scheduled job will still run against the old image.

Slack Alerts

Configure Slack alerts under Settings → Integrations → Slack. Once connected, you can enable failure notifications per job. Alerts fire when a job exits with a non-zero status.

Next Steps