New to Kestra?
Use blueprints to kickstart your first workflows.
Orchestrate dbt Core and Elementary tests in Kestra. Catch volume, freshness, and schema anomalies, generate reports, and alert Slack.
Silent data corruption, sudden row count drops, and breaking schema changes can cascade through business intelligence dashboards unnoticed until stakeholders complain. This blueprint orchestrates Elementary, the open-source data observability and testing framework for dbt, directly inside Kestra. It monitors data models for volume deviations, column distribution anomalies, and freshness violations, compiles an interactive HTML health report, and routes actionable triage notifications to Slack.
Schedule trigger (daily_morning_audit) launches the audit before morning reporting hours, while an authenticated Webhook trigger (upstream_warehouse_sync) enables upstream ingestion tools (such as Fivetran or Airbyte) to trigger checks upon data sync completion.WorkingDirectory task (dbt_and_elementary_workspace) provisions a shared local filesystem for all test operations:clone_repository (io.kestra.plugin.git.Clone) pulls the latest dbt models, configuration files, and packages.yml.run_dbt_and_elementary (io.kestra.plugin.scripts.shell.Commands) spins up an isolated Docker container with dbt-postgres and elementary-data, generates an inline profile connecting to your data warehouse via secrets, installs required dbt packages (dbt deps), and executes Elementary tests (dbt test --select tag:elementary). It then runs edr report to build a self-contained HTML observability dashboard.parse_elementary_results (io.kestra.plugin.scripts.python.Script) parses the compiled dbt test manifest and run results, outputting the total test count, detected anomaly count, and individual failure messages to Kestra variables.If conditional task (evaluate_anomalies) routes downstream execution:has_anomalies: true), notify_slack_anomalies (io.kestra.plugin.slack.notifications.SlackIncomingWebhook) sends a structured Slack Block Kit message with the failing test identifiers and error descriptions.log_clean_run records a confirmation log.errors block intercepts fatal runner aborts or network dropouts, ensuring that pipeline infrastructure failures are never silent.elementary_report.html artifact capturing table lineages and historical test run timelines.Elementary provides tests and reporting, but requires an external orchestrator to schedule runs, manage database secrets securely, handle retries, and route alerts. Kestra provides a containerized task runner, declarative Git-versioned flow definitions, unified secret masking ({{ secret(...) }}), and event-driven webhook triggers. If a runner crashes or database connectivity drops, Kestra's execution state engine captures logs and executes the errors safeguard.
elementary-data/elementary package in packages.yml.Configure the following secrets in your Kestra namespace:
POSTGRES_HOST: Hostname of the target data warehouse.POSTGRES_PORT: Port number of the warehouse (default 5432).POSTGRES_DB: Name of the target database.POSTGRES_USER: Database user authorized to execute transformations and write Elementary artifacts.POSTGRES_PASSWORD: Database user password.POSTGRES_SCHEMA: Primary schema housing dbt models and Elementary tables.SLACK_WEBHOOK_URL: Slack Incoming Webhook URL for incident triage alerting.WEBHOOK_KEY: Authentication key for triggering the pipeline via HTTP Webhook.dbt deps and Elementary test suites complete cleanly.daily_morning_audit schedule trigger to activate automated morning audits.dbt-postgres adapter in run_dbt_and_elementary for dbt-snowflake, dbt-bigquery, or dbt-redshift to match your cloud data warehouse.elementary_report.html to an Amazon S3 or Google Cloud Storage bucket with a presigned URL using io.kestra.plugin.aws.s3.Upload.evaluate_anomalies passes cleanly.