Reconcile Postgres records with an HTTP API and notify drift via Slack
Ready for 3.0What this workflow does
This workflow has 20 nodes and runs on a schedule (every day at 03:00). Along the way it connects Postgres and Slack.
How it runs
Trigger: On a schedule (every day at 03:00).
- Drift Rules (Edit Fields (Set)): sets 11 fields: api_url, api_records_field, compare_fields…
- Read The Database Side (Postgres): run a query
- Read The API Side (HTTP Request): calls an HTTP API
- Line Them Up (Compare Datasets): uses Compare Datasets
- Split Out: splits a list into separate items
- Label Rows Missing From The API (Edit Fields (Set)): sets 9 fields: record_key, drift_kind, drifted_fields…
- Records That Already Agree (Edit Fields (Set)): sets 9 fields: record_key, drift_kind, drifted_fields…
- Explain Which Fields Differ (Code): runs custom JavaScript code
- Label Rows Missing From The Database (Edit Fields (Set)): sets 9 fields: record_key, drift_kind, drifted_fields…
- Gather Every Difference (Merge): merges the data from its input branches
…plus 7 more steps. See the full node list below.
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 (12)
- Schedule Trigger
n8n-nodes-base.scheduleTrigger - Edit Fields (Set)
n8n-nodes-base.set - Postgres
n8n-nodes-base.postgres - HTTP Request
n8n-nodes-base.httpRequest - Split Out
n8n-nodes-base.splitOut - Compare Datasets
n8n-nodes-base.compareDatasets - Code
n8n-nodes-base.code - Merge
n8n-nodes-base.merge - Filter
n8n-nodes-base.filter - If
n8n-nodes-base.if - Slack
n8n-nodes-base.slack - No Operation, do nothing
n8n-nodes-base.noOp
From the author
Quick overview This workflow runs nightly to reconcile a Postgres table with records returned by an HTTP API, detect missing or mismatched rows, flag critical drift in the database, and post a drift summary (and critical alerts) to Slack. How it works 1. Runs…