{"product_id":"n8n-workflow-hubspot-deal-risk-scoring-slack-alerts","title":"n8n Workflow: HubSpot Deal Risk Scoring + Slack Alerts","description":"\u003ch3\u003eDaily HubSpot Deal Risk Scoring with Slack Alerts—automated\u003c\/h3\u003e\n\u003cp\u003eThis n8n workflow monitors your \u003cstrong\u003eopen HubSpot deals\u003c\/strong\u003e every day, calculates deal \u003cstrong\u003erisk level\u003c\/strong\u003e and \u003cstrong\u003etrend\u003c\/strong\u003e, tracks prior alert state in \u003cstrong\u003ePostgreSQL\u003c\/strong\u003e, writes audit logs to \u003cstrong\u003eGoogle Sheets\u003c\/strong\u003e, and sends \u003cstrong\u003eHIGH\/CRITICAL\u003c\/strong\u003e alerts to \u003cstrong\u003eSlack\u003c\/strong\u003e—including an AI-generated next-best-action sentence via \u003cstrong\u003eOpenRouter (Gemini)\u003c\/strong\u003e when meaningful changes occur.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eRuns daily\u003c\/strong\u003e at \u003cstrong\u003e08:00 (Asia\/Kolkata)\u003c\/strong\u003e to retrieve all \u003cstrong\u003eopen deals\u003c\/strong\u003e from HubSpot.\u003c\/li\u003e\n  \u003cli\u003eLoads \u003cstrong\u003eclose-date tracking\u003c\/strong\u003e and \u003cstrong\u003eprevious alert state\u003c\/strong\u003e from \u003cstrong\u003ePostgreSQL\u003c\/strong\u003e, then calculates a \u003cstrong\u003erisk score\u003c\/strong\u003e, \u003cstrong\u003erisk level\u003c\/strong\u003e, \u003cstrong\u003etrend\u003c\/strong\u003e, and an \u003cstrong\u003eissue list\u003c\/strong\u003e for each deal.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eWrites reporting\u003c\/strong\u003e to \u003cstrong\u003eGoogle Sheets\u003c\/strong\u003e: a run-level summary and a per-deal risk audit trail; and it upserts close-date history in PostgreSQL \u003cem\u003eonly\u003c\/em\u003e when the close date changed.\u003c\/li\u003e\n  \u003cli\u003eDetermines what to do per deal: alert (HIGH\/CRITICAL with \u003cstrong\u003enew or changed\u003c\/strong\u003e conditions), refresh silently, resolve, or do nothing—then updates the \u003cstrong\u003eRevOps Action Queue\u003c\/strong\u003e in Google Sheets accordingly.\u003c\/li\u003e\n  \u003cli\u003eWhen an alert is required, requests a \u003cstrong\u003eone-sentence recommended next action\u003c\/strong\u003e from \u003cstrong\u003eOpenRouter (Gemini)\u003c\/strong\u003e, with a \u003cstrong\u003erule-based fallback\u003c\/strong\u003e if AI output is missing or unusable.\u003c\/li\u003e\n  \u003cli\u003eSends \u003cstrong\u003eHIGH\/CRITICAL\u003c\/strong\u003e alerts to \u003cstrong\u003eSlack\u003c\/strong\u003e, records delivered alerts in Google Sheets, and updates alert state in \u003cstrong\u003ePostgreSQL\u003c\/strong\u003e only after Slack delivery is confirmed.\u003c\/li\u003e\n  \u003cli\u003eLogs \u003cstrong\u003eresolved deals\u003c\/strong\u003e (including deals that disappear from HubSpot after a safety window) to Google Sheets and clears alert state in PostgreSQL; groups node failures into a single Slack error message.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eRevOps teams who need \u003cstrong\u003eearly warning\u003c\/strong\u003e on at-risk deal momentum changes.\u003c\/li\u003e\n  \u003cli\u003eSaaS operators tracking \u003cstrong\u003eclose-date drift\u003c\/strong\u003e and other deal risk signals with auditability.\u003c\/li\u003e\n  \u003cli\u003eAutomation engineers building a reliable \u003cstrong\u003eHubSpot → Slack\u003c\/strong\u003e risk monitoring pipeline with persistence.\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 \/ tech stack:\u003c\/strong\u003e code, slack, filter, switch, hubspot, postgres\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eOutputs:\u003c\/strong\u003e Slack alerts, Google Sheets run summaries + risk audit history, PostgreSQL alert-state persistence and close-date history.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eAI integration:\u003c\/strong\u003e OpenRouter (Gemini) for one-sentence next-best-action recommendations.\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":46154028908723,"sku":"N8N-20283","price":4.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/k8Z1J265ip4wdzqOrFJG-_6zX0w8gJ.png?v=1790932809","url":"https:\/\/buyflowscripts.com\/products\/n8n-workflow-hubspot-deal-risk-scoring-slack-alerts","provider":"N8N Commerce","version":"1.0","type":"link"}