Postgres data freshness monitoring with email alerts
Ready for 3.0Ready 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).
- Produce tables + date columns (Code): runs custom JavaScript code
- Loop Over Items (Loop Over Items (Split in Batches)): loops over the items in batches
- Remove fresh tables (Filter): keeps only the items that match a condition
- Get most recent row from table (Postgres): select
- Aggregate: combines items into one
- Calculate lag (Date & Time): formats or calculates dates
- Send alerts (Execute Sub-workflow): calls another n8n workflow
- Add back table name (Edit Fields (Set)): sets 2 fields: daysOld, table
Services it uses
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)
- Schedule Trigger
n8n-nodes-base.scheduleTrigger - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - Aggregate
n8n-nodes-base.aggregate - Postgres
n8n-nodes-base.postgres - Date & Time
n8n-nodes-base.dateTime - Edit Fields (Set)
n8n-nodes-base.set - Filter
n8n-nodes-base.filter - Code
n8n-nodes-base.code - Execute Sub-workflow
n8n-nodes-base.executeWorkflow
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…