{
  "meta": {
    "instanceId": "ad0113c344ee237399e44e9f11798b05baeb83a6196d514a9ae9d2ad71c3b5c9",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "42c65e43-6fd0-4701-b237-4d308767dc71",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1328,
        4064
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "3ee44563-519c-41d9-ac0a-e554c398b562",
      "name": "Sticky Note17",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1840,
        3920
      ],
      "parameters": {
        "width": 400,
        "height": 928,
        "content": "## ⚙️ Setup Instructions\n\n### 1️⃣ Set Up OpenAI Connection\n1. Go to [OpenAI Platform](https://platform.openai.com/api-keys)  \n2. Navigate to [OpenAI Billing](https://platform.openai.com/settings/organization/billing/overview)  \n3. Add funds to your billing account  \n4. Copy your API key into the **OpenAI credentials** in n8n  \n\n### 2️⃣ Set Up Apify Connection\n1. Go to [Apify Console](https://console.apify.com/) and sign up/login  \n2. Get your API token here: [Apify API Keys](https://console.apify.com/account/integrations)  \n3. Set up the two scrapers in your Apify account:  \n   - [YouTube Scraper by streamers](https://apify.com/streamers/youtube-scraper)  \n   - [YouTube Scraper by apidojo](https://apify.com/apidojo/youtube-scraper)  \n4. In n8n, create a **HTTP Query Auth** credential  \n   - Query Key: `token`  \n   - Value: `YOUR_APIFY_API_KEY`  \n5. Attach this credential to both **HTTP Request nodes** (`Search YouTube` and `Scrape Channels`)  \n\n---\n\n\n## 📬 Contact Information\nNeed help customizing this workflow or building similar automations?  \n\n📧 [robert@ynteractive.com](mailto:robert@ynteractive.com)  \n🔗 [Robert Breen](https://www.linkedin.com/in/robert-breen-29429625/)  \n🌐 [ynteractive.com](https://ynteractive.com)  \n"
      },
      "typeVersion": 1
    },
    {
      "id": "77b25aac-86e6-4eab-8b6d-eabe92ae9a28",
      "name": "Sticky Note18",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1392,
        3920
      ],
      "parameters": {
        "color": 7,
        "width": 1392,
        "height": 928,
        "content": "# 📨 YouTube Creator Email Finder (n8n + Apify + OpenAI)\n\nThis workflow automates the process of finding **YouTube creator contact emails** for outreach and partnerships. It combines **Apify scrapers** with **OpenAI** to deliver a clean list of emails from channel descriptions:  \n"
      },
      "typeVersion": 1
    },
    {
      "id": "9243bdc9-5d5f-41f8-b219-fd0195e52367",
      "name": "Structured Output Parser4",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -224,
        4496
      ],
      "parameters": {
        "jsonSchemaExample": "{\n\t\"emails\": [\"email1\", \"email2\"]\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "93eab497-180b-4430-91fb-f29abb01d59f",
      "name": "OpenAI Chat Model3",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -528,
        4624
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini",
          "cachedResultName": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "credential-id",
          "name": "openAiApi Credential"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "e1060cad-64e1-4c74-9bbe-05b270116c9a",
      "name": "Search Youtube",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1216,
        4672
      ],
      "parameters": {
        "url": "=https://api.apify.com/v2/acts/streamers~youtube-scraper/run-sync-get-dataset-items\n",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n    \"dateFilter\": \"month\",\n    \"downloadSubtitles\": false,\n    \"hasCC\": false,\n    \"hasLocation\": false,\n    \"hasSubtitles\": false,\n    \"is360\": false,\n    \"is3D\": false,\n    \"is4K\": false,\n    \"isBought\": false,\n    \"isHD\": false,\n    \"isHDR\": false,\n    \"isLive\": false,\n    \"isVR180\": false,\n    \"lengthFilter\": \"under4\",\n    \"maxResultStreams\": 0,\n    \"maxResults\": {{ $json.channels }},\n    \"maxResultsShorts\": 0,\n    \"oldestPostDate\": \"10 days\",\n    \"preferAutoGeneratedSubtitles\": false,\n    \"saveSubsToKVS\": false,\n    \"searchQueries\": [\n        \"{{ $json.Search }}\"\n    ],\n    \"sortingOrder\": \"relevance\"\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpQueryAuth"
      },
      "credentials": {
        "httpQueryAuth": {
          "id": "credential-id",
          "name": "httpQueryAuth Credential"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "5b5d1252-9917-490a-ab37-21125383101b",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -880,
        4192
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "21d45ff7-7e36-4bc3-86aa-c9532050549d",
      "name": "Sticky Note19",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -624,
        4464
      ],
      "parameters": {
        "color": 3,
        "width": 288,
        "height": 304,
        "content": "### 1️⃣ Set Up OpenAI Connection\n1. Go to [OpenAI Platform](https://platform.openai.com/api-keys)  \n2. Navigate to [OpenAI Billing](https://platform.openai.com/settings/organization/billing/overview)  \n3. Add funds to your billing account  \n4. Copy your API key into the **OpenAI credentials** in n8n  "
      },
      "typeVersion": 1
    },
    {
      "id": "e6f062bd-6b74-4639-b0c0-409d233c27da",
      "name": "Set Search Term and # of searches",
      "type": "n8n-nodes-base.set",
      "position": [
        -1136,
        4064
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "86221d8e-18d1-4a37-9ffe-b31db3a3441d",
              "name": "Search",
              "type": "string",
              "value": "n8n workflows"
            },
            {
              "id": "59c2fc27-8a31-4760-b2ea-713e676a2be8",
              "name": "channels",
              "type": "string",
              "value": "2"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "f4e3e8ac-b072-42fc-8c7b-b9d260caffd5",
      "name": "Scrape Channels",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -624,
        4080
      ],
      "parameters": {
        "url": "=https://api.apify.com/v2/acts/apidojo~youtube-scraper/run-sync-get-dataset-items\n",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n    \"customMapFunction\": \"(object) => { return {...object} }\",\n    \"duration\": \"all\",\n    \"features\": \"all\",\n    \"getTrending\": false,\n    \"includeShorts\": false,\n    \"maxItems\": 1,\n    \"sort\": \"r\",\n    \"startUrls\": [\n        \"{{ $json.channelUrl }}\"\n    ],\n    \"uploadDate\": \"all\"\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpQueryAuth"
      },
      "credentials": {
        "httpQueryAuth": {
          "id": "credential-id",
          "name": "httpQueryAuth Credential"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "9ba55e16-493f-4d0d-808a-a8de656a02fe",
      "name": "Sticky Note20",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1312,
        4288
      ],
      "parameters": {
        "color": 3,
        "width": 288,
        "height": 512,
        "content": "### 2️⃣ Set Up Apify Connection\n1. Go to [Apify Console](https://console.apify.com/) and sign up/login  \n2. Get your API token here: [Apify API Keys](https://console.apify.com/account/integrations)  \n3. Set up the two scrapers in your Apify account:  \n   - [YouTube Scraper by streamers](https://apify.com/streamers/youtube-scraper)  \n   - [YouTube Scraper by apidojo](https://apify.com/apidojo/youtube-scraper)  \n4. In n8n, create a **HTTP Query Auth** credential  \n   - Query Key: `token`  \n   - Value: `YOUR_APIFY_API_KEY`  \n5. Attach this credential to both **HTTP Request nodes** (`Search YouTube` and `Scrape Channels`)  "
      },
      "typeVersion": 1
    },
    {
      "id": "6a580837-44e4-4abe-acd8-e86a8acae04e",
      "name": "Extract Email Address",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -400,
        4192
      ],
      "parameters": {
        "text": "={{ $json.description }}",
        "options": {
          "systemMessage": "extract email addresses from this. if they are in a bad format, format them. \n\noutput likd this. \n\n\n{\n\t\"emails\": [\"email1\", \"email2\"]\n}"
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2.2
    }
  ],
  "pinData": {},
  "connections": {
    "Search Youtube": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Scrape Channels",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Scrape Channels": {
      "main": [
        [
          {
            "node": "Extract Email Address",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model3": {
      "ai_languageModel": [
        [
          {
            "node": "Extract Email Address",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Extract Email Address": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser4": {
      "ai_outputParser": [
        [
          {
            "node": "Extract Email Address",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Set Search Term and # of searches": {
      "main": [
        [
          {
            "node": "Search Youtube",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Set Search Term and # of searches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}