{
  "name": "Automate inactive deal cleanup from GoHighLevel to Slack and Sheets",
  "nodes": [
    {
      "id": "a30f842e-09db-4524-bb2a-f6fb696cd818",
      "name": "Workflow Description",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1408,
        -96
      ],
      "parameters": {
        "width": 386,
        "height": 400,
        "content": "## 🎯 Workflow Overview\n\nThis workflow automatically identifies and archives inactive deals in HighLevel CRM pipelines.\n\n**What it does:**\n- Runs daily to check all opportunities\n- Filters deals with n"
      }
    },
    {
      "id": "0558197c-899a-470f-93b0-131da334b0f7",
      "name": "Schedule Setup",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -992,
        -400
      ],
      "parameters": {
        "width": 282,
        "height": 311,
        "content": "## ⏰ Schedule Configuration\n\n**Current:** Runs daily at 9 AM\n\n**To modify:**\n1. Click this node\n2. Adjust cron expression\n3. Common patterns:\n   - Every 6 hours: `0 */6 * * *`\n   - Twice daily: `0 9,1"
      }
    },
    {
      "id": "86b8ca02-40c9-4f1d-8192-8c076eb62bc6",
      "name": "Daily at 9 AM",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -800,
        -64
      ]
    },
    {
      "id": "860e1aca-04f7-4001-a58b-d2fa695da3e1",
      "name": "HighLevel Configuration",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -688,
        112
      ],
      "parameters": {
        "width": 264,
        "height": 274,
        "content": "## 📊 HighLevel Setup\n\n**Required:**\n- OAuth2 credentials configured\n- Location ID in credential settings\n\n**This fetches:**\n- All opportunities from your account\n- Includes contact data\n- No paginatio"
      }
    },
    {
      "id": "9d54a579-e7b9-4d02-a1cd-58f76ebf4c73",
      "name": "Fetch All Opportunities",
      "type": "n8n-nodes-base.highLevel",
      "position": [
        -576,
        -64
      ]
    },
    {
      "id": "6f31695d-a18d-46c1-aa00-3ce68013db10",
      "name": "Filter Logic",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -496,
        -384
      ],
      "parameters": {
        "width": 262,
        "height": 296,
        "content": "## 🔍 Inactivity Filter\n\n**Logic:**\n- Calculates days since last activity\n- Uses `last_activity_at` or `updatedAt`\n- Threshold: **10 days**\n\n**To adjust threshold:**\nChange `10` in the rightValue field"
      }
    },
    {
      "id": "09134267-b553-4979-9be3-d3e74e263b74",
      "name": "Filter Deals Inactive 10+ Days",
      "type": "n8n-nodes-base.filter",
      "position": [
        -352,
        -64
      ]
    },
    {
      "id": "b9dd983f-bbba-4956-85fd-d3813997f27b",
      "name": "Archive Configuration",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -192,
        112
      ],
      "parameters": {
        "width": 254,
        "height": 264,
        "content": "## 📦 Archive Action\n\n**What happens:**\n- Updates opportunity status\n- Marks as archived/closed\n- Preserves all deal data\n\n**Note:** Configure the `status` field in updateFields to match your HighLevel"
      }
    },
    {
      "id": "dc7991c7-79ad-48a3-b79d-d8359afa4d8c",
      "name": "Archive Inactive Deal",
      "type": "n8n-nodes-base.highLevel",
      "position": [
        -128,
        -64
      ]
    },
    {
      "id": "7f905180-3a1a-4b6f-b049-438b49d50929",
      "name": "Processing Logic",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        48,
        -288
      ],
      "parameters": {
        "width": 256,
        "height": 296,
        "content": "## 🧮 Data Processing\n\n**Transforms deal data:**\n- Calculates days inactive\n- Extracts contact info\n- Formats for Google Sheets\n- Adds metadata fields\n\n**Output fields:**\nid, name, contactName, daysSin"
      }
    },
    {
      "id": "7fe4471f-287d-4319-8ab0-02f245d9c8f2",
      "name": "Format Deal Data",
      "type": "n8n-nodes-base.code",
      "position": [
        112,
        32
      ]
    },
    {
      "id": "909dfef7-0703-4893-9465-e806445e492e",
      "name": "Sheets Configuration",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        368,
        224
      ],
      "parameters": {
        "width": 278,
        "height": 346,
        "content": "## 📋 Google Sheets Setup\n\n**Required:**\n1. Create Google Sheet\n2. Add sheet named \"Inactive Pipeliner\"\n3. Connect OAuth2 credential\n4. Replace documentId below\n\n**Columns auto-created:**\nid, name, con"
      }
    },
    {
      "id": "046731cb-c515-4430-ba58-f75b46797401",
      "name": "Log to Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        400,
        64
      ]
    },
    {
      "id": "3a9b90d5-901f-4dd8-a118-cf76b3da61f5",
      "name": "Slack Setup",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        576,
        -304
      ],
      "parameters": {
        "width": 246,
        "height": 328,
        "content": "## 💬 Slack Notification\n\n**Setup:**\n1. Connect Slack OAuth2\n2. Select your channel\n3. Remove hardcoded channel ID\n\n**Message includes:**\n- Total archived count\n- Sum of monetary values\n- List of deal "
      }
    },
    {
      "id": "e1acc249-b80a-4d7d-aa63-b6265b641170",
      "name": "Send Slack Report",
      "type": "n8n-nodes-base.slack",
      "position": [
        432,
        -128
      ]
    }
  ],
  "connections": {
    "Daily at 9 AM": {
      "main": [
        [
          {
            "node": "Fetch All Opportunities",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Deal Data": {
      "main": [
        [
          {
            "node": "Log to Google Sheets",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send Slack Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Archive Inactive Deal": {
      "main": [
        [
          {
            "node": "Format Deal Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch All Opportunities": {
      "main": [
        [
          {
            "node": "Filter Deals Inactive 10+ Days",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Deals Inactive 10+ Days": {
      "main": [
        [
          {
            "node": "Archive Inactive Deal",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}