New to Kestra?
Use blueprints to kickstart your first workflows.
Check Appwrite database, cache, and clock health and alert Slack when a subsystem degrades.
Appwrite ships its own /health endpoints specifically so operators can validate every internal subsystem without guessing from application-level errors. This blueprint calls three of them on a schedule, classifies the backend as healthy or degraded, and pages Slack the moment the database connection fails, the cache connection fails, or the server clock drifts too far from a trusted time source.
check_database_health (io.kestra.plugin.core.http.Request) calls GET /health/db with the project's API key, returning {name, ping, status} where status is pass or fail.check_cache_health calls GET /health/cache the same way, checking the in-memory cache connection.check_clock_drift calls GET /health/time, returning {remoteTime, localTime, diff} where diff is the millisecond difference between the Appwrite server's clock and a trusted remote time source. All three tasks use allowFailure: true so a single unreachable endpoint does not abort the flow before classification.classify_backend_health (io.kestra.plugin.core.debug.Return) checks whether all three response bodies are defined; if not, UNREACHABLE. Otherwise it reads each status field and the absolute value of diff with jq, returning DEGRADED if the database check failed, the cache check failed, or the clock drift exceeds clock_drift_threshold_ms, otherwise HEALTHY.route_by_backend_health (io.kestra.plugin.core.flow.Switch) branches on that string: HEALTHY logs a quiet confirmation, DEGRADED pages Slack with the exact failing subsystem(s) and drift value, UNREACHABLE pages Slack separately, and defaults logs the raw outcome.log_audit_status records a status line on every run regardless of branch, so the execution history is a continuous backend-health trend.errors block pages Slack separately if the flow itself fails outright.backend_health_schedule trigger polls every 10 minutes with explicit input overrides, shipped disabled: true until you point it at a real Appwrite project.status output (HEALTHY / DEGRADED / UNREACHABLE) you can chart or gate other flows on.Hitting /health/db from an uptime monitor tells you pass or fail with no history. This flow keeps every probe, every classification, and every alert in the execution history, turns the check into a typed output other flows can depend on, and gives you a Switch branch to grow into real remediation (restarting a specific worker container, opening a ticket per failing subsystem) without rewriting the check itself.
appwrite_url. The free, official Docker Compose setup (docker run -it --rm appwrite/appwrite:latest, which generates the full docker-compose.yml) is enough to fully test this blueprint locally.APPWRITE_API_KEY: Appwrite server API key with the Health scope, sent as the X-Appwrite-Key header.SLACK_WEBHOOK_URL: Slack incoming webhook used for the degraded alert, the unreachable alert, and the flow-failure alert.SECRET_APPWRITE_API_KEY and SECRET_SLACK_WEBHOOK_URL as base64, for example echo -n "<your-value>" | base64.APPWRITE_API_KEY and SLACK_WEBHOOK_URL secrets.appwrite_url and project_id to your Appwrite instance and project.status reads HEALTHY.backend_health_schedule.GET /health/storage and GET /health/pubsub as two more probe tasks for a full subsystem sweep instead of just database, cache, and clock.GET /health/queue/webhooks and GET /health/queue/certificates to also catch a backlogged internal queue before it delays webhooks or certificate renewal.diff value in a KV store to build a longer clock-drift trend than the execution history alone provides.