Quick overview
This scheduled workflow reads your Supabase project’s live schema, uses Anthropic Claude to plan safe PostgREST queries from a plain-English requirement, computes the requested metrics, and sends a daily pulse email via SMTP with results or a clear “no matching data” notice.
How it works
- Runs every morning at 8am on a schedule.
- Fetches your Supabase REST OpenAPI schema and condenses it into a list of available tables and columns.
- Sends your plain-English reporting requirements and the live schema to Anthropic Claude to generate PostgREST metric queries.
- Validates the planned queries against the discovered schema, replaces time placeholders with real timestamps, and builds Supabase REST URLs.
- Executes each query against the Supabase REST API and calculates counts, sums, or top-group breakdowns from the returned rows.
- If results exist, asks Anthropic Claude to write a short headline/summary/insights and emails a formatted report via SMTP; otherwise, emails a not-found message listing skipped items.
Setup
- Add credentials for Supabase API, Anthropic (HTTP Header Auth using
x-api-key), and an SMTP account.
- In the Config step, set
supabaseUrl, reportEmail, fromEmail, brandName, windowHours, and your plain-English requirements.
- Ensure the Supabase REST API can see the tables referenced by your requirement (reload PostgREST schema if needed) and adjust the schedule time to your timezone before activating.
Requirements
- A Supabase project + Supabase API credential (host + service key)
- An Anthropic (Claude) API key
- An SMTP account (any provider — Brevo, Gmail, etc.)
Customization
- Rewrite the plain-English requirements in Config to report on anything
- Set windowHours (24 = day, 168 = week, 720 = month)
- Adjust schedule time/timezone; swap the Claude model
- Edit the email design in Build Email, or the planSystem/reportSystem prompts
Additional info
Zero DB setup — no functions, no Postgres connection. It reads your live schema, queries only tables that exist, safely skips anything missing, and sends a clear "not found" email instead of a blank report.