New to Kestra?
Use blueprints to kickstart your first workflows.
Automate Snowflake FinOps governance with Kestra. Query WAREHOUSE_METERING_HISTORY, threshold-check credit usage, and fire Slack alerts before costs spiral.
Snowflake virtual warehouses scale elastically, making runaway queries easy to overlook until the monthly invoice arrives. This sentinel queries SNOWFLAKE.ACCOUNT_USAGE.WAREHOUSE_METERING_HISTORY every 15 minutes, aggregates credit consumption per warehouse over the last 24 hours, and dispatches a formatted Slack alert the moment any warehouse breaks through the configured ceiling.
query_warehouse_credits (io.kestra.plugin.jdbc.snowflake.Query) connects to Snowflake over JDBC and fetches the top 10 warehouses by CREDITS_USED across the last 24 hours, including compute versus cloud-services breakdown.check_threshold (io.kestra.plugin.core.flow.If) evaluates whether any returned row has TOTAL_CREDITS_USED greater than inputs.credit_threshold.alert_slack (io.kestra.plugin.slack.notifications.SlackIncomingWebhook) fires a rich Slack message listing every offending warehouse with its credit total.log_ok (io.kestra.plugin.core.log.Log) records a clean-bill-of-health entry in the execution log.errors block fires a Slack alert if the Snowflake JDBC call itself fails (bad credentials, network timeout, permission denied on the view).Schedule trigger fires every 15 minutes and ships disabled so you can verify the flow before enabling continuous monitoring.Snowflake Tasks can schedule SQL but cannot evaluate results, branch on conditions, or fire webhooks. Kestra wraps the entire pipeline, JDBC query, conditional branching, Slack alerting, and failure recovery, in a single declarative YAML flow stored in Git. Secrets stay in the Kestra secret store; nothing is hardcoded. Execution history, logs, and outputs are always visible in the Kestra UI.
SELECT on SNOWFLAKE.ACCOUNT_USAGE.WAREHOUSE_METERING_HISTORY.SNOWFLAKE_PASSWORD: Password for the Snowflake user specified in inputs.username.SLACK_WEBHOOK: Slack incoming webhook URL.SNOWFLAKE_PASSWORD and SLACK_WEBHOOK to your Kestra namespace secrets.account, username, and optionally credit_threshold.Schedule trigger for continuous 15-minute monitoring.io.kestra.plugin.github.issues.Create in the then branch to open a FinOps tracking ticket automatically.postgres or bigquery table for long-term trend dashboards.Webhook trigger to evaluate on-demand after a large batch job completes.WAREHOUSE_NAME by adding a WHERE clause and an additional input.