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.
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
Every six hours ClickRuntime checks the storage size of each of your Neon projects.
It compares each one with the size you set.
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
Build your own
Need it to work differently?
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
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?
Can I set a different threshold per project?
How quickly will I hear about it?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Get a weekly Neon usage report
Each Monday you see compute hours and storage for every Neon project in one email.
See how it worksDelete old preview branches nightly
Preview branches past a set age are removed each night, and you get the list of what went.
See how it worksCreate a dated backup branch every night
Your main branch is copied to a dated branch each night, and only the last seven are kept.
See how it worksKeep exploring
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.