{
  "id": "sjXZuCCEEMhp5iNq",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "AI-Powered Sales Pipeline Stage Change Notifier",
  "tags": [
    {
      "id": "4Of2LE0HSt4qmmUG",
      "name": "Ansh",
      "createdAt": "2026-04-20T10:32:01.726Z",
      "updatedAt": "2026-04-20T10:32:01.726Z"
    }
  ],
  "nodes": [
    {
      "id": "1a2f2875-06ce-4bf5-843f-976a0f9004ca",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -5040,
        -384
      ],
      "parameters": {
        "width": 588,
        "height": 656,
        "content": "## AI-Powered Sales Pipeline Stage Change Notifier\nThis workflow automatically detects when a deal moves to a new stage in HubSpot. It fetches the full deal context including the real contact name and owner, uses AI to generate a smart update with next-step recommendations, routes Closed Won deals to a celebration email, flags Closed Lost deals to management, and posts a rich Slack notification \u2014 keeping your entire sales team aligned without any manual updates.\n\n### How it works\n\n\t\u2022\tHubSpot triggers the workflow whenever a deal stage changes.\n\t\u2022\tIt validates the change is real, then fetches deal, contact, and owner details.\n\t\u2022\tA code node formats and enriches all data for AI processing.\n\t\u2022\tOpenAI generates a smart summary with stage context and recommended next steps.\n\t\u2022\tClosed Won deals trigger a Gmail congratulations email to the owner.\n\t\u2022\tClosed Lost deals send a loss alert with reason to the sales manager channel.\n\t\u2022\tAll other stage changes post to Slack based on deal value.\n\t\u2022\tHubSpot is updated with a note, and all events are logged to Google Sheets.\n\t\u2022\tAny errors are caught and posted to a dedicated Slack error channel.\n\n### Setup Steps\n\n\t1.\tConnect your HubSpot account credentials (API + Developer API).\n\t2.\tConnect your OpenAI API credentials.\n\t3.\tConnect your Slack credentials and update the channel names in each Slack node.\n\t4.\tConnect your Gmail credentials for Closed Won emails.\n\t5.\tConnect Google Sheets and set your log sheet ID.\n\t6.\tTurn on the workflow."
      },
      "typeVersion": 1
    },
    {
      "id": "c1a4c1ea-47bc-415b-b179-daf1719b0edd",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -4432,
        -384
      ],
      "parameters": {
        "color": 7,
        "width": 496,
        "height": 656,
        "content": "## Step 1: Detect Deal Stage Change\nThis step watches HubSpot for any deal that moves to a new pipeline stage. The moment a stage change happens, it catches the event and starts the workflow. A quick check removes any duplicate or noise triggers before anything else runs."
      },
      "typeVersion": 1
    },
    {
      "id": "54e4f0aa-31f1-45ff-be1b-3c47efa672d1",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3920,
        -384
      ],
      "parameters": {
        "color": 7,
        "width": 720,
        "height": 656,
        "content": "## Step 2: Enrich & Analyse with AI\nThis step takes the raw deal data and prepares it cleanly. It also fetches the real contact name and the deal owner name so the notifications make sense. It then sends everything to OpenAI, which writes a clear summary with practical next steps for the sales rep."
      },
      "typeVersion": 1
    },
    {
      "id": "d665092f-ca6a-4a56-a2b4-25ed8b8a6ddb",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3184,
        -384
      ],
      "parameters": {
        "color": 7,
        "width": 752,
        "height": 656,
        "content": "## Step 3: Notify Team & Log Update\nThis step checks whether the deal is high-value and routes the Slack notification to the right channel. The AI-written summary is posted so the whole team sees it instantly. The event is also logged to Google Sheets for tracking."
      },
      "typeVersion": 1
    },
    {
      "id": "657694b8-96e6-4ff6-a1e6-3532bb05e24b",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2416,
        -384
      ],
      "parameters": {
        "color": 7,
        "width": 672,
        "height": 656,
        "content": "## Step 4: Fetch Contact & Owner Details\nThis step reaches back into HubSpot to get two extra pieces of information: the real name of the contact linked to this deal, and the full name of the sales rep who owns it. Without this, Slack messages would only show IDs. This makes every notification human-readable."
      },
      "typeVersion": 1
    },
    {
      "id": "c8b8a643-afa1-46e2-9196-c6b9c19f4e78",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1728,
        -384
      ],
      "parameters": {
        "color": 7,
        "width": 432,
        "height": 656,
        "content": "## Step 5: Handle Won & Lost Deals\nThis step checks if the deal was just won or just lost. Won deals send a congratulations email directly to the sales rep via Gmail. Lost deals send a different alert to the sales manager channel in Slack so leadership is always informed of losses and the stated reason."
      },
      "typeVersion": 1
    },
    {
      "id": "b2579c01-f7ba-41e5-abdd-62afe84152ef",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1280,
        -384
      ],
      "parameters": {
        "color": 7,
        "width": 704,
        "height": 656,
        "content": "## Step 6: Update HubSpot & Catch Errors\nThis step writes a short activity note back onto the HubSpot deal so there is a permanent CRM record of when this notification was sent. A separate error branch runs if anything in the workflow fails, posting a detailed alert to a dedicated Slack error channel so nothing fails silently."
      },
      "typeVersion": 1
    },
    {
      "id": "ba78ea7d-cb78-4d2b-a161-14f4823deea3",
      "name": "HubSpot Trigger",
      "type": "n8n-nodes-base.hubspotTrigger",
      "position": [
        -4368,
        0
      ],
      "parameters": {
        "eventsUi": {
          "eventValues": [
            {
              "name": "deal.propertyChange"
            }
          ]
        },
        "additionalFields": {}
      },
      "typeVersion": 1
    },
    {
      "id": "8b3c173f-1bbd-4659-a8fb-c4521b7f3b7c",
      "name": "Is Real Stage Change?",
      "type": "n8n-nodes-base.if",
      "position": [
        -4144,
        0
      ],
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{ $json.propertyName }}",
              "value2": "dealstage",
              "operation": "equals"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "d423d38c-e046-4bcb-b9c0-5470bcc5d38b",
      "name": "Get Deal Details",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        -3872,
        -16
      ],
      "parameters": {
        "dealId": "={{ $('HubSpot Trigger').item.json.objectId }}",
        "filters": {},
        "resource": "deal",
        "operation": "get"
      },
      "typeVersion": 2
    },
    {
      "id": "557dfd5a-f012-4617-af7f-cfbe9c837130",
      "name": "Format Deal Data",
      "type": "n8n-nodes-base.code",
      "position": [
        -3664,
        -16
      ],
      "parameters": {
        "jsCode": "const deal = $input.first().json;\n\n// Stage label mapping\nconst stageLabels = {\n  'appointmentscheduled': 'Appointment Scheduled',\n  'qualifiedtobuy': 'Qualified to Buy',\n  'presentationscheduled': 'Presentation Scheduled',\n  'decisionmakerboughtin': 'Decision Maker Bought In',\n  'contractsent': 'Contract Sent',\n  'closedwon': 'Closed Won',\n  'closedlost': 'Closed Lost'\n};\n\nconst stageKey = (deal.properties?.dealstage || '').toLowerCase();\nconst stageLabel = stageLabels[stageKey] || deal.properties?.dealstage || 'Unknown Stage';\n\nconst amount = parseFloat(deal.properties?.amount || 0);\nconst isHighValue = amount >= 10000;\nconst isClosedWon = stageKey === 'closedwon';\nconst isClosedLost = stageKey === 'closedlost';\n\nconst closeDate = deal.properties?.closedate\n  ? new Date(deal.properties.closedate).toLocaleDateString('en-US', { year: 'numeric', month: 'short', day: 'numeric' })\n  : 'Not set';\n\n// Extract first associated contact ID if present\nconst contactId = (deal.associations?.contacts?.results?.[0]?.id) || null;\nconst ownerId = deal.properties?.hubspot_owner_id || null;\n\nreturn [{\n  json: {\n    dealId: deal.id,\n    dealName: deal.properties?.dealname || 'Unnamed Deal',\n    newStage: stageLabel,\n    stageKey: stageKey,\n    amount: amount,\n    formattedAmount: amount > 0 ? '$' + amount.toLocaleString() : 'Not set',\n    isHighValue: isHighValue,\n    isClosedWon: isClosedWon,\n    isClosedLost: isClosedLost,\n    closeDate: closeDate,\n    pipeline: deal.properties?.pipeline || 'Default',\n    ownerId: ownerId,\n    contactId: contactId,\n    lostReason: deal.properties?.closed_lost_reason || 'No reason provided',\n    lastModified: deal.properties?.hs_lastmodifieddate || new Date().toISOString(),\n    promptText: `Deal \"${deal.properties?.dealname}\" has just moved to stage: ${stageLabel}.\\nDeal value: ${amount > 0 ? '$' + amount.toLocaleString() : 'not set'}.\\nExpected close date: ${closeDate}.\\nPipeline: ${deal.properties?.pipeline || 'Default'}.\\n\\nWrite a brief, professional Slack update (3-4 sentences) for the sales team. Include:\\n1. A clear statement of the stage change\\n2. Key deal context (value + close date)\\n3. Two specific, actionable next steps the sales rep should take now\\nKeep it concise and motivating.`\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "6c1a7fb3-fb9c-4d6c-9cdf-8fac4eb60f73",
      "name": "Generate AI Summary",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -3456,
        -16
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "options": {
          "maxTokens": 300,
          "temperature": 0.5
        },
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "You are a concise sales operations assistant. When given deal stage change information, you write clear, professional Slack notifications with specific next steps. Always be direct, motivating, and actionable. Never use more than 4 sentences."
            },
            {
              "content": "={{ $json.promptText }}"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "3754a7ad-2d8e-48a1-951e-a7ca602925b6",
      "name": "High Value Deal?",
      "type": "n8n-nodes-base.if",
      "position": [
        -3120,
        -16
      ],
      "parameters": {
        "conditions": {
          "boolean": [
            {
              "value1": "={{ $('Format Deal Data').item.json.isHighValue }}",
              "value2": true
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "81e00dc9-db51-4c97-9f05-c98562bb0aac",
      "name": "Slack - Leadership Channel",
      "type": "n8n-nodes-base.slack",
      "position": [
        -2864,
        -112
      ],
      "parameters": {
        "text": "\ud83d\udd25 *HIGH VALUE DEAL UPDATE*\n\n*Deal:* {{ $('Format Deal Data').item.json.dealName }}\n*New Stage:* {{ $('Format Deal Data').item.json.newStage }}\n*Value:* {{ $('Format Deal Data').item.json.formattedAmount }}\n*Close Date:* {{ $('Format Deal Data').item.json.closeDate }}\n*Owner:* {{ $('Merge Deal Context').item.json.ownerFullName }}\n*Contact:* {{ $('Merge Deal Context').item.json.contactFullName }}\n\n{{ $('Generate AI Summary').item.json.message.content }}\n\n<https://app.hubspot.com/contacts/deals/{{ $('Format Deal Data').item.json.dealId }}|View Deal in HubSpot>",
        "otherOptions": {},
        "authentication": "oAuth2"
      },
      "typeVersion": 2
    },
    {
      "id": "9ab275ad-cee7-4e39-b95c-fefb2242f3cb",
      "name": "Slack - Sales Team Channel",
      "type": "n8n-nodes-base.slack",
      "position": [
        -2864,
        80
      ],
      "parameters": {
        "text": "\ud83d\udcca *DEAL STAGE UPDATE*\n\n*Deal:* {{ $('Format Deal Data').item.json.dealName }}\n*New Stage:* {{ $('Format Deal Data').item.json.newStage }}\n*Value:* {{ $('Format Deal Data').item.json.formattedAmount }}\n*Close Date:* {{ $('Format Deal Data').item.json.closeDate }}\n*Owner:* {{ $('Merge Deal Context').item.json.ownerFullName }}\n*Contact:* {{ $('Merge Deal Context').item.json.contactFullName }}\n\n{{ $('Generate AI Summary').item.json.message.content }}\n\n<https://app.hubspot.com/contacts/deals/{{ $('Format Deal Data').item.json.dealId }}|View Deal in HubSpot>",
        "otherOptions": {},
        "authentication": "oAuth2"
      },
      "typeVersion": 2
    },
    {
      "id": "85f7915b-8ca2-4a6e-aa90-ac902087b622",
      "name": "Log to Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -2592,
        -16
      ],
      "parameters": {
        "columns": {
          "value": {
            "Owner": "={{ $('Merge Deal Context').item.json.ownerFullName }}",
            "Contact": "={{ $('Merge Deal Context').item.json.contactFullName }}",
            "Deal ID": "={{ $('Format Deal Data').item.json.dealId }}",
            "Deal Name": "={{ $('Format Deal Data').item.json.dealName }}",
            "New Stage": "={{ $('Format Deal Data').item.json.newStage }}",
            "Timestamp": "={{ new Date().toISOString() }}",
            "AI Summary": "={{ $('Generate AI Summary').item.json.message.content }}",
            "Close Date": "={{ $('Format Deal Data').item.json.closeDate }}",
            "Deal Value": "={{ $('Format Deal Data').item.json.formattedAmount }}",
            "High Value": "={{ $('Format Deal Data').item.json.isHighValue }}"
          },
          "mappingMode": "autoMapInputData"
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "REPLACE_WITH_YOUR_SHEET_ID"
        }
      },
      "typeVersion": 4
    },
    {
      "id": "bf731118-c556-4f33-9516-44652b1eab44",
      "name": "Get Owner Details",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -2336,
        -96
      ],
      "parameters": {
        "url": "=https://api.hubapi.com/crm/v3/owners/{{ $('Format Deal Data').item.json.ownerId }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "typeVersion": 4.2
    },
    {
      "id": "0b75141b-51df-4c9b-a929-2b163ed80393",
      "name": "Get Contact Details",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -2336,
        96
      ],
      "parameters": {
        "url": "=https://api.hubapi.com/crm/v3/objects/contacts/{{ $('Format Deal Data').item.json.contactId }}?properties=firstname,lastname,email",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "typeVersion": 4.2
    },
    {
      "id": "9c2c91c7-9ffb-46e7-b9ce-66896898ec43",
      "name": "Merge Deal Context",
      "type": "n8n-nodes-base.merge",
      "position": [
        -2112,
        0
      ],
      "parameters": {
        "mode": "combine",
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "7b767788-e997-44cb-80dd-7083b1469062",
      "name": "Build Enriched Context",
      "type": "n8n-nodes-base.code",
      "position": [
        -1888,
        0
      ],
      "parameters": {
        "jsCode": "const ownerData = $('Get Owner Details').item.json;\nconst contactData = $('Get Contact Details').item.json;\nconst dealData = $('Format Deal Data').item.json;\n\nconst ownerFirst = ownerData?.firstName || '';\nconst ownerLast = ownerData?.lastName || '';\nconst ownerFullName = (ownerFirst + ' ' + ownerLast).trim() || 'Unassigned';\nconst ownerEmail = ownerData?.email || '';\n\nconst contactFirst = contactData?.properties?.firstname || '';\nconst contactLast = contactData?.properties?.lastname || '';\nconst contactFullName = (contactFirst + ' ' + contactLast).trim() || 'Unknown Contact';\nconst contactEmail = contactData?.properties?.email || '';\n\nreturn [{\n  json: {\n    ...dealData,\n    ownerFullName,\n    ownerEmail,\n    contactFullName,\n    contactEmail\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "55a0dd47-9cdd-464c-a076-e5ffcb43c866",
      "name": "Won / Lost / Other?",
      "type": "n8n-nodes-base.switch",
      "position": [
        -1664,
        0
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "string": [
                  {
                    "value1": "={{ $json.stageKey }}",
                    "value2": "closedwon",
                    "operation": "equals"
                  }
                ]
              }
            },
            {
              "conditions": {
                "string": [
                  {
                    "value1": "={{ $json.stageKey }}",
                    "value2": "closedlost",
                    "operation": "equals"
                  }
                ]
              }
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "ca59656b-dfb4-453c-a2ac-2194951fa16a",
      "name": "Gmail - Congrats to Owner",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -1440,
        -96
      ],
      "parameters": {
        "sendTo": "={{ $json.ownerEmail }}",
        "message": "<h2>\ud83c\udf89 Congratulations, {{ $json.ownerFullName }}!</h2><p>You just closed <strong>{{ $json.dealName }}</strong> for <strong>{{ $json.formattedAmount }}</strong>.</p><p>This is a fantastic result. Here's a quick summary from our system:</p><blockquote>{{ $('Generate AI Summary').item.json.message.content }}</blockquote><p><strong>Contact:</strong> {{ $json.contactFullName }} ({{ $json.contactEmail }})<br/><strong>Close Date:</strong> {{ $json.closeDate }}</p><p><a href='https://app.hubspot.com/contacts/deals/{{ $json.dealId }}'>View Deal in HubSpot</a></p><p>Keep up the great work! \ud83d\ude80</p>",
        "options": {},
        "subject": "\ud83c\udfc6 Closed Won: {{ $json.dealName }} \u2014 {{ $json.formattedAmount }}"
      },
      "typeVersion": 2.1
    },
    {
      "id": "0596f95b-638e-477d-bad7-dbe5be5cba19",
      "name": "Slack - Loss Alert to Management",
      "type": "n8n-nodes-base.slack",
      "position": [
        -1440,
        96
      ],
      "parameters": {
        "text": "\u274c *DEAL LOST*\n\n*Deal:* {{ $json.dealName }}\n*Value Lost:* {{ $json.formattedAmount }}\n*Owner:* {{ $json.ownerFullName }}\n*Contact:* {{ $json.contactFullName }} ({{ $json.contactEmail }})\n*Loss Reason:* {{ $json.lostReason }}\n\n{{ $('Generate AI Summary').item.json.message.content }}\n\n<https://app.hubspot.com/contacts/deals/{{ $json.dealId }}|Review in HubSpot> \u2014 Please log feedback and update the loss reason if needed.",
        "otherOptions": {},
        "authentication": "oAuth2"
      },
      "typeVersion": 2
    },
    {
      "id": "41dba946-0d3d-4dcd-b15d-1cd8685c8101",
      "name": "Create HubSpot Note on Deal",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1216,
        0
      ],
      "parameters": {
        "url": "https://api.hubapi.com/crm/v3/objects/notes",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "properties",
              "value": "={{ JSON.stringify({ hs_note_body: 'Stage change notification sent automatically by n8n on ' + new Date().toLocaleString() + '. Stage: ' + $('Build Enriched Context').item.json.newStage + '. AI summary: ' + $('Generate AI Summary').item.json.message.content, hs_timestamp: new Date().getTime().toString() }) }}"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth"
      },
      "typeVersion": 4.2
    },
    {
      "id": "89ca8b02-49fe-485f-ae61-107cb6fc1b1c",
      "name": "Associate Note to Deal",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -992,
        0
      ],
      "parameters": {
        "url": "=https://api.hubapi.com/crm/v3/objects/notes/{{ $json.id }}/associations/deals/{{ $('Build Enriched Context').item.json.dealId }}/note_to_deal",
        "method": "PUT",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "typeVersion": 4.2
    },
    {
      "id": "0c128427-dc62-462a-931f-46c14169a2c3",
      "name": "Slack - Error Alert",
      "type": "n8n-nodes-base.slack",
      "position": [
        -768,
        0
      ],
      "parameters": {
        "text": "\u26a0\ufe0f *WORKFLOW ERROR \u2014 Pipeline Stage Notifier*\n\n*Time:* {{ new Date().toISOString() }}\n*Deal ID:* {{ $('HubSpot Trigger').item.json.objectId }}\n*Error:* {{ $json.message || 'Unknown error' }}\n*Node:* {{ $json.context?.nodeName || 'Unknown node' }}\n\nPlease check your n8n instance and review the execution log.",
        "otherOptions": {},
        "authentication": "oAuth2"
      },
      "typeVersion": 2
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "ee6eb719-43fc-4da1-95f7-125e60be1732",
  "connections": {
    "HubSpot Trigger": {
      "main": [
        [
          {
            "node": "Is Real Stage Change?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Deal Data": {
      "main": [
        [
          {
            "node": "Generate AI Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Deal Details": {
      "main": [
        [
          {
            "node": "Format Deal Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "High Value Deal?": {
      "main": [
        [
          {
            "node": "Slack - Leadership Channel",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Slack - Sales Team Channel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Owner Details": {
      "main": [
        [
          {
            "node": "Merge Deal Context",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Deal Context": {
      "main": [
        [
          {
            "node": "Build Enriched Context",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate AI Summary": {
      "main": [
        [
          {
            "node": "High Value Deal?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Contact Details": {
      "main": [
        [
          {
            "node": "Merge Deal Context",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Won / Lost / Other?": {
      "main": [
        [
          {
            "node": "Gmail - Congrats to Owner",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Slack - Loss Alert to Management",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log to Google Sheets": {
      "main": [
        [
          {
            "node": "Get Owner Details",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get Contact Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Real Stage Change?": {
      "main": [
        [
          {
            "node": "Get Deal Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Associate Note to Deal": {
      "main": [
        [
          {
            "node": "Slack - Error Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Enriched Context": {
      "main": [
        [
          {
            "node": "Won / Lost / Other?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail - Congrats to Owner": {
      "main": [
        [
          {
            "node": "Create HubSpot Note on Deal",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Slack - Leadership Channel": {
      "main": [
        [
          {
            "node": "Log to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Slack - Sales Team Channel": {
      "main": [
        [
          {
            "node": "Log to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create HubSpot Note on Deal": {
      "main": [
        [
          {
            "node": "Associate Note to Deal",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Slack - Loss Alert to Management": {
      "main": [
        [
          {
            "node": "Create HubSpot Note on Deal",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}