Weekly Upstash inventory and spend log in Google Sheets

By General Input

Every Monday at 7am, every database and index in your Upstash account lands in a spreadsheet with its size, usage and cost, so you keep a history you can chart.

Integrations

  • Upstash
  • Google Sheets

Type

Deterministic Code

Categories

  • Engineering
  • Operations

Every Monday at 7am, take a point in time inventory of my entire Upstash account and append it to a Google Sheet, so I keep a cost and capacity trend that outlives what the Upstash console retains.

Start by enumerating every resource in the account. Use the Upstash List Redis Databases operation to get every Redis database, and List Vector Indices to get every Vector index. Then, for each Redis database returned, call Get Redis Database Stats to pick up its current usage: current_storage, total_monthly_requests, total_monthly_bandwidth and total_monthly_billing.

Write one row per resource into the sheet using Google Sheets Append Values, with this exact column order on every run: run date, resource type, name, region, plan or tier, storage, monthly requests, monthly bandwidth, monthly billing. Resource type is either redis or vector. The run date is the date the workflow executes, and it is the same value on every row of a given run so each week's batch can be grouped.

Redis databases and Vector indexes come back with different shapes, so use this one shared column set and leave a blank where a field does not apply. The stats call is Redis only, so vector rows carry the run date, resource type, name, region and tier taken from the index listing, and leave storage, monthly requests, monthly bandwidth and monthly billing blank. Never reorder or rename the columns between runs. The entire point is that appended rows line up into a trend I can chart.

Finish each run with a single totals row: the run date, the word TOTAL in the resource type column, and the account wide sums for storage, monthly requests, monthly bandwidth and monthly billing across every Redis database. Leave name, region and plan blank on that row so it is easy to filter the totals apart from the per resource rows.

Append using the value input option that parses entries the way typed input is parsed, so the run date lands as a real date and the usage and cost figures land as numbers rather than text, and the columns stay chartable without cleanup. Only ever append. Do not overwrite, clear or rewrite existing rows, so every week stacks onto the bottom of the history.

This is a straight list, format and append with no judgement required, so build it as a deterministic workflow. If the account has no resources at all, still append the totals row with zeros, so the weekly record has no gaps.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentLocal listing health board for every location you manageLet support send one-off Loops emails without an engineerStop cold emails to anyone with a live deal in PipedriveiMessage campaign console with pre-flight checks and delivery boardLinkedIn Ads budget pacing dashboard for every client accountFront desk appointment confirmation board for the next 3 daysGive your team Looker numbers without buying more seatsBuild audience segments from product usage and push to LoopsTurn the people who engage with your posts into Pipedrive leads