Schedule icon
Request icon
Return icon
Switch icon
Log icon
SlackIncomingWebhook icon

Render Deploy Failure Sentinel

Read a Render service's deploys every hour, change nothing, and alert Slack when the latest deploy failed, failures pile up or a deploy is stuck.

Categories
Infrastructure

On Render, a failed deploy does not take the service down: the previous version keeps serving traffic, the push to main looks done, and the failure only shows up as build_failed, pre_deploy_failed or update_failed on the service's Events page. The migration, the hotfix or the new endpoint the team is waiting for is simply not live. Auto-deploys that fail on every push, or a deploy that hangs on its pre-deploy command, are just as easy to miss. This blueprint turns a scheduled, read-only call to the Render API into a deploy health gate: io.kestra.plugin.core.http.Request reads the service's recent deploys, one jq query finds the latest result, the failure rate and deploys that are stuck, and the result routes to a quiet log or a Slack alert.

How it works

  1. list_deploys (io.kestra.plugin.core.http.Request) calls GET /v1/services/{serviceId}/deploys?limit=100&createdAfter=... with a bearer API key, which returns deploys created in the lookback window, each wrapped as {deploy, cursor}. It is a read: nothing is deployed, rolled back, suspended or restarted. Retries cover short network blips, and allowFailed plus allowFailure keep an API error from aborting the flow so it can be reported instead.
  2. summarize_deploys (io.kestra.plugin.core.debug.Return) first guards for a missing or non-200 response (UNREACHABLE). Otherwise one jq query treats live and deactivated (a deploy that went live and was later replaced) as successful, build_failed, update_failed and pre_deploy_failed as failed, and created, queued, build_in_progress, pre_deploy_in_progress and update_in_progress as in flight, flagging the ones older than stuck_minutes. canceled deploys are ignored. If the latest finished deploy failed, the check is CRITICAL; a failure rate at or above warning_failure_rate, or any stuck deploy, is WARNING; no finished deploy in the window is LOW_VOLUME; otherwise HEALTHY.
  3. route_by_deploys (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.
  4. log_audit_result (io.kestra.plugin.core.log.Log) writes one audit line per run with the HTTP status and the full summary.
  5. The flow-level errors block pages Slack if the flow itself fails, and the hourly_check trigger runs at 45 minutes past every hour, shipped disabled: true.

What you get

  • An hourly, read-only check of a Render service's deploys with no custom scripting and no extra plugin to install.
  • A status output (HEALTHY / WARNING / CRITICAL / LOW_VOLUME / UNREACHABLE) other flows can gate on, for example to hold a dependent release until the API really deployed.
  • Slack messages with the failed status, the trigger (new_commit, manual, deploy_hook, ...), the commit and the number of stuck deploys.
  • An audit line on every run, separate from Slack.

Who it's for

  • Teams running web services, workers and cron jobs on Render with auto-deploy from Git.
  • Platform engineers who own several Render services, one execution per service ID.
  • Teams that already run their release and alerting workflows in Kestra.

Why orchestrate this with Kestra

Render can notify on deploy events, but it does not tell you that the latest deploy is still failed an hour later, that half of today's pushes failed, or that a deploy has been running its pre-deploy command for 30 minutes. Kestra turns a plain, read-only API call into a scheduled, typed classification with retries, a failure path and an execution history, and the same flow runs against any number of services by changing service_id.

Prerequisites

  • A Render service and an API key from Account Settings > API Keys (the key acts with the permissions of its user).
  • The service ID (srv-...) from the service URL or its Settings page.
  • A Slack incoming webhook for the WARNING, CRITICAL, UNREACHABLE and flow-failure alerts.

Secrets

  • RENDER_API_KEY: a Render API key for a user with access to the service.
  • 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_RENDER_API_KEY=$(echo -n 'your-render-api-key' | base64), and read back with {{ secret('RENDER_API_KEY') }}. Use the Enterprise secrets backend for encryption at rest and access control.

Quick start

  1. Add RENDER_API_KEY and SLACK_WEBHOOK as secrets.
  2. Set service_id and run the flow manually; compare the counts and the latest deploy in the logs with the service's Events page.
  3. Push a commit that fails the build to a branch the service auto-deploys from (or a staging service) to see a failure counted, then revert it.
  4. Enable hourly_check.

How to extend

  • Loop over several services with io.kestra.plugin.core.flow.ForEach and one service_id per item.
  • Add the status query parameter to read only failed deploys over a longer window.
  • Store the ID of the last failed deploy in a KV store and alert only on new failures.
  • Trigger a redeploy or a rollback through the Render API from a separate, approved flow when the latest deploy failed.

Inputs

  • service_id: type STRING, default srv-your-service-id.
  • lookback_hours: type INT, default 24.
  • warning_failure_rate: type FLOAT, default 20.0 (percent).
  • stuck_minutes: type INT, default 30.

Outputs

  • status: one of HEALTHY, WARNING, CRITICAL, LOW_VOLUME, UNREACHABLE.
  • Example path: {{ fromJson(outputs.summarize_deploys.value).latest }} for the latest finished deploy.

Links

Pitfalls

  • The latest result is judged inside the lookback window only; a service with no finished deploy in the window reports LOW_VOLUME even if an older deploy failed.
  • At most 100 deploys are read; follow cursor for more.
  • A service whose deploys are all canceled (for example because a newer push superseded them) is LOW_VOLUME, since canceled deploys are not judged.
  • This flow only reads; it never triggers a deploy, rolls back, suspends or restarts the service.
See How

New to Kestra?

Use blueprints to kickstart your first workflows.