{
  "name": "Automate lead ranking & task creation with Google Sheets + ClickUp",
  "nodes": [
    {
      "id": "f6fbaebc-f91b-4f31-810b-945d282a29b2",
      "name": "Manual Trigger",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        944,
        704
      ]
    },
    {
      "id": "6dab30f9-0b1c-463f-909c-0b9239dbf1cd",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        496,
        624
      ],
      "parameters": {
        "width": 380,
        "height": 280,
        "content": "## 🚀 Workflow Start\n\nThis workflow automatically identifies and queues your highest-priority leads for follow-up.\n\n**What it does:**\n- Reads lead data from Google Sheets\n- Calculates priority scores b"
      }
    },
    {
      "id": "24b80916-7fbf-415c-89fe-ec198bf10623",
      "name": "Read Leads from Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1168,
        704
      ]
    },
    {
      "id": "68039cea-d1b3-4395-88e9-ea530e8d2eec",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1056,
        352
      ],
      "parameters": {
        "width": 300,
        "height": 332,
        "content": "## 📊 Step 1: Read Lead Data\n\nFetches all leads from Google Sheet 'Sheet1'.\n\n**Expected columns:**\n- Lead Name\n- Last_Contact_Date\n- Engagement_Score\n- Timezone\n- Email\n- Status"
      }
    },
    {
      "id": "a11cadaa-c5e6-4f36-8c09-be885e0484b0",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1296,
        864
      ],
      "parameters": {
        "width": 300,
        "height": 304,
        "content": "## ⏰ Step 2: Calculate Recency\n\nCalculates days since last contact for each lead.\n\n**Logic:**\n- Takes Last_Contact_Date\n- Compares with today\n- Adds Days_Since_Last_Contact field\n\n*Longer gaps = highe"
      }
    },
    {
      "id": "58f3405e-6db0-4dee-8efc-704f460299d8",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1536,
        320
      ],
      "parameters": {
        "width": 300,
        "height": 340,
        "content": "## 🎯 Step 3: Calculate Priority\n\nCreates a Priority_Score for each lead.\n\n**Formula:**\n- 70% Engagement Score\n- 30% Recency Score\n\n**Example:**\nEngagement: 80/100\nDays since contact: 5\nRecency: 95/100"
      }
    },
    {
      "id": "3501da06-dcb6-403a-96d1-8b8524958f7e",
      "name": "Sort by Priority Score",
      "type": "n8n-nodes-base.sort",
      "position": [
        1840,
        704
      ]
    },
    {
      "id": "367e537c-63b2-47bb-86b3-96102cc54081",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1776,
        880
      ],
      "parameters": {
        "width": 280,
        "height": 164,
        "content": "## 📈 Step 4: Sort Leads\n\nSorts all leads by Priority_Score in descending order.\n\nHighest priority leads appear first."
      }
    },
    {
      "id": "b7f1fd67-804a-4f67-9817-e6be404a2aff",
      "name": "Select Top 10 Leads",
      "type": "n8n-nodes-base.limit",
      "position": [
        2064,
        704
      ]
    },
    {
      "id": "024f813e-41c8-42fb-a6c4-3a61b3d4232b",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2000,
        400
      ],
      "parameters": {
        "width": 280,
        "height": 264,
        "content": "## 🔝 Step 5: Filter Top Leads\n\nSelects only the top 10 highest-priority leads.\n\n**Adjustable:**\nChange maxItems to get more/fewer leads.\n\nCurrent setting: Top 10"
      }
    },
    {
      "id": "a2905675-38e1-4ebb-892b-e428af5245f9",
      "name": "Suggest Optimal Send Time",
      "type": "n8n-nodes-base.function",
      "position": [
        2288,
        704
      ]
    },
    {
      "id": "a46f0103-bcdc-4d4b-957e-a2d0d1b8d532",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2224,
        880
      ],
      "parameters": {
        "width": 300,
        "height": 320,
        "content": "## 🕐 Step 6: Time Optimization\n\nSuggests best time to contact each lead based on their timezone.\n\n**Time zones supported:**\n- IST: 10:00 AM\n- PST: 9:00 AM\n- EST: 9:30 AM\n- GMT: 9:00 AM\n\n*Maximizes res"
      }
    },
    {
      "id": "2545f230-e090-413c-aec2-b02c1b82fc62",
      "name": "Create ClickUp Task",
      "type": "n8n-nodes-base.clickUp",
      "position": [
        2512,
        704
      ]
    },
    {
      "id": "15b9e908-0b83-4256-b1e5-50fda3da8c51",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2464,
        336
      ],
      "parameters": {
        "width": 300,
        "height": 320,
        "content": "## ✅ Step 7: Create Tasks\n\nCreates a ClickUp task for each priority lead.\n\n**Task includes:**\n- Lead name\n- Priority score\n- Last contact date\n- Suggested send time\n- Engagement data\n\n*Ready for actio"
      }
    },
    {
      "id": "437dec32-0caf-4493-ab5e-e530b8ec7803",
      "name": "Update Sheet - Mark as Queued",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2736,
        704
      ]
    },
    {
      "id": "4c1dfd1b-b7c2-474b-b9be-0d0b3d40c7cc",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2688,
        912
      ],
      "parameters": {
        "width": 300,
        "height": 268,
        "content": "## 📝 Step 8: Update Records\n\nWrites results back to Sheet2 with:\n- Priority scores\n- Days since contact\n- Suggested send times\n- Queue status\n\n*Keeps your data synchronized*"
      }
    },
    {
      "id": "3bba318c-52ef-49ff-95ff-ed546bb0fcf9",
      "name": "Calculate Days Since Contact1",
      "type": "n8n-nodes-base.function",
      "position": [
        1392,
        704
      ]
    },
    {
      "id": "5875baa9-f729-4f6c-872a-9f621b9470dc",
      "name": "Calculate Priority Score1",
      "type": "n8n-nodes-base.function",
      "position": [
        1616,
        704
      ]
    }
  ],
  "connections": {
    "Manual Trigger": {
      "main": [
        [
          {
            "node": "Read Leads from Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create ClickUp Task": {
      "main": [
        [
          {
            "node": "Update Sheet - Mark as Queued",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Select Top 10 Leads": {
      "main": [
        [
          {
            "node": "Suggest Optimal Send Time",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read Leads from Sheet": {
      "main": [
        [
          {
            "node": "Calculate Days Since Contact1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sort by Priority Score": {
      "main": [
        [
          {
            "node": "Select Top 10 Leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Priority Score1": {
      "main": [
        [
          {
            "node": "Sort by Priority Score",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Suggest Optimal Send Time": {
      "main": [
        [
          {
            "node": "Create ClickUp Task",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Days Since Contact1": {
      "main": [
        [
          {
            "node": "Calculate Priority Score1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}