Skip to content

Every 6 hours

Get a warning before storage runs out

You get one alert when a project's storage passes the size you set, not a repeat every check.

Runs
Every 6 hours
Apps
Neon
AI
Not needed
Access
read

Send this to your assistant

Create a ClickRuntime automation: every 6 hours, check the storage size of each Neon project and send me one Slack message in #infra when any passes 400 MB.

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 Neon project that fills up does not announce itself. Free and lower plans have storage limits, and a data import, a runaway logging table or a few large branches can close the gap in days. When the limit is reached, writes start failing and your app throws errors, and the fix has to be made under pressure with the on-call developer wondering which table grew.

Every six hours ClickRuntime lists your Neon projects with their synthetic storage size, compares each against the threshold you set, such as 80 percent of your allowance, and sends one alert when a project crosses it. It will not send the same warning again until the size drops back under the line.

It is most useful for solo developers and small teams who do not have database monitoring set up yet.

What you get out of it

  • Warning arrives before writes fail

    A message at 80 percent leaves room to act. You have days to archive data or upgrade, rather than minutes after your app starts erroring. You have days to archive data or upgrade, which is far better than minutes.

  • Growth causes are easier to find

    An alert tied to the project and its current size points to when the jump happened. A bulk import on Tuesday is easier to find than a mystery after the fact.

  • Upgrades are a decision, not a panic

    Seeing the trend gives time to compare plans and pick one calmly. You avoid paying for an emergency upgrade chosen in a rush. You compare plans calmly, with the growth trend in front of you.

  • No repeated warnings

    Alerting once per crossing keeps the message meaningful. The notification returns only if the project grows past the line again after dropping below it. The notification returns only if the project grows past the line again.

  • Protection for forgotten projects

    A staging database nobody checks can fill silently. The check covers every project in the account, so a small experiment is watched as closely as production. Every project in the account is watched, so experiments get the same attention as production.

How it works

What happens, step by step

  1. Every six hours ClickRuntime checks the storage size of each of your Neon projects.

  2. It compares each one with the size you set.

  3. When a project first goes over, your Slack channel gets one message with its current size, not a repeat every check.

Before it runs live

  • Connect Neon

What you get

RunsEvery 6 hours
Get a warning before storage runs outtoday, 9:00Succeeded
Slack · #infraNeon storage over 400 MB acme-api: 418 MB

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
  • Add an AI step, for example to summarize, sort or draft a reply
  • Add another app, for example also send it to Slack
  • Combine it with other Neon 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.
get_alerted_when_storage_passes_a_threshold.pyexample
from clickruntime import on_trigger, credentials, http, notify, state

NEON = "https://console.neon.tech/api/v2"

def neon(method, path, **kwargs):
    resp = http.request(method, f"{NEON}{path}", headers={"Authorization": f"Bearer {credentials.secret('NEON_API_KEY')}"}, **kwargs)
    resp.raise_for_status()
    return resp.json()

LIMIT_MB = 400

@on_trigger
def run(event):
    alerted = set(state.get("alerted") or [])
    over = []
    for p in neon("GET", "/projects")["projects"]:
        mb = p.get("synthetic_storage_size", 0) / 1e6
        if mb > LIMIT_MB and p["id"] not in alerted:
            over.append(f"{p['name']}: {mb:,.0f} MB")
            alerted.add(p["id"])
    if over:
        notify.slack(f"Neon storage over {LIMIT_MB} MB\n" + "\n".join(over), channel="#infra")
    state.set("alerted", list(alerted))
    return {"over": over}

FAQ

Common questions

What is synthetic storage size?
It is the logical data size Neon reports for a project, which includes the data across branches in a way that approximates what counts toward limits. The check uses that figure from the API. It is a good basis for a threshold of your own.
Can I set a different threshold per project?
Yes. A production project might warn at 70 percent while a scratch project warns at 95. Give the numbers per project, or one default for all, and the check compares each project against its own.
How quickly will I hear about it?
The check runs every six hours, so the alert comes within six hours of crossing the line. For fast-growing databases, ask for a shorter interval such as hourly. That interval is a setting, so you can tighten it for risky projects.
What permissions does it need?
read. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run each time it runs (every 6 hours). 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 “Get a warning before storage runs out” from your assistant

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