Weekly
See your estimated Railway spend each week
Every Monday you get an email with each project's estimated usage so far this month.
- Runs
- Weekly
- Apps
- Railway
- AI
- Not needed
- Access
- workspace token
Send this to your assistant
Create a ClickRuntime automation: every Monday at 8am, email me the estimated usage for this month for each project in my Railway workspace.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
Railway bills for what your services use, so a runaway process, a chatty database or a service left running in a forgotten project can raise the invoice without any warning. Most people find out when the monthly charge arrives and is double what they expected, with only a usage graph to work out why.
Every week, ClickRuntime queries Railway's GraphQL API for your current usage, covering CPU, memory, network and volume storage, and emails you an estimate of what the month will cost at the current pace. You can see which projects and services drive the cost, and compare week to week.
It is most useful for indie developers and small teams who pay the bill themselves, and for anyone who wants no surprises when the monthly invoice from Railway arrives.
What you get out of it
The bill is never a surprise
Seeing an estimate midway through the month lets you act before the charge lands. If the projected number is higher than you budgeted, you still have weeks to change something.
Costly services are named
The breakdown shows which service is responsible for most of the spend. A background worker using constant memory is far easier to fix once you know it is the source.
Waste from forgotten projects is exposed
Experimental projects and old staging environments keep running unless someone shuts them down. A weekly list of usage includes them, which prompts you to delete what you no longer need.
Pricing decisions have real data
If you charge customers for something running on Railway, your cost per customer matters. Weekly estimates show how infrastructure costs track with growth, informing price changes. It keeps margins from eroding unnoticed.
Early detection of runaway usage
A loop that makes constant requests or a memory leak shows up as an unusual week-over-week jump. Catching that on a Monday is cheaper than catching it after a month of charges.
How it works
What happens, step by step
Every Monday, ClickRuntime asks Railway for each project's estimated usage so far this month.
It reads the figures for CPU, memory, network traffic and disk.
You get one email with a line per project, so you can see where your Railway bill is heading before the month ends.
Before it runs live
- Connect Railway
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 Railway steps into one automation
Under the hood
The code that runs this automation
from clickruntime import on_trigger, credentials, http, notify
GQL = "https://backboard.railway.com/graphql/v2"
MEASURES = "[CPU_USAGE, MEMORY_USAGE_GB, NETWORK_TX_GB, DISK_USAGE_GB]"
def gql(query, token):
resp = http.post(GQL, json={"query": query}, headers={"Authorization": f"Bearer {token}"})
resp.raise_for_status()
return resp.json()["data"]
@on_trigger
def run(event):
token = credentials.secret("RAILWAY_TOKEN")
projects = gql("{ projects { edges { node { id name } } } }", token)["projects"]["edges"]
lines = []
for p in projects:
node = p["node"]
est = gql('{ estimatedUsage(projectId: "%s", measurements: %s) { measurement estimatedValue } }'
% (node["id"], MEASURES), token)["estimatedUsage"]
parts = ", ".join(f"{e['measurement'].lower()}: {e['estimatedValue']:.1f}" for e in est)
lines.append(f"{node['name']}: {parts}")
notify.email_me("Railway estimated usage this month", "\n".join(lines))
return {"projects": len(projects)}FAQ
Common questions
How accurate is the estimate?
Does it include the cost of my team's other workspaces?
What happens if my plan has included usage credit?
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
Restart a Railway service every night
Your service gets a fresh restart at a quiet hour, and you only hear about it if the restart fails.
See how it worksGet a Friday log of this week's deployments
At the end of the week you see every deployment in the project with its status, plus a count of how many succeeded and failed.
See how it worksGet an email when a Railway deploy fails or crashes
As soon as a deployment in your project fails or crashes, an email tells you which service and what happened.
See how it worksKeep exploring
Set up “See your estimated Railway spend each week” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.