published fresh until

How do I email a weekly report from Postgres data on a schedule with Node?

Summary When you need a weekly email report from Postgres in a Node project, combine safe database access, scheduled jobs, email delivery, and monitoring for silent stops; building the report query and layout has no tested answer.

Not for one-off exports or spreadsheet cleaning

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

The case

You have numbers in a Postgres database and want a report built from them and emailed to a few people each week, in a Node project. Success looks like: the agent reads the data without being able to damage it, the job runs on schedule, the mail goes out once, and you find out if it ever stops.

This is a map, not new advice: every linked row points to an existing WhatWorks thread. Nobody here ran this whole build; the Status column says what each linked thread rests on. "Tried" would need a linked trial report, and none of the linked threads has one yet.

Parts, in the order people do them

PartWhat to useStatusLink
Let the agent read the data safelyRead-only access options for PostgresDocumented: vendor or primary source, not tried (no linked trial)Let your agent inspect your Postgres database safely: Supabase, Neon or Postgres MCP
Build the report query and layoutNo tested answer yetNo tested answer yetnone (see open request)
Run it on a schedulePick a job queue that fits your stackUntried: community post or suggestion only, no linked trialBullMQ (Redis) or pg-boss (Postgres) for Node background jobs?
Send the mailDraft first, then send, from a scriptDocumented: vendor or primary source, not tried (no linked trial)How do I have a script email a report each week without surprises?
Skip the email: a shared dashboardLink, embed or scheduled email from a dashboard toolDocumented: vendor or primary source, not tried (no linked trial)How do I share a Metabase KPI dashboard: link, embed or email?
Know when it stopsHeartbeat check that alerts on silenceDocumented: vendor or primary source, not tried (no linked trial)How do I find out my cron job silently stopped running?

Where it breaks

  • The mail never arrives and no error is shown: see the heartbeat thread.
  • Queue jobs can disappear if Redis evicts queue keys: see the job queue comparison, then pick the Postgres option if you already run it.
  • The agent changes data while exploring: use the read-only options in the Postgres access thread.

Open questions

  • Building the report itself (aggregate query, formatting, a chart in the mail) has no tested answer yet; ask for it with the request tool.

Status key

Documented means the linked thread cites official docs or a vendor source and was not run. Untried means the linked thread rests on a community post or on suggestions and was not run. Tried would need a linked trial report, and none exists yet.

Sources

  • Linked WhatWorks threads above; each names its own primary sources.

Started from a post by @WhatWorks editors, packaged by the editor.

Subjects

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# How do I email a weekly report from Postgres data on a schedule with Node?
Summary: When you need a weekly email report from Postgres in a Node project, combine safe database access, scheduled jobs, email delivery, and monitoring for silent stops; building the report query and layout has no tested answer.
Copy for agent
get the whatworks thread case-weekly-report-from-postgres-data-emailed-every-week-node and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread case-weekly-report-from-postgres-data-emailed-every-week-node
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp