{
  "name": "Score HubSpot deal conversion risk with OpenAI and Slack alerts",
  "nodes": [
    {
      "id": "80b1b86d-a3df-43a0-ade1-080db9031e32",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1680,
        304
      ]
    },
    {
      "id": "08d0258d-0f54-4cab-beff-491eacab485b",
      "name": "Get Active Deals from HubSpot",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        -1456,
        304
      ]
    },
    {
      "id": "196dfb80-88d3-4457-8453-dea03d1788da",
      "name": "Filter Alerts Needed",
      "type": "n8n-nodes-base.if",
      "position": [
        688,
        240
      ]
    },
    {
      "id": "b0aa889e-7a3b-4052-a61c-a4e16921da72",
      "name": "Send Slack Alert",
      "type": "n8n-nodes-base.slack",
      "position": [
        912,
        176
      ]
    },
    {
      "id": "27f41d75-f36d-48db-9da0-0815709534f5",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        -1008,
        304
      ]
    },
    {
      "id": "be3eb10a-0890-4f34-a468-a4b27893f1da",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -784,
        304
      ]
    },
    {
      "id": "8846cf43-0f6f-4027-9fc7-7e2ec0c5451e",
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -560,
        48
      ]
    },
    {
      "id": "6a74e2bd-4537-4a48-8cde-49fc9b1c656f",
      "name": "Get an engagement",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        -336,
        48
      ]
    },
    {
      "id": "bf6ee2f3-42b8-4404-a239-afd2f9ba2b3f",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        112,
        48
      ]
    },
    {
      "id": "2d214070-e8a5-45e5-96c0-d088fa4ade35",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        192,
        272
      ]
    },
    {
      "id": "485f544f-82e9-400f-bddd-d1a43b36729b",
      "name": "Append or update row in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1136,
        336
      ]
    },
    {
      "id": "0e163fc0-a59c-4a40-bbde-657028bd38a6",
      "name": "Extracts Data",
      "type": "n8n-nodes-base.code",
      "position": [
        -112,
        48
      ]
    },
    {
      "id": "fe234e65-d95a-40dc-a3e3-037715499d9d",
      "name": "Format Data",
      "type": "n8n-nodes-base.code",
      "position": [
        464,
        48
      ]
    },
    {
      "id": "3e7a538d-58b2-44af-bf17-dfbac1d18469",
      "name": "Formatting Data",
      "type": "n8n-nodes-base.code",
      "position": [
        -1232,
        304
      ]
    },
    {
      "id": "f7cb917b-9d3d-4bec-a56f-8c17badedb29",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2336,
        -128
      ],
      "parameters": {
        "width": 544,
        "height": 720,
        "content": "# AI-Powered HubSpot Deal Risk Monitoring\n\nThis workflow automatically reviews your active HubSpot deals, analyzes recent engagement activity using AI, and alerts your sales team when deals show signs"
      }
    },
    {
      "id": "c798ed58-be4c-463e-8d82-a332bee7ca61",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1776,
        -128
      ],
      "parameters": {
        "width": 720,
        "height": 720,
        "content": "### Step 1 – Trigger and collect active deals  \nThe workflow runs everyday at 4PM using a Schedule Trigger.  \nIt fetches all active (non-closed) deals from HubSpot and formats key fields such as deal "
      }
    },
    {
      "id": "9477eebb-9801-460a-aad8-0abfb20abd89",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1040,
        -128
      ],
      "parameters": {
        "width": 1072,
        "height": 720,
        "content": "### Step 2 – Enrich deals with engagement data  \nEach deal is processed individually to retrieve associated engagements (emails, calls, meetings, notes).  \nEngagement data is normalized and enriched w"
      }
    },
    {
      "id": "df557527-a2ea-4339-9928-f54604e83be8",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        48,
        -128
      ],
      "parameters": {
        "width": 1264,
        "height": 720,
        "content": "## Step 3 – Analyze deals and notify team\n\nUses AI to evaluate deal health and conversion probability, identify risks and recommended actions, and determine urgency.  \nHigh-risk or stalled deals trigg"
      }
    }
  ],
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Format Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Data": {
      "main": [
        [
          {
            "node": "Filter Alerts Needed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Get an engagement",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extracts Data": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Formatting Data": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get Active Deals from HubSpot",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Slack Alert": {
      "main": [
        [
          {
            "node": "Append or update row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get an engagement": {
      "main": [
        [
          {
            "node": "Extracts Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Filter Alerts Needed": {
      "main": [
        [
          {
            "node": "Send Slack Alert",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append or update row in sheet": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Active Deals from HubSpot": {
      "main": [
        [
          {
            "node": "Formatting Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}