{"product_id":"n8n-postgresql-data-quality-check-slack-alerts","title":"n8n PostgreSQL Data Quality Check \u0026 Slack Alerts","description":"\u003ch3\u003eCatch PostgreSQL data problems early—then notify your team in Slack\u003c\/h3\u003e\n\u003cp\u003eThis n8n workflow automatically scans a PostgreSQL table for missing required values, duplicate business keys, numeric anomalies, and table health issues—and writes run history to PostgreSQL. It sends Slack alerts \u003cem\u003eonly when attention is needed\u003c\/em\u003e, so you stay informed without constant noise.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eRuns hourly\u003c\/strong\u003e on a schedule or \u003cstrong\u003estarts on demand\u003c\/strong\u003e when a POST request is sent to the \u003ccode\u003e\/dq-run\u003c\/code\u003e webhook.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eLoads and validates configuration\u003c\/strong\u003e (table name, key columns, required columns, numeric columns, thresholds, and Slack webhook URL) before generating the SQL checks.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eChecks PostgreSQL data quality\u003c\/strong\u003e for:\n    \u003cul\u003e\n      \u003cli\u003eMissing required values\u003c\/li\u003e\n      \u003cli\u003eDuplicate business keys (optionally normalized)\u003c\/li\u003e\n      \u003cli\u003eNumeric outliers using a \u003cstrong\u003erobust z-score\u003c\/strong\u003e\n\u003c\/li\u003e\n      \u003cli\u003eTable health stats, including row counts and timestamp freshness\u003c\/li\u003e\n    \u003c\/ul\u003e\n  \u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eScores results\u003c\/strong\u003e across completeness, uniqueness, validity, and timeliness—classifying each run as pass\/warn\/fail\/error and selecting the most important issues.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003ePersists outcomes\u003c\/strong\u003e by writing a run summary to \u003ccode\u003edq_runs\u003c\/code\u003e and inserting only \u003cem\u003enewly observed\u003c\/em\u003e issues into \u003ccode\u003edq_issues\u003c\/code\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eOptionally auto-resolves\u003c\/strong\u003e issues that no longer appear after a full scan.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eAlerts in Slack only when needed\u003c\/strong\u003e (fails\/errors, critical issues, or new warnings); otherwise it stays quiet.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eDetect missing fields or invalid values before they break downstream pipelines.\u003c\/li\u003e\n  \u003cli\u003eMonitor duplicate business keys after upstream changes.\u003c\/li\u003e\n  \u003cli\u003eFlag numeric anomalies (robust z-score) in reporting or billing datasets.\u003c\/li\u003e\n  \u003cli\u003eEnsure table freshness by alerting when timestamps stop updating.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003en8n nodes\/blocks used:\u003c\/strong\u003e if, set, code, webhook, postgres, sticky note\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eIntegrations:\u003c\/strong\u003e PostgreSQL (dq_runs, dq_issues; optional dq_demo_orders) and \u003cstrong\u003eSlack\u003c\/strong\u003e via webhook\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eSetup:\u003c\/strong\u003e add PostgreSQL credentials and run the manual setup to create required tables, then update configuration values like \u003ccode\u003etableName\u003c\/code\u003e, \u003ccode\u003epkColumn\u003c\/code\u003e, and \u003ccode\u003etimestampColumn\u003c\/code\u003e.\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":46192868622515,"sku":"N8N-20459","price":23.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/5xOP1SxuLb_4wbt6Vz-LH_BrtUbxrD.png?v=1791537807","url":"https:\/\/buyflowscripts.com\/products\/n8n-postgresql-data-quality-check-slack-alerts","provider":"N8N Commerce","version":"1.0","type":"link"}