{
  "name": "Discover YouTube channels from keywords and save leads to Google Sheets",
  "nodes": [
    {
      "id": "f2ac95fd-8956-4010-9d5d-5f809d11a6a0",
      "name": "Append or update row in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        976,
        416
      ]
    },
    {
      "id": "3e5d4c72-a2da-4531-832a-c34fdc210bf8",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1376,
        416
      ]
    },
    {
      "id": "a31b6ea0-2c42-4ef8-8df0-82ddb3f86643",
      "name": "Update Keyword Status -> Processing",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -592,
        416
      ]
    },
    {
      "id": "79615eb1-e2f6-4a37-b34d-27cbf28e3b99",
      "name": "Get the first keyword",
      "type": "n8n-nodes-base.code",
      "position": [
        -800,
        416
      ]
    },
    {
      "id": "12bda5a9-9f13-460e-b0e5-c7849a689b56",
      "name": "Run an Actor and get dataset",
      "type": "@apify/n8n-nodes-apify.apify",
      "position": [
        -480,
        1248
      ]
    },
    {
      "id": "cd7db7a2-0ca1-4c98-a162-ea2e3013fdf3",
      "name": "Append or update row in sheet1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -80,
        1248
      ]
    },
    {
      "id": "c809b200-cbe4-4638-a577-7c2b2663504f",
      "name": "Code in JavaScript",
      "type": "n8n-nodes-base.code",
      "position": [
        -272,
        1248
      ]
    },
    {
      "id": "80d98841-cffe-4005-996a-dc40e0d732cf",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2080,
        320
      ],
      "parameters": {
        "width": 496,
        "height": 288,
        "content": "## Workflow overview\n\nThis workflow automatically discovers high quality YouTube channels based on a list of target keywords.\n\nIt runs on a schedule, searches for videos related to each keyword, extra"
      }
    },
    {
      "id": "8059c4ad-7551-4bd0-8741-7823e409c8ce",
      "name": "Search Videos based on Keywords",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -256,
        416
      ]
    },
    {
      "id": "82fb27e6-960a-422e-a715-741f91abd6de",
      "name": "List of Target Keywords",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -992,
        416
      ]
    },
    {
      "id": "e3b9d095-f5db-44bf-941e-630b00e8e0c8",
      "name": "Extract Channel Ids from the Video Results",
      "type": "n8n-nodes-base.code",
      "position": [
        64,
        416
      ]
    },
    {
      "id": "5e27c8e6-5907-42c3-9311-2d70df76ceda",
      "name": "Get Channel Stats",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        272,
        416
      ]
    },
    {
      "id": "b1146fe9-ce4b-456b-9a1a-e7c4d24b5222",
      "name": "Filter based on Criteria",
      "type": "n8n-nodes-base.code",
      "position": [
        464,
        416
      ]
    },
    {
      "id": "ab835bbf-f9d7-4c23-af9f-f130b77eb348",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1456,
        576
      ],
      "parameters": {
        "width": 304,
        "height": 304,
        "content": "## Step 1. Schedule workflow trigger\n\nThis workflow starts automatically at a scheduled interval.\n\nThe scheduler allows you to run the automation periodically, for example every 5 minutes, every hour,"
      }
    },
    {
      "id": "6946302e-54da-446b-96bd-56093f7f35e3",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1056,
        320
      ],
      "parameters": {
        "width": 624,
        "height": 624,
        "content": "## Step 2. Retrieve Target Keywords and Process One Keyword at a Time.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nThis step retrieves the list of target keywords from the data source.\nEach keyword represents a topic or niche th"
      }
    },
    {
      "id": "0bdf0e43-ac98-46ab-b77a-8bb3fc7a8889",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -368,
        64
      ],
      "parameters": {
        "width": 304,
        "height": 320,
        "content": "## Step 3. Search YouTube Videos\n\nUsing the selected keyword, the workflow searches YouTube videos through the YouTube API.\n\nVideos are used as the discovery source because every video is linked to a "
      }
    },
    {
      "id": "4e8bb8c9-8e84-475b-ac50-2bdb1688f1a2",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -16,
        272
      ],
      "parameters": {
        "width": 656,
        "height": 656,
        "content": "## Step 4. Extract Channel IDs, Retrieve Channel Stats, and Filter Qualified Channels\nFrom the video results, the workflow extracts the unique channel IDs of the creators who published those videos.\n\n"
      }
    },
    {
      "id": "b85ecf68-a7f1-4541-a0ab-fc0891c9e04e",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        880,
        640
      ],
      "parameters": {
        "width": 304,
        "height": 288,
        "content": "## Step 5. Save Results to Spreadsheet\n\nQualified channels are saved to the spreadsheet.\n\nIf the channel already exists, its information is updated. If it is new, a new row is added.\n\nThis creates a c"
      }
    },
    {
      "id": "f50ba7ff-895c-431e-9f45-3039bf6d8321",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2080,
        656
      ],
      "parameters": {
        "width": 496,
        "height": 224,
        "content": "## Setup instructions\n\nBefore running this workflow, configure the following:\n\nAdd your YouTube API credentials.\nConnect your spreadsheet or database where keywords and channel data are stored.\nAdjust"
      }
    }
  ],
  "connections": {
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "List of Target Keywords",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Channel Stats": {
      "main": [
        [
          {
            "node": "Filter based on Criteria",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript": {
      "main": [
        [
          {
            "node": "Append or update row in sheet1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get the first keyword": {
      "main": [
        [
          {
            "node": "Update Keyword Status -> Processing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "List of Target Keywords": {
      "main": [
        [
          {
            "node": "Get the first keyword",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter based on Criteria": {
      "main": [
        [
          {
            "node": "Append or update row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run an Actor and get dataset": {
      "main": [
        [
          {
            "node": "Code in JavaScript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append or update row in sheet": {
      "main": [
        []
      ]
    },
    "Search Videos based on Keywords": {
      "main": [
        [
          {
            "node": "Extract Channel Ids from the Video Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Keyword Status -> Processing": {
      "main": [
        [
          {
            "node": "Search Videos based on Keywords",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Channel Ids from the Video Results": {
      "main": [
        [
          {
            "node": "Get Channel Stats",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}