Skip to content

Every 5 minutes

Log outages in Supabase and get a diagnosis

When a site you watch fails, an incident row is written and you get an email with a short explanation of the likely cause.

Runs
Every 5 minutes
Apps
Supabase
AI
Yes, uses the built-in AI allowance
Access
secret key (write)

Send this to your assistant

Create a ClickRuntime automation: every 5 minutes check example.com, app.example.com and api.example.com/health. If one fails, add a row to my Supabase incidents table and email me what probably went wrong.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

A solo founder runs a web app and a handful of background jobs. When the site goes down at 2 a.m. or a nightly import throws an exception, nothing tells them until a customer writes in. Even then, the cause is a guess: was it the database, a deploy or a third-party API? Without a record of when it started and ended, the post-mortem is based on memory.

Every five minutes, ClickRuntime checks the URLs you list, or receives an error payload from a job, and inserts an incident row into Supabase. It then passes the text to ClickRuntime's built-in AI to suggest a likely cause from the error text and status code, sends the alert by email or Slack and logs the recovery time once the site responds again.

It suits indie developers and small teams who want monitoring and a history without paying for a full observability tool.

What you get out of it

  • Outages are noticed in minutes

    A five-minute check means a crash at 2 a.m. reaches your phone before the morning rush. Shortening downtime protects revenue and reputation, particularly for apps that customers rely on for their own work.

  • A first diagnosis arrives with the alert

    The AI note, such as a likely expired certificate or a database connection limit, gives you something to try before you open a laptop. Starting from a hypothesis shortens the time to a fix.

  • Every incident is stored in your own database

    Rows with start time, end time, status and error text build an incident history you can query. Counting last quarter's outages or averaging recovery time becomes a simple SQL query.

  • Uptime can be demonstrated to customers

    When a client asks how reliable your service is, you have real numbers rather than a guess. A log of incidents with durations supports honest answers and service level discussions.

  • Failed jobs are caught as well as websites

    Because jobs can post their own errors, a silent failure of an import or an email batch is no longer silent. Problems that never show up on a status page still get logged and reported.

How it works

What happens, step by step

  1. Every five minutes ClickRuntime checks the sites you list, or your app reports an error to it directly.

  2. When a check fails, it writes an incident row to your Supabase table.

  3. AI reads the error and writes a short explanation of the likely cause.

  4. You get an email or Slack message with the address, the error and that explanation. When the site comes back, the recovery is logged too.

Before it runs live

  • Connect Supabase

What you get

RunsEvery 5 minutes
Log outages in Supabase and get a diagnosistoday, 9:00Succeeded
Email · DowntimeDOWN: https://api.example.com/health HTTP 502: Bad Gateway The upstream app server is likely not responding, often after a crash or a deploy that failed to start.

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Run it at a different time, more or less often, or only on weekdays
  • Change what the AI looks for, or how it writes the result
  • Add another app, for example also send it to Slack
  • Combine it with other Supabase steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
log_errors_or_downtime_and_alert_me.pyexample
from clickruntime import on_trigger, credentials, http, notify, state, ai

SUPABASE_URL = "https://your-project.supabase.co"

def sb_headers(**extra):
    key = credentials.secret("SUPABASE_SECRET_KEY")
    return {"apikey": key, "Authorization": f"Bearer {key}", **extra}

URLS = ["https://example.com", "https://app.example.com", "https://api.example.com/health"]

@on_trigger
def run(event):
    down = state.get("down") or {}
    for url in URLS:
        try:
            resp = http.get(url, timeout=10)
            problem = None if resp.ok else f"HTTP {resp.status_code}: {resp.text[:300]}"
        except Exception as e:
            problem = f"{type(e).__name__}: {e}"
        if problem and url not in down:
            row = http.post(f"{SUPABASE_URL}/rest/v1/incidents", json={"url": url, "error": problem},
                            headers=sb_headers(Prefer="return=representation")).json()[0]
            cause = ai.generate(f"{url} failed with: {problem}", system="In two sentences, say what probably went wrong.",
                                max_output_tokens=120).text
            notify.email_me(f"DOWN: {url}", f"{problem}\n\n{cause}")
            down[url] = row["id"]
        elif not problem and url in down:
            http.patch(f"{SUPABASE_URL}/rest/v1/incidents", params={"id": f"eq.{down.pop(url)}"},
                       json={"resolved_at": "now()"}, headers=sb_headers())
            notify.email_me(f"RECOVERED: {url}", "The check is passing again.")
    state.set("down", down)
    return {"down": list(down)}

FAQ

Common questions

How does it detect that my site is down?
It requests each URL you list and treats a timeout, a connection error or a 5xx status code as a failure. You can add a content check, such as a word that must appear on the page, to catch cases where the server returns a 200 with an error page.
Does the AI diagnosis always get the cause right?
No. It reads the status code and error text and offers a likely cause, which is a starting point, not a verdict. It is useful for common issues like expired certificates, rate limits or full disks, and you should still confirm in your logs.
How is a recovery recorded?
When a later check succeeds after a failure, the incident row gets an end time and a duration, and you can receive a recovered message. That gives you the length of each outage and a clean record for reviews.
What permissions does it need?
secret key (write). Nothing else in your accounts is used.
Does it need AI?
Yes. It uses ClickRuntime's built-in AI, so you don't need an OpenAI or Anthropic key. Every plan includes a monthly AI allowance.
How many runs does it use?
One run each time it runs (every 5 minutes). Checks that find nothing to do and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Log outages in Supabase and get a diagnosis” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.