A nightly report from your app data: a Claude + Supabase + n8n stack
The struggle: You open your database every Monday to count users, and nobody trusts your manual numbers.
What you end up with: A scheduled message with the same counts every morning, from one agreed query, so the numbers stop moving.
Claude writes one read-only summary query for your Supabase data. n8n runs it on a schedule with its Postgres node and sends you the result. You test the query by hand first, and keep it aggregate only.
Tools: Claude, Supabase, n8n. Level: Pro. Time: 2 hours.
Use it if
- You count the same things by hand each week
- Your data is in Supabase
- You are the one who reads the report
Skip it if
- You need row-level detail of named people in the message
- You cannot keep the workflow private
The method
Define the numbers (Claude: Chat)
List the three to five numbers you report and what each means in words. Ask Claude to write one read-only query for each, using your table and column names, and to say how each could be miscounted.
Prompt to copy:
You are a data analyst. My Supabase Postgres tables and columns are: [paste schema, no data]. I report: [list numbers with definitions]. Write one read-only SELECT per number (counts and sums only, no personal data in the result), say what could double count, and give a test I can run by hand. If a definition is vague, ask. Never write UPDATE, DELETE or INSERT.
You get: A read-only query per number, with known pitfalls.
Tip: Define 'active user' in one sentence before anything else.
Test by hand (Supabase: SQL Editor)
Run each query yourself in the Supabase SQL Editor and compare the numbers with what you counted manually. Fix the definitions until you agree. Then create a database user that can only read, for n8n to use.
You get: Queries whose results you have checked.
Tip: Do not move on until the numbers match one hand count.
Schedule the run (n8n: Postgres node)
In n8n add a Schedule Trigger, set the interval, time and timezone in the workflow settings, then a Postgres node using the Execute Query operation with your queries and the read-only database credential. Add a step that sends the numbers to you. Save and publish, or the trigger will not run.
You get: A workflow that sends the report every morning.
Tip: The Supabase node only reads and writes rows, so use the Postgres node to run your own SELECT. Set the timezone in the workflow so it runs when you expect.
Add a plain summary (Claude: Chat)
Paste a week of reports and ask for a three-line summary that notes any change over 20 percent against the week before. Add it to your routine, or paste it by hand.
Prompt to copy:
Here are the last 7 nightly reports (counts only): [paste]. Write 3 lines: what changed, what looks unusual, and one thing to check in the data. Do not guess causes. If a number is missing, say so.
You get: A short note on what moved and what to check.
Tip: Treat the note as a prompt to look, not a diagnosis.
Where this goes wrong
- A database credential has broad power. Keep the n8n workflow private and the query read-only and aggregate only.
- Never paste keys or customer rows into a chat.
- If the workflow fails, the report simply does not arrive. Add a check on the day you expect it.
Swap a tool
- Zapier instead of n8n: Can also run on a schedule.
Sources
More like this
- Fix a broken app without breaking more
- A launch checklist with builder and database checks
- Check who can read your app's data
Updated . Written with AI help and checked by an independent review step, as described in our editorial standards.