New to Kestra?
Use blueprints to kickstart your first workflows.
Build a data quality gate on Trino with Kestra. Check null rate and row count daily, alert Slack on breach, and fail the run to block bad data.
A quality check that only writes a warning to a log is a quality check everyone ignores. This blueprint makes the check binding: one io.kestra.plugin.jdbc.trino.Query with fetchType: FETCH_ONE measures the null rate and row count of yesterday's partition, an If task compares both numbers against thresholds, and on breach the flow posts a Slack alert and then fails the execution with io.kestra.plugin.core.execution.Fail. A failed execution is a signal other flows can depend on, so nothing downstream builds on a bad partition.
check_partition (io.kestra.plugin.jdbc.trino.Query, fetchType: FETCH_ONE) computes row_count and null_rate for iceberg.analytics.events where event_date is yesterday. The single result row is addressable as {{ outputs.check_partition.row.* }}.quality_gate (io.kestra.plugin.core.flow.If) evaluates null_rate > 0.05 or row_count < 1000.alert_breach posts the exact measured values and both thresholds to Slack, then fail_execution (io.kestra.plugin.core.execution.Fail) fails the run with an errorMessage carrying the same numbers.log_pass writes the metrics to the execution log so every day has an auditable record.errors block posts a Slack alert for any failure, including the deliberate one, and a disabled-by-default Schedule trigger runs the gate daily at 06:00.The SQL is trivial; the enforcement is not. Kestra provides the pieces around the query that make the gate real: a schedule, a conditional branch, a first-class way to fail an execution with a meaningful message, notifications, and an execution history where every breach is visible and replayable. Downstream flows can key off this flow's success state, which turns one small check into a dependency contract.
iceberg.analytics.events partitioned or filterable by an event_date column, or adjust the SQL.TRINO_URL: JDBC URL, e.g. jdbc:trino://host:443/iceberg/analytics (use https on 443 in production; password authentication requires TLS).TRINO_USERNAME: Trino username.TRINO_PASSWORD: Trino password.SLACK_WEBHOOK_URL: Slack incoming webhook URL.disabled: false on the daily trigger.io.kestra.plugin.core.flow.Loop over a table list.