Snowflake Cost Anomaly Detector and FinOps Alerting
Monitor daily Snowflake credit consumption, compare with rolling 7-day baselines, detect cost spikes, and alert FinOps via Slack.
Read recent WooCommerce orders every hour, change nothing, and alert Slack when checkout failures spike or paid orders sit unshipped.
A WooCommerce store can break quietly: a payment gateway plugin update, an expired API key or a bank outage turns checkouts into failed orders, and paid orders can sit in processing because nobody picked them. The store owner usually notices from an angry customer. This blueprint turns a scheduled, read-only call to the WooCommerce REST API into a store health gate: io.kestra.plugin.core.http.Request reads the newest orders, one jq query works out the failed share of checkout attempts, the worst payment method and the paid orders stuck in processing, and the result routes to a quiet log or a Slack alert.
list_orders (io.kestra.plugin.core.http.Request) calls GET /wp-json/wc/v3/orders for the 100 newest orders, using HTTP basic auth with the REST API consumer key and secret over HTTPS. WooCommerce applies after in the store's own time zone, so the request asks for an extra 24 hours and the exact window is applied on date_created_gmt in the next step. It is a read: no order is changed.summarize_orders (io.kestra.plugin.core.debug.Return) first guards for a missing or non-200 response (UNREACHABLE). Otherwise one jq query keeps orders created in the last lookback_hours (UTC), treats failed, processing, on-hold, completed and refunded as checkout attempts (pending and cancelled are usually abandoned checkouts), computes the failed share and the payment method with the worst share, and counts processing orders older than max_processing_hours. With at least min_attempts attempts, a failure rate at or above critical_failure_rate is CRITICAL; at or above warning_failure_rate, or any stuck order, is WARNING; too few attempts is LOW_VOLUME; otherwise HEALTHY.route_by_order_health (io.kestra.plugin.core.flow.Switch) branches on that classification: HEALTHY and LOW_VOLUME log quietly, WARNING posts a Slack note, CRITICAL and UNREACHABLE page Slack. A defaults fallback logs anything unexpected.log_audit_result (io.kestra.plugin.core.log.Log) writes one audit line per run with the HTTP status and the full summary.errors block pages Slack if the flow itself fails.hourly_check trigger runs at quarter past every hour and ships disabled: true.status output (HEALTHY / WARNING / CRITICAL / LOW_VOLUME / UNREACHABLE) other flows can gate on, for example to pause ads while checkout is broken.WooCommerce emails the admin per failed order, which is easy to ignore and says nothing about a rate. Kestra turns a plain, read-only REST call into a scheduled, typed classification with retries, a failure path and an execution history, and one flow per store keeps an agency's whole portfolio in one place.
/wp-json/).WOOCOMMERCE_STORE_URL: the store's base URL, for example https://shop.example.com, without a trailing slash.WOOCOMMERCE_CONSUMER_KEY: the REST API consumer key (ck_...).WOOCOMMERCE_CONSUMER_SECRET: the REST API consumer secret (cs_...).SLACK_WEBHOOK: Slack incoming webhook used for every alert branch and the flow-failure alert.In Kestra OSS, secrets are supplied as environment variables prefixed SECRET_ and base64-encoded, for example SECRET_WOOCOMMERCE_STORE_URL=$(echo -n 'https://shop.example.com' | base64), and read back with {{ secret('WOOCOMMERCE_STORE_URL') }}. Use the Enterprise secrets backend for encryption at rest and access control.
wordpress Docker image plus the WooCommerce plugin), enable pretty permalinks and create Read-only REST API keys.docker network connect YOUR_KESTRA_NETWORK <wordpress_container>.min_attempts and check status.hourly_check.page parameter when more than 100 orders arrive in the window.GET /wp-json/wc/v3/system_status to alert on outdated templates or a failing cron.lookback_hours: type INT, default 48.warning_failure_rate: type FLOAT, default 10.0 (percent).critical_failure_rate: type FLOAT, default 25.0 (percent).min_attempts: type INT, default 10.max_processing_hours: type INT, default 24.status: one of HEALTHY, WARNING, CRITICAL, LOW_VOLUME, UNREACHABLE.{{ fromJson(outputs.summarize_orders.value).stuck_processing }} for the number of stuck paid orders.lookback_hours + 24 hours needs paging, and stuck-order detection only sees orders inside that page./wp-json/ or strip the Authorization header; that shows up as UNREACHABLE with HTTP 401 or 403.processing until delivery will see them as stuck; raise max_processing_hours or exclude that method in the jq query.