Templates / Postgres data freshness monitoring with email alerts

Postgres data freshness monitoring with email alerts

Ready for 3.0

by Kevin · 82 views · created 2025-07-20 · Engineering

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

What this workflow does

This workflow has 9 nodes and runs on a schedule (every day). Along the way it connects Postgres.

How it runs

Trigger: On a schedule (every day).

  1. Produce tables + date columns (Code): runs custom JavaScript code
  2. Loop Over Items (Loop Over Items (Split in Batches)): loops over the items in batches
  3. Remove fresh tables (Filter): keeps only the items that match a condition
  4. Get most recent row from table (Postgres): select
  5. Aggregate: combines items into one
  6. Calculate lag (Date & Time): formats or calculates dates
  7. Send alerts (Execute Sub-workflow): calls another n8n workflow
  8. Add back table name (Edit Fields (Set)): sets 2 fields: daysOld, table

Services it uses

Postgres

Before you upgrade to n8n 3.0

Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.

Nodes used (9)

From the author

Monitor Postgres Data Freshness and Email Alert If Stale This template monitors a set of tables inside a Postgres database to ensure they're getting updated. If the table hasn't been updated in 3 days (configurable), an email alert is sent containing the…

Excerpt from Kevin's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.