{
  "id": "qHtSN79ycZeCLTMh",
  "meta": {
    "builderVariant": "mcp",
    "aiBuilderAssisted": true
  },
  "name": "Find YouTube creator emails with OpenAI and save them to Google Sheets",
  "tags": [],
  "nodes": [
    {
      "id": "62471af4-eb69-4240-8c2a-20a45d682376",
      "name": "When clicking Execute",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        0,
        0
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "b56e8bf4-f2c7-4215-b4a8-3e75a8353c89",
      "name": "Configuration",
      "type": "n8n-nodes-base.set",
      "position": [
        208,
        48
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "a1",
              "name": "search_query",
              "type": "string",
              "value": "n8n workflows"
            },
            {
              "id": "a2",
              "name": "max_results",
              "type": "number",
              "value": 10
            },
            {
              "id": "a3",
              "name": "date_filter",
              "type": "string",
              "value": "month"
            },
            {
              "id": "a4",
              "name": "video_length",
              "type": "string",
              "value": "under4"
            },
            {
              "id": "a5",
              "name": "openai_model",
              "type": "string",
              "value": "gpt-5-mini"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "0e45d728-4ce4-4b29-87ac-0059858bf735",
      "name": "Search YouTube (Apify)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        416,
        48
      ],
      "parameters": {
        "url": "https://api.apify.com/v2/acts/streamers~youtube-scraper/run-sync-get-dataset-items",
        "method": "POST",
        "options": {},
        "jsonBody": "={ \"dateFilter\": \"{{ $('Configuration').item.json.date_filter }}\", \"downloadSubtitles\": false, \"hasCC\": false, \"hasLocation\": false, \"hasSubtitles\": false, \"is360\": false, \"is3D\": false, \"is4K\": false, \"isBought\": false, \"isHD\": false, \"isHDR\": false, \"isLive\": false, \"isVR180\": false, \"lengthFilter\": \"{{ $('Configuration').item.json.video_length }}\", \"maxResultStreams\": 0, \"maxResults\": {{ $('Configuration').item.json.max_results }}, \"maxResultsShorts\": 0, \"oldestPostDate\": \"10 days\", \"preferAutoGeneratedSubtitles\": false, \"saveSubsToKVS\": false, \"searchQueries\": [\"{{ $('Configuration').item.json.search_query }}\"], \"sortingOrder\": \"relevance\" }",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.4
    },
    {
      "id": "3ea50cc3-c664-4947-8c57-f2f7e32d8b30",
      "name": "Remove Duplicate Channels",
      "type": "n8n-nodes-base.removeDuplicates",
      "position": [
        624,
        48
      ],
      "parameters": {
        "compare": "selectedFields",
        "options": {},
        "fieldsToCompare": "channelUrl"
      },
      "typeVersion": 2
    },
    {
      "id": "3cd0b359-1e68-450b-96e3-428c82f22d20",
      "name": "Scrape Channel About (Apify)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        896,
        48
      ],
      "parameters": {
        "url": "https://api.apify.com/v2/acts/apidojo~youtube-scraper/run-sync-get-dataset-items",
        "method": "POST",
        "options": {
          "batching": {
            "batch": {
              "batchSize": 1
            }
          }
        },
        "jsonBody": "={ \"customMapFunction\": \"(object) => { return {...object} }\", \"duration\": \"all\", \"features\": \"all\", \"getTrending\": false, \"includeShorts\": false, \"maxItems\": 1, \"sort\": \"r\", \"startUrls\": [\"{{ $json.channelUrl }}\"], \"uploadDate\": \"all\" }",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.4
    },
    {
      "id": "a4472f30-f2f3-4565-9064-4573a4e32d46",
      "name": "Extract Emails with OpenAI",
      "type": "@n8n/n8n-nodes-langchain.informationExtractor",
      "position": [
        1024,
        32
      ],
      "parameters": {
        "text": "={{ $json.description }}",
        "options": {},
        "attributes": {
          "attributes": [
            {
              "name": "emails",
              "description": "All business or contact email addresses found in the text, separated by commas. Fix obvious obfuscations such as \"name (at) domain dot com\". Return an empty string if no email is present."
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "0e34ca61-121e-429a-8ad2-24cfcd99a629",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1088,
        176
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Configuration').item.json.openai_model }}"
        },
        "options": {},
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "9ca4ad3d-a378-49a2-bc7a-8912e2af1b7b",
      "name": "Prepare Row",
      "type": "n8n-nodes-base.set",
      "position": [
        1312,
        32
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "b1",
              "name": "channel_name",
              "type": "string",
              "value": "={{ $('Scrape Channel About').item.json.channelName || $('Scrape Channel About').item.json.channelTitle || $('Scrape Channel About').item.json.title || \"\" }}"
            },
            {
              "id": "b2",
              "name": "channel_url",
              "type": "string",
              "value": "={{ $('Remove Duplicate Channels').item.json.channelUrl }}"
            },
            {
              "id": "b3",
              "name": "emails",
              "type": "string",
              "value": "={{ ($json.output?.emails ?? $json.emails ?? \"\").toString().trim() }}"
            },
            {
              "id": "b4",
              "name": "search_query",
              "type": "string",
              "value": "={{ $('Configuration').item.json.search_query }}"
            },
            {
              "id": "b5",
              "name": "found_at",
              "type": "string",
              "value": "={{ $now.toFormat('yyyy-MM-dd') }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "bf9b3cb2-f0a3-4ecc-8662-e0e88250b8c4",
      "name": "Keep Channels With Email",
      "type": "n8n-nodes-base.filter",
      "position": [
        1504,
        32
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "c1",
              "operator": {
                "type": "string",
                "operation": "notEmpty"
              },
              "leftValue": "={{ $json.emails }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "c9324443-88fb-4091-83de-6300e7859e5d",
      "name": "Save to Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1696,
        32
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [
            {
              "id": "channel_name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "channel_name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "channel_url",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "channel_url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "emails",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "emails",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "search_query",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "search_query",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "found_at",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "found_at",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "autoMapInputData",
          "matchingColumns": []
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "0",
          "cachedResultName": "creator_emails"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "1aI-rMS1BZSwQNDiBRTwJT55wHbWWihLsyK56-afvXLs"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "c9a48529-0810-462a-8f43-28d550d8daaf",
      "name": "Sticky Note e3571168",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -640,
        -560
      ],
      "parameters": {
        "color": 4,
        "width": 560,
        "height": 1872,
        "content": "# Find YouTube creator emails with OpenAI and save them to Google Sheets\n# \ud83d\udce5  [Open full documentation on Notion](https://automatisation.notion.site/Course-Find-YouTube-creator-emails-with-OpenAI-and-save-them-to-Google-Sheets-39d3d6550fd981499d2bcb788aabc262)\n\nSearch YouTube by keyword, scrape each creator channel, use OpenAI to pull business emails out of the channel description, and log the clean leads to Google Sheets \u2014 ideal for creator outreach, UGC sourcing and partnership lead-gen.\n\n## How it works\n1. **Configuration** \u2014 set your search keyword, how many results to pull, the date/length filters and the OpenAI model, all in one place.\n2. **Search YouTube (Apify)** \u2014 finds recent videos matching your keyword and returns their channels.\n3. **Remove Duplicate Channels** \u2014 keeps one row per channel so each is scraped only once (saves credits).\n4. **Scrape Channel About (Apify)** \u2014 pulls the channel description/metadata.\n5. **Extract Emails with OpenAI** \u2014 reads the description and returns clean, comma-separated emails.\n6. **Keep Channels With Email** \u2014 drops channels where no email was found.\n7. **Save to Google Sheets** \u2014 appends channel name, URL, emails, search query and date.\n\n## Setup\n1. **OpenAI** \u2014 add your key to the *OpenAi account* credential ([platform.openai.com](https://platform.openai.com/api-keys)).\n2. **Apify** \u2014 create an HTTP Header Auth credential (Name: `Authorization`, Value: `Bearer YOUR_APIFY_TOKEN`) and attach it to both Apify HTTP nodes. Enable these actors in your Apify account: `streamers/youtube-scraper` and `apidojo/youtube-scraper`.\n3. **Google Sheets** \u2014 connect the *Google Sheets account* credential, then pick your spreadsheet and tab in the last node.\n\n## Requirements\n- An OpenAI API key with billing enabled.\n- An Apify account and API token.\n- A Google account with a target spreadsheet.\n\n## Customization\n- Change the keyword, result count and filters in **Configuration**.\n- Swap the OpenAI model in **Configuration** (`openai_model`).\n- Add columns (e.g. subscriber count) in **Prepare Row** and **Save to Google Sheets**.\n- Replace Google Sheets with Airtable, Notion or a Data Table if you prefer.\n\n---\nNeed help customizing?\nContact me for consulting and support : [Linkedin](https://www.linkedin.com/in/doctor-firass/)\n\n# MY NEW YOUTUBE CHANNEL\n\ud83d\udc49 [Subscribe to my new YouTube channel](https://www.youtube.com/@DrFiras_AI). Here I'll share videos and Shorts with practical tutorials and FREE templates for n8n.\n\n[![The AI Doctor](https://www.dr-firas.com/the-ai-doctor.png)](https://www.youtube.com/@DrFiras_AI)"
      },
      "typeVersion": 1
    },
    {
      "id": "fb6e1878-f081-47f1-9d31-c7402f4ee0f5",
      "name": "Sticky Note 30dbee41",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        144,
        -160
      ],
      "parameters": {
        "color": 7,
        "width": 220,
        "height": 522,
        "content": "## 1. Configure\nSet keyword, result count, filters and the OpenAI model here. This is the only node to edit."
      },
      "typeVersion": 1
    },
    {
      "id": "0c262f12-c100-4cf5-a6cf-d9c6dd6b789f",
      "name": "Sticky Note fdc021ee",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        384,
        -160
      ],
      "parameters": {
        "color": 7,
        "width": 440,
        "height": 522,
        "content": "## 2. Find channels\nSearch YouTube by keyword (Apify) and keep one row per channel."
      },
      "typeVersion": 1
    },
    {
      "id": "9573a72d-2318-4183-99a3-35e9bdee973e",
      "name": "Sticky Note d4dee864",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        848,
        -160
      ],
      "parameters": {
        "color": 7,
        "width": 420,
        "height": 520,
        "content": "## 3. Extract emails\nScrape each channel description (Apify) and let OpenAI return clean, comma-separated emails."
      },
      "typeVersion": 1
    },
    {
      "id": "d678a936-9566-40a8-be46-73ea503d617b",
      "name": "Sticky Note 2db8a40b",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1280,
        -160
      ],
      "parameters": {
        "color": 7,
        "width": 620,
        "height": 522,
        "content": "## 4. Save leads\nKeep only channels with an email, then append the row to Google Sheets."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "availableInMCP": true,
    "executionOrder": "v1"
  },
  "versionId": "3995da8a-4f06-4dca-8130-f16da9b5c3c3",
  "nodeGroups": [],
  "connections": {
    "Prepare Row": {
      "main": [
        [
          {
            "node": "Keep Channels With Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Configuration": {
      "main": [
        [
          {
            "node": "Search YouTube (Apify)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Extract Emails with OpenAI",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "When clicking Execute": {
      "main": [
        [
          {
            "node": "Configuration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search YouTube (Apify)": {
      "main": [
        [
          {
            "node": "Remove Duplicate Channels",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Keep Channels With Email": {
      "main": [
        [
          {
            "node": "Save to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remove Duplicate Channels": {
      "main": [
        [
          {
            "node": "Scrape Channel About (Apify)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Emails with OpenAI": {
      "main": [
        [
          {
            "node": "Prepare Row",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Scrape Channel About (Apify)": {
      "main": [
        [
          {
            "node": "Extract Emails with OpenAI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}