Skip to content

Weekly

Track what Atlas is costing this month

Once a week you see the running total of your pending Atlas invoice and its biggest line items.

Runs
Weekly
Apps
MongoDB
AI
Not needed
Access
Organization Billing Viewer

Send this to your assistant

Create a ClickRuntime automation: every Friday, email me my MongoDB Atlas pending invoice total for this month and the five largest line items.

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

Atlas bills usage across clusters, data transfer, backups and extras like Atlas Search, and the total only becomes clear when the invoice is issued. A developer who scaled a cluster to M30 for a load test and forgot to scale it back sees the cost on the first of next month. Founders and finance leads then ask why the database line grew 40 percent, and nobody can say which item caused it.

On a weekly schedule ClickRuntime fetches the pending invoice for your Atlas organization, reads the running total and the line items, and emails them. You see the month so far, with each cluster and charge type, while there is still time to change something.

Finance contacts and engineering leads who share responsibility for infrastructure spend usually receive it.

What you get out of it

  • Surprises are caught mid-month

    Seeing the total in week two rather than after billing lets you act on the oversized cluster. A forgotten M30 costs about a week of fees to find, not a month.

  • Line items explain the cost

    The email lists charges by type, such as cluster compute, backup storage and data transfer. You know which one grew, which turns a vague complaint into a specific fix. Knowing which charge grew, such as backup storage or data transfer, turns a vague complaint into a specific fix.

  • Finance sees it without logging in

    Bookkeepers and founders get the figures without an Atlas account or role. That avoids granting billing access just so someone can check a number. Bookkeepers and founders see the figures without needing an Atlas account, and nobody has to hand out billing roles just for a number.

  • Budget tracking becomes routine

    A weekly figure builds an easy running history of spend. Comparing week three of this month with last month shows whether you are on track. Comparing week three of this month with week three of last month shows whether you are on track.

  • Fewer end-of-month arguments

    When everyone has seen the cost growing, the invoice is expected. Discussions move to whether the spend is worth it, not who is to blame. Discussion moves to whether the spend is worth it, because everyone has watched it build.

How it works

What happens, step by step

  1. Every week ClickRuntime gets your MongoDB Atlas invoice for the current month so far.

  2. It reads the running total and the biggest line items.

  3. Both arrive in your inbox, so the end-of-month bill isn't a surprise.

Before it runs live

  • Connect MongoDB

What you get

RunsWeekly
Track what Atlas is costing this monthtoday, 9:00Succeeded
Email · Atlas invoiceAtlas pending invoice: $412.60 orders-cluster ATLAS_AWS_INSTANCE_M30: $298.40

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 MongoDB 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_a_monthly_invoice_summary.pyexample
from clickruntime import on_trigger, credentials, http, notify

from requests.auth import HTTPDigestAuth

ATLAS = "https://cloud.mongodb.com/api/atlas/v2"

def atlas(path, **params):
    auth = HTTPDigestAuth(credentials.secret("ATLAS_PUBLIC_KEY"), credentials.secret("ATLAS_PRIVATE_KEY"))
    resp = http.get(f"{ATLAS}{path}", auth=auth, params=params, headers={"Accept": "application/vnd.atlas.2024-08-05+json"})
    resp.raise_for_status()
    return resp.json()

ORG_ID = "your-atlas-org-id"

@on_trigger
def run(event):
    invoice = atlas(f"/orgs/{ORG_ID}/invoices/pending")
    items = sorted(invoice.get("lineItems", []), key=lambda li: -li["totalPriceCents"])[:5]
    lines = [f"{li.get('clusterName') or '-'} {li['sku']}: ${li['totalPriceCents'] / 100:,.2f}" for li in items]
    notify.email_me(f"Atlas pending invoice: ${invoice['amountBilledCents'] / 100:,.2f}", "\n".join(lines))
    return {"total": invoice["amountBilledCents"] / 100}

FAQ

Common questions

Does it show a forecast for the whole month?
It shows what Atlas reports on the pending invoice, which is charges to date. It is not a projection, though you can compare with last month's final total to see how far along you are.
What access does the API key need?
Billing data requires an organization-level key with an Organization Billing Viewer or Billing Admin role. Store it as a secret. Keys limited to a single project cannot see invoices. Billing visibility requires the organization-level role, which is separate from project access.
Does it handle several organizations or currencies?
It reads one organization per key, in the currency that organization is billed in. For a second organization, add its own key and the email will list each separately, so totals are not mixed. A second organization needs its own key and is listed in a separate section of the email.
What permissions does it need?
Organization Billing Viewer. 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 (weekly). 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 “Track what Atlas is costing this month” from your assistant

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