Every 6 hours
Get warned when your bill goes over budget
One message the first time this month's usage passes the amount you set, and no repeats until next month.
- Runs
- Every 6 hours
- Apps
- DigitalOcean
- AI
- Not needed
- Access
- billing:read
Send this to your assistant
Create a ClickRuntime automation: every 6 hours check my DigitalOcean month-to-date usage and send one Slack message to #infra when it passes $50 this month.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
Someone spins up a GPU Droplet for an experiment on a Thursday, and by Sunday the account has run up three days of charges nobody planned for. A personal project with a $50 budget can easily turn into $180 when a database cluster is left running. DigitalOcean's invoice shows the damage after the month ends, which is when it is too late to do anything but pay.
Every six hours the automation reads the account's month-to-date usage and compares it with the limit you picked, such as $50. The first time it crosses, you get an alert with the current figure; after that it stays quiet until the next month, so you are warned once instead of being nagged every six hours.
It is useful for hobbyists, students on credits, and teams whose projects have a fixed hosting allowance.
What you get out of it
The overrun stops at day three
A six-hour check means you learn about a runaway resource within hours. Deleting it then costs a few dollars rather than a month of charges, and that difference can be the entire cost of the experiment you were running.
Budget limits that are actually watched
A number written in a planning document does not stop anything. An alert that fires when the account crosses it gives that number some teeth, and it helps teams hold each other to a shared allowance without a monthly argument.
One alert, not a flood
Because it alerts once per month, the email still means something when it arrives. An inbox full of repeats trains people to ignore the warning, while the one email you get stays noticed because it is rare.
Protection for credit-funded accounts
If you are running on startup credits or a grant, a fast warning means you do not exhaust the credit before you notice. Credits are often the whole budget for a young project, and running out silently means a card on file.
Peace of mind for side projects
You can leave a personal Droplet running without wondering whether you will be billed an unpleasant amount, because the limit is watched for you. That freedom matters for hobby work that you only touch on weekends.
How it works
What happens, step by step
Every six hours ClickRuntime checks your DigitalOcean usage for the month so far.
It compares it with the amount you set.
The first time usage goes over, your Slack channel gets one message with the current total. You won't hear again until next month.
Before it runs live
- Connect DigitalOcean
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 DigitalOcean steps into one automation
Under the hood
The code that runs this automation
from datetime import date
from clickruntime import on_trigger, credentials, http, notify, state
DO = "https://api.digitalocean.com/v2"
def do(method, path, **kwargs):
resp = http.request(method, f"{DO}{path}", headers={"Authorization": f"Bearer {credentials.secret('DIGITALOCEAN_TOKEN')}"}, **kwargs)
resp.raise_for_status()
return resp.json() if resp.content else {}
THRESHOLD = 50
@on_trigger
def run(event):
usage = float(do("GET", "/customers/my/balance")["month_to_date_usage"])
month = date.today().strftime("%Y-%m")
if usage > THRESHOLD and state.get("alerted_month") != month:
notify.slack(f"DigitalOcean usage passed ${THRESHOLD}: ${usage:,.2f} so far in {month}", channel="#infra")
state.set("alerted_month", month)
return {"usage": usage}FAQ
Common questions
Does it stop or delete anything when the limit is passed?
Why check every six hours instead of continuously?
Can I set several thresholds, such as $50 and $100?
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
Snapshot your Droplets every night
Each Droplet gets a fresh snapshot overnight, snapshots older than your retention window are cleared, and you get an email listing what happened.
See how it worksGet your DigitalOcean spend by email each morning
A short email each day with your month-to-date usage and an estimate of yesterday's spend.
See how it worksSee which Droplets are running hot each week
A Monday email with average CPU, memory and disk use for every Droplet, with anything above your limit flagged.
See how it worksKeep exploring
Set up “Get warned when your bill goes over budget” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.