{
  "name": "Analyze lost HubSpot deals and generate revival strategies with OpenAI",
  "nodes": [
    {
      "id": "9d139f6c-2be4-423f-95ab-16fd3324e694",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3248,
        1680
      ],
      "parameters": {
        "width": 656,
        "height": 736,
        "content": "## Intelligent Lost Deal Analyzer + Revival Strategy Engine Workflow\nThis workflow is an automated sales intelligence system that continuously analyzes lost deals, uncovers the real reason behind each"
      }
    },
    {
      "id": "150b9993-aeb0-4c5c-aeb0-d0312f865822",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2576,
        1680
      ],
      "parameters": {
        "width": 944,
        "height": 736,
        "content": "## Step 1: Lost Deal Identification & Data Preparation\nThis step runs on a scheduled trigger to fetch all deals from the CRM, filters only Closed–Lost deals, and standardizes essential fields like dea"
      }
    },
    {
      "id": "554d4ba6-6868-4e00-afd3-2efe3c7ae011",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1616,
        1680
      ],
      "parameters": {
        "width": 1568,
        "height": 736,
        "content": "## Step 2: AI Loss Analysis & Revival Strategy Generation\nThis step uses AI to analyze each lost deal and determine the primary loss category, confidence level, and a brief explanation based on CRM da"
      }
    },
    {
      "id": "9ed0cfc3-b58a-4211-b696-71c7d4d4d8fc",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -32,
        1680
      ],
      "parameters": {
        "width": 1040,
        "height": 736,
        "content": "## Step 3: Multi-Channel Reporting, Audit Logging & Data Persistence\nThis step converts the finalized AI-generated re-engagement strategies into executive-ready outputs by building a consolidated HTML"
      }
    },
    {
      "id": "c985a0b1-1963-47c6-8111-142c4c8a527a",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -2560,
        2192
      ]
    },
    {
      "id": "ec4c262a-4d9e-45e4-9f99-09fcf90bd18f",
      "name": "Get many deals",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        -2288,
        2192
      ]
    },
    {
      "id": "639e8742-7d0e-4a25-8688-3797d832cd0f",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        -2032,
        2192
      ]
    },
    {
      "id": "ee310990-64b3-4707-850b-c9094b5f316d",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        -1824,
        2096
      ]
    },
    {
      "id": "8b4c2aba-2769-4c0f-822e-bfe0e64d4e69",
      "name": "Code in JavaScript",
      "type": "n8n-nodes-base.code",
      "position": [
        -1232,
        1952
      ]
    },
    {
      "id": "8fd2858f-1db0-4eea-a738-b2723d84987e",
      "name": "Code in JavaScript1",
      "type": "n8n-nodes-base.code",
      "position": [
        -464,
        1952
      ]
    },
    {
      "id": "077d0e82-382a-4b6f-85d9-41e8c9a45b9a",
      "name": "Send a message1",
      "type": "n8n-nodes-base.slack",
      "position": [
        336,
        2192
      ]
    },
    {
      "id": "ef931eae-5c8b-4ae0-a1f5-17152772270e",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        -1024,
        2080
      ]
    },
    {
      "id": "a0fabf86-c528-4b8a-aa12-8d21b696bba0",
      "name": "Merge1",
      "type": "n8n-nodes-base.merge",
      "position": [
        -192,
        2064
      ]
    },
    {
      "id": "f87cda7f-1b9b-4dd8-827d-33ff13d43e26",
      "name": "Send a message2",
      "type": "n8n-nodes-base.gmail",
      "position": [
        336,
        1936
      ]
    },
    {
      "id": "d6aa36bb-3318-403c-ac44-0b8f38dae845",
      "name": "Code in JavaScript4",
      "type": "n8n-nodes-base.code",
      "position": [
        592,
        2064
      ]
    },
    {
      "id": "b1930b6a-ffa8-4b2c-8102-5f36aeed9d70",
      "name": "Append or update row in sheet1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        800,
        2064
      ]
    },
    {
      "id": "2c004169-4aa4-4f5d-bf15-b85a53384b45",
      "name": "Code in JavaScript7",
      "type": "n8n-nodes-base.code",
      "position": [
        64,
        1936
      ]
    },
    {
      "id": "53e71c04-8db2-4b84-aa36-5a1ca84676a3",
      "name": "Code in JavaScript2",
      "type": "n8n-nodes-base.code",
      "position": [
        64,
        2192
      ]
    },
    {
      "id": "9e11aaf4-04db-471f-adbd-77d2a8e1c9a1",
      "name": "Brief Explanation Creator",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -1584,
        1952
      ]
    },
    {
      "id": "982161d6-c0ee-4b6a-9f00-36b2ca5fdfd1",
      "name": "Feedback Creator",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -816,
        1952
      ]
    }
  ],
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "Feedback Creator",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge1",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Merge1": {
      "main": [
        [
          {
            "node": "Code in JavaScript7",
            "type": "main",
            "index": 0
          },
          {
            "node": "Code in JavaScript2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Brief Explanation Creator",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Get many deals": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send a message1": {
      "main": [
        [
          {
            "node": "Code in JavaScript4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send a message2": {
      "main": [
        [
          {
            "node": "Code in JavaScript4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Feedback Creator": {
      "main": [
        [
          {
            "node": "Code in JavaScript1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get many deals",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript1": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript2": {
      "main": [
        [
          {
            "node": "Send a message1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript4": {
      "main": [
        [
          {
            "node": "Append or update row in sheet1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript7": {
      "main": [
        [
          {
            "node": "Send a message2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Brief Explanation Creator": {
      "main": [
        [
          {
            "node": "Code in JavaScript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}