New to Kestra?
Use blueprints to kickstart your first workflows.
Poll Trino for new failed payments with a Kestra JDBC trigger. Executions start only when rows match, and Discord gets the count within 5 minutes.
Turn any Trino query into a monitor. The io.kestra.plugin.jdbc.trino.Trigger polls the cluster on a fixed interval and starts an execution only when the query returns at least one row, which makes it a natural fit for row-level alerting: failed payments, stuck orders, rejected records, anything expressible as a SELECT. This blueprint watches postgres.public.payments through Trino for payments that failed in the last five minutes and posts the count to Discord.
on_new_failed_payments (io.kestra.plugin.jdbc.trino.Trigger) runs the SELECT every five minutes (interval: PT5M). When zero rows match, no execution starts and nothing is logged as noise. When one or more rows match, an execution starts.fetchType: FETCH, the matching rows ride along on the trigger output as {{ trigger.rows }}, and {{ trigger.size }} carries the count as a plain scalar.alert_failed_payments posts the count to Discord. Only the scalar trigger.size is interpolated into the JSON payload; the row list stays on the trigger output where downstream tasks can consume it safely.errors block posts a distinct Discord message when the flow itself fails, so a broken monitor is never mistaken for a quiet one.disabled: true so importing the blueprint never polls a placeholder cluster.A cron script running the same SELECT would need its own state handling, deduplication of empty runs, alert delivery, failure reporting, and history. The JDBC trigger folds all of that into one declarative block: Kestra manages the polling loop, only materializes executions when rows match, exposes the rows and count as structured outputs, and records every firing in the execution history for audit.
postgres.public.payments with status and created_at columns.TRINO_URL: JDBC URL, e.g. jdbc:trino://host:443/postgres/public (use https on 443 in production; password authentication requires TLS).TRINO_USERNAME: Trino username.TRINO_PASSWORD: Trino password.DISCORD_WEBHOOK_URL: Discord incoming webhook URL.disabled: false on the trigger and insert a test row matching the condition.fetchType: STORE for large result sets; the rows then arrive as a file at {{ trigger.uri }}, ready for a downstream export or ticket attachment.io.kestra.plugin.core.flow.Loop over {{ trigger.rows }} to open one ticket per failed payment.If task on an amount threshold.