Schedule a Weekly AI Generated Cost and Performance Report
For Data Engineers ·
What This Builds
Cost review is the task everyone agrees matters and nobody owns pulling together, so it gets skipped, and a skipped review compounds into a bigger bill three months later. This build pulls warehouse cost and query performance data every Monday morning, hands it to an AI step for a written summary with outliers flagged, and drops it in Slack before your first meeting. The report exists whether or not anyone had time to ask for it that week.
Prerequisites
- Comfortable writing and reading SQL against your warehouse's cost and query history tables (most warehouses expose these as system views)
- Read access to your warehouse's usage or billing views, and a Slack channel to post into
- A Make account on a paid plan (check Make's pricing page for current tiers): Sign up. A scheduled scenario with a data module and an AI module fits within most paid tiers
- A ChatGPT API key or equivalent for the summarization step. Billed per token, typically a small fraction of a cent per weekly run, but set an org-level spend cap so a runaway scenario cannot rack up charges unnoticed
- Total ongoing cost: your Make plan plus metered API usage for the AI summary step, both modest for a once-a-week run
The Concept
A scheduled Make scenario works like a standing Monday meeting that never gets rescheduled. Every week at the same time, it pulls the same numbers, in the same order, and writes them up the same way. The AI step is the analyst who reads the raw numbers and writes the two-paragraph summary so you do not have to stare at a spreadsheet before coffee. You still make the actual decisions. It just makes sure the numbers are on your desk to decide from.
Build It Step by Step
Part 1: Set the schedule and pull the data
- In Make, create a new scenario and set the first module to a Schedule trigger: every Monday at whatever hour works for your team, before the weekly sync if you have one.
- Add a warehouse module (Snowflake, BigQuery, or Redshift each have Make connectors, or use an HTTP > Make a request module against your warehouse's query API with a read-only service account) to run a query against the cost/usage view and the query history view. Use a service account scoped to read-only access on those specific system views. It should not have write access to production tables, and it should not be the same credential a human engineer logs in with day to day.
- If your warehouse does not expose a clean API for this, run the queries in a scheduled dbt or SQL job first and have Make pull the output from wherever that job lands (a table, a CSV in cloud storage).
Part 2: Format and summarize
- Add a Text Aggregator or Array Aggregator module to flatten the query results (top N most expensive queries, week-over-week compute cost, any credit usage above your normal baseline) into a single text block.
- Add an AI module (ChatGPT connector, or an HTTP module calling the API directly) with this prompt, substituting your actual field names:
You are summarizing weekly warehouse cost and query performance data for a data engineering team. You will receive raw numbers: total compute cost, cost change from the prior week, the top 5 most expensive queries with their cost and runtime, and any queries that ran meaningfully slower than their historical average. Write a summary with three sections: Overview (2-3 sentences on total cost and trend direction), Outliers (bulleted list of anything unusual, with numbers), Worth a Look (1-3 items that seem worth investigating, stated as questions, not conclusions). Use only the numbers provided. Do not estimate or round in a way that changes the meaning of a figure.
Part 3: Deliver and check
- Add a Slack module to post the summary to your team's channel, formatted with the raw numbers included underneath so nobody has to take the AI's word for it.
- Run the scenario manually against last week's real data before turning on the schedule, and compare the summary's Outliers section against what you already knew was unusual. Do this again for the first two or three scheduled runs. If it consistently misses a cost spike you'd have caught by eye, adjust which numbers you're feeding it.
Real Example: A Snowflake warehouse cost review
Setup: Monday 7am Make scenario pulls the prior week's Snowflake WAREHOUSE_METERING_HISTORY and QUERY_HISTORY views through a read-only service account.
Input: Total compute cost for the week, a 22% increase over the prior week, and the five most expensive queries, one of which is a new dbt model doing a full table scan on a 400 million row events table instead of using a date filter.
Output: A Slack message with an Overview noting the 22% week-over-week increase, an Outliers section pointing at the full-scan query by name and cost, and a Worth a Look item asking whether the new model should use an incremental materialization instead of a full refresh.
Time saved: Turns a review that got skipped most weeks (nobody had 1 to 2 hours to pull and read the numbers) into a five-minute Slack read every Monday.
What to Do When It Breaks
- Scenario stops running and the Monday report just does not show up → This is the failure you will not notice unless you look for it. Turn on Make's scenario error notifications so a failed run emails or Slacks you directly, and separately, put a recurring reminder on your own calendar to glance at the last run's history once a month.
- Summary flags a "22% increase" that does not match the dashboard → Check the date range logic in the Schedule/data-pull step first. Off-by-one week ranges are the most common cause of a summary that technically ran but summarized the wrong period.
- AI summary is vague or restates the numbers without saying anything useful → Tighten the prompt to require at least one specific number in every bullet, and consider trimming the raw data down to the top 5 to 10 rows instead of dumping the entire query history, which can bury the real signal.
- Service account credential expires or gets revoked → The scenario fails silently from Make's side (it just errors on the data-pull step) unless you have error notifications on. Rotate the service account credential on a schedule and note the rotation date somewhere your team can see it.
Variations
- Simpler version: Skip the AI summarization step and just post the raw top-5-queries table to Slack every Monday. Less useful for spotting trends, but zero risk of a summary misreading a number.
- Extended version: Add a second AI step that drafts a short recommendation (which query to optimize first) based on the outliers, and route it to whoever owns that model for a first look.
What to Do Next
- This week: Run it manually against two or three past weeks of data to see how well the Outliers section matches what you already know went wrong.
- This month: Add a threshold check (if week-over-week cost jumps more than a set percentage, tag the message as urgent instead of routine) so the report earns attention when it matters most.
- Advanced: Pair this with the "Chain a Vendor API Changelog Watcher That Drafts Impact Notes" build so a sudden cost spike and a vendor API change that happened the same week show up next to each other.
Advanced guide for Data Engineer professionals. These techniques use more sophisticated AI features that may require paid subscriptions.