πŸ“Š Send adaptive daily Supabase product pulse emails with Claude and SMTP

⚑ 8 views Β· πŸ“Š Market Research & Insights

Description

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

  1. Runs every morning at 8am on a schedule.
  2. Fetches your Supabase REST OpenAPI schema and condenses it into a list of available tables and columns.
  3. Sends your plain-English reporting requirements and the live schema to Anthropic Claude to generate PostgREST metric queries.
  4. Validates the planned queries against the discovered schema, replaces time placeholders with real timestamps, and builds Supabase REST URLs.
  5. Executes each query against the Supabase REST API and calculates counts, sums, or top-group breakdowns from the returned rows.
  6. 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

  1. Add credentials for Supabase API, Anthropic (HTTP Header Auth using x-api-key), and an SMTP account.
  2. In the Config step, set supabaseUrl, reportEmail, fromEmail, brandName, windowHours, and your plain-English requirements.
  3. 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

Customization

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.

πŸ”— Nodes Used

Send Email, HTTP Request, Schedule Trigger

πŸ“₯ Import

Download workflow.json and import into n8n: Workflow menu β†’ Import from File

πŸ“– Importing guide Β· πŸ”‘ Credential setup