{
  "name": "Automate product Hunt lead generation with Apify and Google Sheets",
  "nodes": [
    {
      "id": "b6f854c1-97c9-436d-baa8-3c6d27e62aac",
      "name": "Prepare CC",
      "type": "n8n-nodes-base.set",
      "position": [
        5200,
        1360
      ]
    },
    {
      "id": "f4b164b1-7346-4e55-bcc1-f0433384668c",
      "name": "Schedule Trigger1",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -448,
        1552
      ]
    },
    {
      "id": "d6fb37d1-3993-4b62-a90b-0403e45fd78c",
      "name": "Build Config2",
      "type": "n8n-nodes-base.code",
      "position": [
        -480,
        1120
      ]
    },
    {
      "id": "9cb61676-8767-4398-9573-6aa2fcf99fdd",
      "name": "Check Schedule Trigger2",
      "type": "n8n-nodes-base.if",
      "position": [
        -320,
        1120
      ]
    },
    {
      "id": "2b48af2a-2be9-448f-a165-0ea08389f35d",
      "name": "Fetch Webhook Status2",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        96,
        816
      ]
    },
    {
      "id": "9dbac284-5712-4aae-874c-d6d6f1caf9cc",
      "name": "Check Webhook Exists2",
      "type": "n8n-nodes-base.if",
      "position": [
        368,
        816
      ]
    },
    {
      "id": "d4a9a3da-74e7-44e8-a433-9c05387521e5",
      "name": "Create External Webhook2",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        608,
        832
      ]
    },
    {
      "id": "32232b9e-01e4-4c15-8bc8-190f6ad4bb77",
      "name": "Mark Webhook as Created2",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        848,
        832
      ]
    },
    {
      "id": "6f6dba84-d9a5-41ff-8e3b-05c3bc78c00d",
      "name": "Check Weekly Run (Monday)2",
      "type": "n8n-nodes-base.if",
      "position": [
        1120,
        800
      ]
    },
    {
      "id": "f4e40d0e-e333-4abb-a4da-fca7a06e7a0b",
      "name": "Combine Run IDs2",
      "type": "n8n-nodes-base.code",
      "position": [
        2096,
        816
      ]
    },
    {
      "id": "b4d5261b-885a-41e8-8c26-43c9cd03b479",
      "name": "Store Run Data2",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        2336,
        816
      ]
    },
    {
      "id": "62def64c-d289-4355-827c-5da9f369fe17",
      "name": "Receive Apify Webhook2",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -448,
        1328
      ]
    },
    {
      "id": "64ca4f11-85fb-48ed-80e5-1cc62c6bd0d5",
      "name": "Fetch RUNS Data2",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        128,
        1392
      ]
    },
    {
      "id": "5e638145-58d9-45a3-b7fd-adef57fa12e7",
      "name": "Update Run Status2",
      "type": "n8n-nodes-base.code",
      "position": [
        368,
        1392
      ]
    },
    {
      "id": "03abb432-7ada-4d6e-9db5-f946a3a21110",
      "name": "Save Updated RUNS Data1",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        608,
        1392
      ]
    },
    {
      "id": "e0e0af51-ce79-445e-a637-7c9d1dff29f8",
      "name": "Extract Dataset IDs2",
      "type": "n8n-nodes-base.code",
      "position": [
        1184,
        1360
      ]
    },
    {
      "id": "88a39276-0118-417d-91df-74ad8df35889",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        832,
        1360
      ]
    },
    {
      "id": "da30a26b-3d66-4095-841e-5a1bb7dca1aa",
      "name": "Run Actor \"Daily Top Products\"2",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1792,
        816
      ]
    },
    {
      "id": "b024f6aa-cdf8-47aa-9494-f5daa3b9cd41",
      "name": "Run Actor \"Weekly Top Products\"2",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1440,
        784
      ]
    },
    {
      "id": "fb46df71-3673-495f-ba11-097c342a39eb",
      "name": "Create Daily Log Sheet2",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        128,
        1808
      ]
    },
    {
      "id": "f8299139-6d8f-4d3f-8e0c-90e581df9eac",
      "name": "Extract Sheet Info2",
      "type": "n8n-nodes-base.code",
      "position": [
        384,
        1808
      ]
    },
    {
      "id": "12bc382d-0463-4751-a581-4092ed0f89ac",
      "name": "Store Sheet Metadata2",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        640,
        1808
      ]
    },
    {
      "id": "502c90d2-dcd0-4394-92fe-00d489a362ca",
      "name": "Loop Over Sub Items2",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1888,
        1360
      ]
    },
    {
      "id": "5e380a37-ec76-443a-a3d0-07aab84ca6bb",
      "name": "Map Category by Topic2",
      "type": "n8n-nodes-base.code",
      "position": [
        2832,
        1360
      ]
    },
    {
      "id": "b3d8e89b-6532-4df8-b0bb-7964320d229d",
      "name": "Prepare Request Body2",
      "type": "n8n-nodes-base.code",
      "position": [
        3712,
        1360
      ]
    },
    {
      "id": "00bd85d7-676c-48d6-9ddb-d2b4531e8242",
      "name": "Get Sheet Metadata2",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        3952,
        1360
      ]
    },
    {
      "id": "c58b48b7-102c-4b89-9f05-726ab179e4a7",
      "name": "Parse Sheet IDs2",
      "type": "n8n-nodes-base.code",
      "position": [
        4144,
        1360
      ]
    },
    {
      "id": "ccf9b354-6f29-472f-8912-5d48cff146ff",
      "name": "Check if Skipped2",
      "type": "n8n-nodes-base.if",
      "position": [
        4368,
        1360
      ]
    },
    {
      "id": "0e1ae0f8-ba1b-4961-b88b-b672785851ee",
      "name": "Prepare Error Row2",
      "type": "n8n-nodes-base.code",
      "position": [
        4544,
        1824
      ]
    },
    {
      "id": "788020ee-6ee6-4e1f-a5ed-1aaa91f14baf",
      "name": "Format API Result for Sheet2",
      "type": "n8n-nodes-base.code",
      "position": [
        4672,
        1376
      ]
    },
    {
      "id": "29db543c-dc9d-4cc9-944d-cfcac956fa73",
      "name": "Sticky Note133",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4592,
        1232
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "d15f73a8-7e88-4abf-860d-87a8d8c62a0f",
      "name": "Check Owner Email Exists2",
      "type": "n8n-nodes-base.if",
      "position": [
        4912,
        1376
      ]
    },
    {
      "id": "0d823f08-eb43-455b-8dba-5c23dcf3af76",
      "name": "Verify Email Sent Successfully2",
      "type": "n8n-nodes-base.if",
      "position": [
        5648,
        1360
      ]
    },
    {
      "id": "9a9c1064-5f42-4a65-bd6a-7728cb85b659",
      "name": "Log API Result to Google Sheet2",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        6304,
        1824
      ]
    },
    {
      "id": "b7d54d21-6d9c-48b0-9684-cc8588138825",
      "name": "Summarize Daily Stats2",
      "type": "n8n-nodes-base.code",
      "position": [
        2512,
        1792
      ]
    },
    {
      "id": "225859a3-7bf3-4662-88ad-941f8f273b66",
      "name": "Log Daily Summary to Sheet2",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2784,
        1792
      ]
    },
    {
      "id": "443d7085-bb40-435e-8554-1734a82ec47f",
      "name": "Get Daily Activities to Sheet2",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2224,
        1792
      ]
    },
    {
      "id": "1f699334-c87a-4463-a166-963617e815c7",
      "name": "Aggregate Batch Results2",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1984,
        1792
      ]
    },
    {
      "id": "396fdd36-8789-4f8f-8263-b580d09a28f5",
      "name": "Clear Old Run Data2",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        3024,
        1792
      ]
    },
    {
      "id": "9f1cb6cb-abe6-4fe9-b4a3-1fc5d85fd321",
      "name": "Prepare Scraper Payload1",
      "type": "n8n-nodes-base.code",
      "position": [
        3088,
        1360
      ]
    },
    {
      "id": "97123efb-df40-4664-985b-721b73737774",
      "name": "Get Contact Scraper1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3344,
        1360
      ]
    },
    {
      "id": "8314d322-4d53-467c-a335-ac2c3e7f339b",
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2240,
        1376
      ]
    },
    {
      "id": "16ed229b-564a-45cc-a669-d54234748d89",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        2528,
        1392
      ]
    },
    {
      "id": "d33e936f-b6f5-4b40-bc95-2af1c72bb9d7",
      "name": "If1",
      "type": "n8n-nodes-base.if",
      "position": [
        3520,
        1360
      ]
    },
    {
      "id": "d8ba6159-25c9-4ac5-b92a-6b4f728a35ce",
      "name": "Send a message",
      "type": "n8n-nodes-base.gmail",
      "position": [
        5424,
        1360
      ]
    },
    {
      "id": "cb98f79a-22fa-4450-bcac-1497584a76a5",
      "name": "Handle Email Failed",
      "type": "n8n-nodes-base.code",
      "position": [
        5888,
        1824
      ]
    },
    {
      "id": "1667ba94-ae37-48cd-87a0-591e3471c4a0",
      "name": "Handle Email Success",
      "type": "n8n-nodes-base.code",
      "position": [
        6112,
        1824
      ]
    },
    {
      "id": "823fa7c4-5488-42fb-a42b-050cf8fc08ac",
      "name": "Handle No Email",
      "type": "n8n-nodes-base.code",
      "position": [
        5248,
        1824
      ]
    },
    {
      "id": "eaadb8f6-9663-43b6-b31b-8dcb6c18cf87",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5152,
        400
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "8b084b4e-b3ad-4e68-a573-eb3ca4e4264c",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        64,
        1712
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "0f207eab-0a0a-4bd6-b1c2-064b56c79f31",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        48,
        720
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "c37e5bc4-6c1b-40ca-ac35-cf669afa763c",
      "name": "Deduplicate2",
      "type": "n8n-nodes-base.code",
      "position": [
        1616,
        1360
      ]
    },
    {
      "id": "e4a24245-4974-4ef7-ac7e-1b1952e5ebb4",
      "name": "Fetch Dataset Items2",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1392,
        1360
      ]
    },
    {
      "id": "bde3b242-6fd7-47f7-b4bb-45d6dca2bb98",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        48,
        1232
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "c48683a2-c668-4b46-a6a8-e70418f3214f",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1808,
        1232
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "7a727437-7557-4ece-8538-e96b2caa7ac6",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1104,
        992
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    }
  ],
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Map Category by Topic2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop Over Sub Items2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If1": {
      "main": [
        [
          {
            "node": "Prepare Request Body2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop Over Sub Items2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "Extract Dataset IDs2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Extract Dataset IDs2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare CC": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Deduplicate2": {
      "main": [
        [
          {
            "node": "Loop Over Sub Items2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop Over Sub Items2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Config2": {
      "main": [
        [
          {
            "node": "Check Schedule Trigger2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send a message": {
      "main": [
        [
          {
            "node": "Verify Email Sent Successfully2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Handle No Email": {
      "main": [
        [
          {
            "node": "Log API Result to Google Sheet2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Combine Run IDs2": {
      "main": [
        [
          {
            "node": "Store Run Data2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch RUNS Data2": {
      "main": [
        [
          {
            "node": "Update Run Status2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Sheet IDs2": {
      "main": [
        [
          {
            "node": "Check if Skipped2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if Skipped2": {
      "main": [
        [
          {
            "node": "Prepare Error Row2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Format API Result for Sheet2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger1": {
      "main": [
        [
          {
            "node": "Build Config2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Error Row2": {
      "main": [
        [
          {
            "node": "Log API Result to Google Sheet2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Run Status2": {
      "main": [
        [
          {
            "node": "Save Updated RUNS Data1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Sheet Info2": {
      "main": [
        [
          {
            "node": "Store Sheet Metadata2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Sheet Metadata2": {
      "main": [
        [
          {
            "node": "Parse Sheet IDs2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Handle Email Failed": {
      "main": [
        [
          {
            "node": "Log API Result to Google Sheet2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Dataset IDs2": {
      "main": [
        [
          {
            "node": "Fetch Dataset Items2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Dataset Items2": {
      "main": [
        [
          {
            "node": "Deduplicate2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Contact Scraper1": {
      "main": [
        [
          {
            "node": "If1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Handle Email Success": {
      "main": [
        [
          {
            "node": "Log API Result to Google Sheet2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Sub Items2": {
      "main": [
        [
          {
            "node": "Aggregate Batch Results2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Webhook Exists2": {
      "main": [
        [
          {
            "node": "Check Weekly Run (Monday)2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create External Webhook2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Webhook Status2": {
      "main": [
        [
          {
            "node": "Check Webhook Exists2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Request Body2": {
      "main": [
        [
          {
            "node": "Get Sheet Metadata2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Map Category by Topic2": {
      "main": [
        [
          {
            "node": "Prepare Scraper Payload1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Receive Apify Webhook2": {
      "main": [
        [
          {
            "node": "Build Config2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Summarize Daily Stats2": {
      "main": [
        [
          {
            "node": "Log Daily Summary to Sheet2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Schedule Trigger2": {
      "main": [
        [
          {
            "node": "Fetch Webhook Status2",
            "type": "main",
            "index": 0
          },
          {
            "node": "Create Daily Log Sheet2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Fetch RUNS Data2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Daily Log Sheet2": {
      "main": [
        [
          {
            "node": "Extract Sheet Info2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Updated RUNS Data1": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Batch Results2": {
      "main": [
        [
          {
            "node": "Get Daily Activities to Sheet2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create External Webhook2": {
      "main": [
        [
          {
            "node": "Mark Webhook as Created2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mark Webhook as Created2": {
      "main": [
        [
          {
            "node": "Check Weekly Run (Monday)2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Scraper Payload1": {
      "main": [
        [
          {
            "node": "Get Contact Scraper1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Owner Email Exists2": {
      "main": [
        [
          {
            "node": "Prepare CC",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Handle No Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Weekly Run (Monday)2": {
      "main": [
        [
          {
            "node": "Run Actor \"Weekly Top Products\"2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Run Actor \"Daily Top Products\"2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log Daily Summary to Sheet2": {
      "main": [
        [
          {
            "node": "Clear Old Run Data2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format API Result for Sheet2": {
      "main": [
        [
          {
            "node": "Check Owner Email Exists2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Daily Activities to Sheet2": {
      "main": [
        [
          {
            "node": "Summarize Daily Stats2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log API Result to Google Sheet2": {
      "main": [
        [
          {
            "node": "Loop Over Sub Items2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Actor \"Daily Top Products\"2": {
      "main": [
        [
          {
            "node": "Combine Run IDs2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Verify Email Sent Successfully2": {
      "main": [
        [
          {
            "node": "Handle Email Failed",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Handle Email Success",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Actor \"Weekly Top Products\"2": {
      "main": [
        [
          {
            "node": "Run Actor \"Daily Top Products\"2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}