{
  "name": "Monitor HubSpot deal risk with OpenAI scoring and Slack alerts",
  "nodes": [
    {
      "id": "f20401d8-9f33-4e1d-a933-ffcf40816c5d",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        7856,
        3152
      ]
    },
    {
      "id": "08046091-dd94-4ab1-a36a-3b383c82c05c",
      "name": "Get Active Deals from HubSpot",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        8080,
        3152
      ]
    },
    {
      "id": "a95d5a1b-f099-4ac9-957c-f77114679f15",
      "name": "Filter Alerts Needed",
      "type": "n8n-nodes-base.if",
      "position": [
        10224,
        3088
      ]
    },
    {
      "id": "5a49f071-0d5d-448a-a634-f2bfac347b8e",
      "name": "Send Slack Alert",
      "type": "n8n-nodes-base.slack",
      "position": [
        10448,
        3024
      ]
    },
    {
      "id": "55a0d139-1f12-4afe-a244-765517ea03a7",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        8528,
        3152
      ]
    },
    {
      "id": "bbcbcf54-77da-4f9c-b047-e2eed574c7b3",
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        8976,
        2896
      ]
    },
    {
      "id": "dd8afa81-e388-4566-9212-25fb11d855a2",
      "name": "Get an engagement",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        9200,
        2896
      ]
    },
    {
      "id": "aafef30c-7aa4-4ce0-9bc0-7c9acf9ab548",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        9648,
        2896
      ]
    },
    {
      "id": "a7516052-0630-4cca-a083-b6c2d5152085",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        9728,
        3120
      ]
    },
    {
      "id": "625ccdc2-e76a-4ca5-9e38-dfc3afddd395",
      "name": "Append or update row in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        10672,
        3184
      ]
    },
    {
      "id": "3939b09f-3d01-4ee7-b326-6ffac225f0b1",
      "name": "Extracts Data",
      "type": "n8n-nodes-base.code",
      "position": [
        9424,
        2896
      ]
    },
    {
      "id": "ceeb6ae7-4025-4bd5-9893-f6acf7d5ec42",
      "name": "Formatting Data",
      "type": "n8n-nodes-base.code",
      "position": [
        8304,
        3152
      ]
    },
    {
      "id": "d5152cb6-a75b-423e-bc56-a30fd46a6bb4",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        7760,
        2720
      ],
      "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": "5ab92365-bd66-4b58-a6fb-32a8a9d1b865",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        8496,
        2720
      ],
      "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": "bfbf4931-38ce-4a68-96c5-5623b32e5f44",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        9584,
        2720
      ],
      "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"
      }
    },
    {
      "id": "c6964fd6-edb1-45c6-a44c-240b3ee45e27",
      "name": "Loop Over Items1",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        8752,
        3152
      ]
    },
    {
      "id": "68795c2f-2de7-4de6-9941-90ef79ca6db9",
      "name": "Format Data1",
      "type": "n8n-nodes-base.code",
      "position": [
        10000,
        2896
      ]
    },
    {
      "id": "86fa058f-14c8-4d31-b055-533f7e32f162",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        7200,
        2720
      ],
      "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"
      }
    }
  ],
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Format Data1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Data1": {
      "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 Items1": {
      "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 Items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append or update row in sheet": {
      "main": [
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Active Deals from HubSpot": {
      "main": [
        [
          {
            "node": "Formatting Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}