{
  "id": "wGg4P4JbGq25qxy4",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Product Hunt Lead Generator",
  "tags": [],
  "nodes": [
    {
      "id": "b6f854c1-97c9-436d-baa8-3c6d27e62aac",
      "name": "Prepare CC",
      "type": "n8n-nodes-base.set",
      "notes": "Prepare CC Emails\nConverts the \u201cother_emails\u201d array into a comma-separated string.\nResult saved as field \u201ccc\u201d for direct use in the email node.",
      "position": [
        5200,
        1360
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 3.4
    },
    {
      "id": "f4b164b1-7346-4e55-bcc1-f0433384668c",
      "name": "Schedule Trigger1",
      "type": "n8n-nodes-base.scheduleTrigger",
      "notes": "## Daily 9AM Trigger \nThis node runs the workflow every day at 9 AM.\nIt starts the automation that checks whether the\nworkflow should perform daily or weekly actions.",
      "position": [
        -448,
        1552
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 1.2
    },
    {
      "id": "d6fb37d1-3993-4b62-a90b-0403e45fd78c",
      "name": "Build Config2",
      "type": "n8n-nodes-base.code",
      "notes": "## Build Config\nThis node creates a config object that stores:\n  - Schedule info (day/time)\n  - Data table and API URLs\n  - External scraper setup (daily + weekly modes)\n  - Webhook configuration details\n  - Email metadata and URLs",
      "position": [
        -480,
        1120
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 2,
      "alwaysOutputData": true
    },
    {
      "id": "9cb61676-8767-4398-9573-6aa2fcf99fdd",
      "name": "Check Schedule Trigger2",
      "type": "n8n-nodes-base.if",
      "position": [
        -320,
        1120
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "2b48af2a-2be9-448f-a165-0ea08389f35d",
      "name": "Fetch Webhook Status2",
      "type": "n8n-nodes-base.dataTable",
      "notes": "Fetches from the Data Table to see if a webhook\nhas already been created.\n\nLooks for the row where:\n  key = \"IS_WEBHOOK_CREATED\"\n  value = \"1\"\n\nIf found \u2192 webhook already exists.\nIf not \u2192 workflow proceeds to create a new one.",
      "position": [
        96,
        816
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "9dbac284-5712-4aae-874c-d6d6f1caf9cc",
      "name": "Check Webhook Exists2",
      "type": "n8n-nodes-base.if",
      "notes": "If YES \u2192 webhook exists \u2192 skip creation.\nIf NO \u2192 webhook missing \u2192 go create one.",
      "position": [
        368,
        816
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 2.2
    },
    {
      "id": "d4a9a3da-74e7-44e8-a433-9c05387521e5",
      "name": "Create External Webhook2",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "Creates a new webhook using Apify's API.\n\nThe webhook configuration is taken from\nthe 'Build Config' node (payload.webhook object).\n\nUses authenticated POST request to:\n  {{ $('Build Config').item.json.externalScraper.baseUrl }}/webhooks",
      "position": [
        608,
        832
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 4.2
    },
    {
      "id": "32232b9e-01e4-4c15-8bc8-190f6ad4bb77",
      "name": "Mark Webhook as Created2",
      "type": "n8n-nodes-base.dataTable",
      "notes": "Inserts a new row into the Data Table to record\nthat the webhook has been successfully created.\n\nAdds:\n  key: \"IS_WEBHOOK_CREATED\"\n  value: \"1\"\n\nThis prevents duplicate webhook creation in future runs.",
      "position": [
        848,
        832
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 1
    },
    {
      "id": "6f6dba84-d9a5-41ff-8e3b-05c3bc78c00d",
      "name": "Check Weekly Run (Monday)2",
      "type": "n8n-nodes-base.if",
      "notes": "Compares today's day (currentDay) with the configured weeklyDay (Monday)\nfrom the 'Build Config' node.\n\nIf it's Monday \u2192 weekly actions can run + daily actions\nIf not \u2192 only daily actions proceed.",
      "position": [
        1120,
        800
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 2.2
    },
    {
      "id": "f4e40d0e-e333-4abb-a4da-fca7a06e7a0b",
      "name": "Combine Run IDs2",
      "type": "n8n-nodes-base.code",
      "notes": "Merges the results of the weekly and daily scrapes.\n\nCreates a map of run IDs \u2192 dataset IDs, marking each as:\n  status: false (not processed yet)\n\nIf today matches the weekly day (Monday), it includes both;\notherwise, only daily data.\n\nReturns:\n  {\n    ids: { runId: { status, datasetId } },\n    succeeded: 0\n  }",
      "position": [
        2096,
        816
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 2
    },
    {
      "id": "b4d5261b-885a-41e8-8c26-43c9cd03b479",
      "name": "Store Run Data2",
      "type": "n8n-nodes-base.dataTable",
      "notes": "Saves the run results into the Data Table.\n\nInserts a row:\n  key: \"RUNS\"\n  value: JSON.stringify($json)\n\nThis keeps track of all created Apify runs\nfor later processing or analysis.",
      "position": [
        2336,
        816
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "62def64c-d289-4355-827c-5da9f369fe17",
      "name": "Receive Apify Webhook2",
      "type": "n8n-nodes-base.webhook",
      "notes": "Receives incoming Apify webhook events.\n\nUsed to detect when an Apify run finishes.\nThe payload includes:\n  - eventType\n  - resource.id (Apify run ID)\n  - userId, createdAt, etc.\n\nTriggers workflow to update Data Table with the run status.",
      "position": [
        -448,
        1328
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 2.1
    },
    {
      "id": "64ca4f11-85fb-48ed-80e5-1cc62c6bd0d5",
      "name": "Fetch RUNS Data2",
      "type": "n8n-nodes-base.dataTable",
      "notes": "Fetches the \"RUNS\" record from the Data Table.\n\nEach RUNS entry tracks Apify run IDs, dataset IDs,\nand their completion status.\n\nUsed to check and update run progress when webhook arrives.",
      "position": [
        128,
        1392
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "5e638145-58d9-45a3-b7fd-adef57fa12e7",
      "name": "Update Run Status2",
      "type": "n8n-nodes-base.code",
      "notes": "Parses the \"RUNS\" JSON value from the Data Table.\n\nFinds the Apify run ID from the incoming webhook (webId)\nand marks it as completed:\n  payload.ids[webId].status = true\n  payload.succeeded += 1\n\nThen returns the updated payload for writing back.",
      "position": [
        368,
        1392
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 2
    },
    {
      "id": "03abb432-7ada-4d6e-9db5-f946a3a21110",
      "name": "Save Updated RUNS Data1",
      "type": "n8n-nodes-base.dataTable",
      "notes": "Updates the existing \"RUNS\" row in the Data Table\nwith the modified payload returned by the Code node.\n\nOverwrites the value column with the new JSON string:\n  {\n    ids: { ...run info... },\n    succeeded: <number>\n  }",
      "position": [
        608,
        1392
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 1
    },
    {
      "id": "e0e0af51-ce79-445e-a637-7c9d1dff29f8",
      "name": "Extract Dataset IDs2",
      "type": "n8n-nodes-base.code",
      "notes": "Extracts all dataset IDs from the \"RUNS\" payload.\n\nProcess:\n  1. Parses the JSON stored in Data Table 'value'\n  2. Collects each datasetId under parsed.ids\n  3. Returns one item per datasetId for parallel requests\n\nOutput Example:\n[\n  { \"datasetId\": \"abc123\" },\n  { \"datasetId\": \"xyz789\" }\n]",
      "position": [
        1184,
        1360
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 2
    },
    {
      "id": "88a39276-0118-417d-91df-74ad8df35889",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "notes": "## Decide Next Action \nApplies logic to decide what happens after updating the RUNS data.\n\nOutput branches:\n  - D&W: Both daily and weekly runs succeeded on same day\n  - onlyDay: Daily run succeeded only\n  - wrD&W: Weekly + daily runs incomplete\n  - wrD: Daily run incomplete\n\nThese outputs route the workflow to the proper follow-up path.",
      "onError": "continueRegularOutput",
      "position": [
        832,
        1360
      ],
      "parameters": {},
      "typeVersion": 3.3
    },
    {
      "id": "da30a26b-3d66-4095-841e-5a1bb7dca1aa",
      "name": "Run Actor \"Daily Top Products\"2",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "Runs the Apify Product Hunt scraper for *today*.\n\nPOSTs to the same actor endpoint as the weekly run,\nbut with the daily payload from\n'Build Config'\n\nThe output includes run ID and dataset ID for today\u2019s scrape.",
      "position": [
        1792,
        816
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 4.2
    },
    {
      "id": "b024f6aa-cdf8-47aa-9494-f5daa3b9cd41",
      "name": "Run Actor \"Weekly Top Products\"2",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "Runs the Apify Product Hunt scraper for the *previous week*.\n\nSends a POST request to Apify.\n\nUses payload from 'Build Config'.\n\nThe run ID and dataset ID returned will later be combined\nwith the daily data in the Code node.",
      "position": [
        1440,
        784
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 4.2
    },
    {
      "id": "fb46df71-3673-495f-ba11-097c342a39eb",
      "name": "Create Daily Log Sheet2",
      "type": "n8n-nodes-base.googleSheets",
      "notes": "Creates a new Google Sheet for today with two tabs (\u201cDaily Activities\u201d + \u201cDaily Summary\u201d).",
      "position": [
        128,
        1808
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 4.7
    },
    {
      "id": "f8299139-6d8f-4d3f-8e0c-90e581df9eac",
      "name": "Extract Sheet Info2",
      "type": "n8n-nodes-base.code",
      "notes": "Runs JavaScript to grab the sheet IDs and format them into one JSON string.",
      "position": [
        384,
        1808
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 2
    },
    {
      "id": "12bc382d-0463-4751-a581-4092ed0f89ac",
      "name": "Store Sheet Metadata2",
      "type": "n8n-nodes-base.dataTable",
      "notes": "Inserts that info into Data Table for later tracking.",
      "position": [
        640,
        1808
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 1
    },
    {
      "id": "502c90d2-dcd0-4394-92fe-00d489a362ca",
      "name": "Loop Over Sub Items2",
      "type": "n8n-nodes-base.splitInBatches",
      "notes": "Splits each batch into smaller chunks for URL checks.",
      "position": [
        1888,
        1360
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 3
    },
    {
      "id": "5e380a37-ec76-443a-a3d0-07aab84ca6bb",
      "name": "Map Category by Topic2",
      "type": "n8n-nodes-base.code",
      "notes": "Uses keyword matching to assign each project to a logical category (AI, Web Apps, etc).",
      "position": [
        2832,
        1360
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 2
    },
    {
      "id": "b3d8e89b-6532-4df8-b0bb-7964320d229d",
      "name": "Prepare Request Body2",
      "type": "n8n-nodes-base.code",
      "notes": "Validates project data and formats the final clean output for later use (e.g., API insert).",
      "position": [
        3712,
        1360
      ],
      "parameters": {},
      "executeOnce": false,
      "notesInFlow": true,
      "typeVersion": 2
    },
    {
      "id": "00bd85d7-676c-48d6-9ddb-d2b4531e8242",
      "name": "Get Sheet Metadata2",
      "type": "n8n-nodes-base.dataTable",
      "notes": "Fetches the stored Sheet row from Data Table.",
      "position": [
        3952,
        1360
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 1
    },
    {
      "id": "c58b48b7-102c-4b89-9f05-726ab179e4a7",
      "name": "Parse Sheet IDs2",
      "type": "n8n-nodes-base.code",
      "notes": "Converts the stored stringified sheet JSON back into an object so can use its properties in other nodes.",
      "position": [
        4144,
        1360
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 2
    },
    {
      "id": "ccf9b354-6f29-472f-8912-5d48cff146ff",
      "name": "Check if Skipped2",
      "type": "n8n-nodes-base.if",
      "notes": "Checks if _skip exists and is true in the \u201cPrepare Request Body\u201d node. If yes \u2192 log it to the sheet as an error. If no \u2192 send it to the API.",
      "position": [
        4368,
        1360
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 2.2
    },
    {
      "id": "0e1ae0f8-ba1b-4961-b88b-b672785851ee",
      "name": "Prepare Error Row2",
      "type": "n8n-nodes-base.code",
      "notes": "Builds a row with error info (status: error, errorMessage, etc.) for skipped items. Always outputs data even if logic fails.",
      "position": [
        4544,
        1824
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 2,
      "alwaysOutputData": true
    },
    {
      "id": "788020ee-6ee6-4e1f-a5ed-1aaa91f14baf",
      "name": "Format API Result for Sheet2",
      "type": "n8n-nodes-base.code",
      "notes": "Combines the API response with the product\u2019s original data for Google Sheet logging.",
      "position": [
        4672,
        1376
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 2
    },
    {
      "id": "29db543c-dc9d-4cc9-944d-cfcac956fa73",
      "name": "Sticky Note133",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4592,
        1232
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "d15f73a8-7e88-4abf-860d-87a8d8c62a0f",
      "name": "Check Owner Email Exists2",
      "type": "n8n-nodes-base.if",
      "notes": "Verifies if owner_email is present in the data from Prepare Request Body.",
      "position": [
        4912,
        1376
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 2.2
    },
    {
      "id": "0d823f08-eb43-455b-8dba-5c23dcf3af76",
      "name": "Verify Email Sent Successfully2",
      "type": "n8n-nodes-base.if",
      "notes": "Confirms that the email was accepted and delivered to the correct address.",
      "position": [
        5648,
        1360
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 2.2,
      "alwaysOutputData": false
    },
    {
      "id": "9a9c1064-5f42-4a65-bd6a-7728cb85b659",
      "name": "Log API Result to Google Sheet2",
      "type": "n8n-nodes-base.googleSheets",
      "notes": "This node appends the final formatted data (status, project ID, magic link, email status, and error message) to the **Daily Activities** sheet in the linked Google Spreadsheet.\nIt serves as the last step in the workflow to record each API run\u2019s outcome for tracking and analysis.",
      "position": [
        6304,
        1824
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 4.7
    },
    {
      "id": "b7d54d21-6d9c-48b0-9684-cc8588138825",
      "name": "Summarize Daily Stats2",
      "type": "n8n-nodes-base.code",
      "notes": "Groups all daily records by date, counting totals (processed, successful, duplicates, failures, and emails). Also calculates the daily failure rate to prepare a clean summary for reporting.",
      "position": [
        2512,
        1792
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 2
    },
    {
      "id": "225859a3-7bf3-4662-88ad-941f8f273b66",
      "name": "Log Daily Summary to Sheet2",
      "type": "n8n-nodes-base.googleSheets",
      "notes": "Appends the summarized daily stats into the **Daily Summary** sheet.\nUsed to keep a compact view of system activity and performance trends per day.",
      "position": [
        2784,
        1792
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 4.7
    },
    {
      "id": "443d7085-bb40-435e-8554-1734a82ec47f",
      "name": "Get Daily Activities to Sheet2",
      "type": "n8n-nodes-base.googleSheets",
      "notes": "This node gets all processed record details (success, duplicate, error, email status, etc.) to the Daily Activities sheet for raw data tracking.",
      "position": [
        2224,
        1792
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 4.7
    },
    {
      "id": "1f699334-c87a-4463-a166-963617e815c7",
      "name": "Aggregate Batch Results2",
      "type": "n8n-nodes-base.aggregate",
      "notes": "Collects and combines results from all processed batches into a single dataset.\nUseful for generating summaries or final output after looping is complete.",
      "position": [
        1984,
        1792
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 1
    },
    {
      "id": "396fdd36-8789-4f8f-8263-b580d09a28f5",
      "name": "Clear Old Run Data2",
      "type": "n8n-nodes-base.dataTable",
      "notes": "Deletes all rows from the Data Table except the one with the key **IS_WEBHOOK_CREATED**.\nThis ensures only the latest configuration entry is preserved before a new run begins.",
      "position": [
        3024,
        1792
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 1
    },
    {
      "id": "9f1cb6cb-abe6-4fe9-b4a3-1fc5d85fd321",
      "name": "Prepare Scraper Payload1",
      "type": "n8n-nodes-base.code",
      "notes": "Builds the request payload sent to the Contact Details Scraper on Apify.\nTakes project data, formats the structure, and prepares all fields the scraper needs.",
      "position": [
        3088,
        1360
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 2
    },
    {
      "id": "97123efb-df40-4664-985b-721b73737774",
      "name": "Get Contact Scraper1",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "Sends a synchronous POST request to Apify to get contact details",
      "position": [
        3344,
        1360
      ],
      "parameters": {},
      "notesInFlow": true,
      "retryOnFail": true,
      "typeVersion": 4.2,
      "alwaysOutputData": true
    },
    {
      "id": "8314d322-4d53-467c-a335-ac2c3e7f339b",
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "- Runs a single ping to the host domain extracted from the website URL.\n\n- If the host responds, it means the website is online and reachable.",
      "onError": "continueErrorOutput",
      "position": [
        2240,
        1376
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 4.3
    },
    {
      "id": "16ed229b-564a-45cc-a669-d54234748d89",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "notes": "- Reads the ping command output.\n\n- If the output includes \u201cbytes from\u201d, it marks the website as reachable.\n\n### Output Format:\n- website \u2192 The original site URL.\n\n- reachable \u2192 true if ping succeeded, false if it failed.",
      "position": [
        2528,
        1392
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 2.2
    },
    {
      "id": "d33e936f-b6f5-4b40-bc95-2af1c72bb9d7",
      "name": "If1",
      "type": "n8n-nodes-base.if",
      "position": [
        3520,
        1360
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "d8ba6159-25c9-4ac5-b92a-6b4f728a35ce",
      "name": "Send a message",
      "type": "n8n-nodes-base.gmail",
      "notes": "Sends a \u201cProduct Featured\u201d email to the product owner.",
      "onError": "continueRegularOutput",
      "position": [
        5424,
        1360
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 2.1
    },
    {
      "id": "cb98f79a-22fa-4450-bcac-1497584a76a5",
      "name": "Handle Email Failed",
      "type": "n8n-nodes-base.code",
      "position": [
        5888,
        1824
      ],
      "parameters": {},
      "typeVersion": 2,
      "alwaysOutputData": true
    },
    {
      "id": "1667ba94-ae37-48cd-87a0-591e3471c4a0",
      "name": "Handle Email Success",
      "type": "n8n-nodes-base.code",
      "position": [
        6112,
        1824
      ],
      "parameters": {},
      "typeVersion": 2,
      "alwaysOutputData": true
    },
    {
      "id": "823fa7c4-5488-42fb-a42b-050cf8fc08ac",
      "name": "Handle No Email",
      "type": "n8n-nodes-base.code",
      "position": [
        5248,
        1824
      ],
      "parameters": {},
      "typeVersion": 2,
      "alwaysOutputData": true
    },
    {
      "id": "eaadb8f6-9663-43b6-b31b-8dcb6c18cf87",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5152,
        400
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "8b084b4e-b3ad-4e68-a573-eb3ca4e4264c",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        64,
        1712
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "0f207eab-0a0a-4bd6-b1c2-064b56c79f31",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        48,
        720
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "c37e5bc4-6c1b-40ca-ac35-cf669afa763c",
      "name": "Deduplicate2",
      "type": "n8n-nodes-base.code",
      "notes": "Removes duplicate items based on the \"name\" field.\n\nLogic:\n  - Tracks seen 'name' values\n  - Keeps only the first occurrence of each name\n  - Keeps items without 'name' unchanged\n\nEnsures unique data entries before processing or storing.",
      "position": [
        1616,
        1360
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 2
    },
    {
      "id": "e4a24245-4974-4ef7-ac7e-1b1952e5ebb4",
      "name": "Fetch Dataset Items2",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "Fetches all items from each Apify dataset using datasetId.\n\nUses Apify Auth credentials for authorization.\nThis pulls raw scraped data.",
      "position": [
        1392,
        1360
      ],
      "parameters": {},
      "notesInFlow": true,
      "typeVersion": 4.2
    },
    {
      "id": "bde3b242-6fd7-47f7-b4bb-45d6dca2bb98",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        48,
        1232
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "c48683a2-c668-4b46-a6a8-e70418f3214f",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1808,
        1232
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "7a727437-7557-4ece-8538-e96b2caa7ac6",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1104,
        992
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "14099345-4a01-470d-86b1-3bac7228dbf0",
  "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
          }
        ]
      ]
    }
  }
}