{"product_id":"n8n-teamretro-nightly-health-check-sync-to-postgres-slack-alerts","title":"n8n TeamRetro Nightly Health Check Sync to Postgres + Slack Alerts","description":"\u003ch3\u003eNightly sync of TeamRetro health checks into Postgres—with Slack alerts only when something goes wrong\u003c\/h3\u003e\n\u003cp\u003eKeep your team health data up to date automatically. This n8n workflow runs every night, pulls each TeamRetro team’s latest \u003cstrong\u003eclosed\u003c\/strong\u003e health checks, normalizes the dimensions into a Postgres-friendly format, and sends a \u003cstrong\u003eSlack\u003c\/strong\u003e notification only if failures are detected.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eSchedules nightly:\u003c\/strong\u003e Runs daily at \u003cstrong\u003e02:00\u003c\/strong\u003e (server time).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eEnsures storage is ready:\u003c\/strong\u003e Creates (if needed) the \u003cstrong\u003eteam_health_scores\u003c\/strong\u003e table in Postgres.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eFetches teams and checks:\u003c\/strong\u003e Retrieves all teams from \u003cstrong\u003eTeamRetro\u003c\/strong\u003e, then pulls up to \u003cstrong\u003ethree\u003c\/strong\u003e most recent health checks per team.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eProcesses only closed checks:\u003c\/strong\u003e Skips teams without a closed health check and continues only checks with status \u003cstrong\u003eclosed\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eFlattens dimensions for analytics:\u003c\/strong\u003e Pulls all dimensions for each closed health check and flattens ratings into warehouse-ready rows (including the health model and rating scale).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eFilters invalid data:\u003c\/strong\u003e Drops unrated or failed dimension rows.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eUpserts scores safely:\u003c\/strong\u003e Upserts into Postgres using \u003cstrong\u003e(health_check_id, dimension)\u003c\/strong\u003e as the conflict key.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eRun summary + error alerts:\u003c\/strong\u003e Aggregates outcomes into a single summary and posts error details to \u003cstrong\u003eSlack\u003c\/strong\u003e only when failures occur.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eBuilding a reliable historical dataset of TeamRetro health scores for dashboards and reporting.\u003c\/li\u003e\n  \u003cli\u003eKeeping a SaaS operator’s analytics database fresh without manual exporting.\u003c\/li\u003e\n  \u003cli\u003eAutomated monitoring: detect and surface workflow processing issues via Slack.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eTeamRetro\u003c\/strong\u003e credential: uses an account-scoped API key prefixed with \u003cstrong\u003etra_\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003ePostgres\u003c\/strong\u003e: writes to \u003cstrong\u003eteam_health_scores\u003c\/strong\u003e and upserts using \u003cstrong\u003e(health_check_id, dimension)\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eSlack\u003c\/strong\u003e: posts failure notifications to a configured destination channel (e.g., \u003cem\u003e#data-alerts\u003c\/em\u003e).\u003c\/li\u003e\n  \u003cli\u003eNodes and logic used include: \u003cstrong\u003eif\u003c\/strong\u003e, \u003cstrong\u003ecode\u003c\/strong\u003e, \u003cstrong\u003emerge\u003c\/strong\u003e, \u003cstrong\u003eslack\u003c\/strong\u003e, \u003cstrong\u003epostgres\u003c\/strong\u003e, and \u003cstrong\u003esticky note\u003c\/strong\u003e.\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":45923020603571,"sku":"N8N-18902","price":12.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/zIn6BfaigWmtZoOTdeZFn_pmaEAxHe.png?v=1788167005","url":"https:\/\/buyflowscripts.com\/products\/n8n-teamretro-nightly-health-check-sync-to-postgres-slack-alerts","provider":"N8N Commerce","version":"1.0","type":"link"}