YouTube 潜在客户生成:使用 Apify 和 Gemini AI 将评论转化为丰富潜在客户

高级

这是一个Lead Generation、AI Summarization领域的自动化工作流,包含 22 个节点。主要使用 Code、HttpRequest、GoogleSheets、ManualTrigger、Agent 等节点。 YouTube 潜在客户生成:使用 Apify 和 Gemini AI 将评论转化为丰富潜在客户

前置要求
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "fc63750f782ddb0ac1ea212878f63a2b0020ae9f1807f29cfde5d7bf33630d3a",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "80b8e575-f28b-4476-be2e-e4408e09e458",
      "name": "当点击\"执行工作流\"时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -200,
        120
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "52f7b868-8817-4ff4-92cc-9ef1a31a1b8c",
      "name": "HTTP apify 从视频获取评论",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        460,
        -60
      ],
      "parameters": {
        "url": "https://api.apify.com/v2/acts/mohamedgb00714~youtube-video-comments/run-sync-get-dataset-items?token={{your apify token}}",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n    \"videoUrl\": \"{{ $json.url }}\"\n} ",
        "sendBody": true,
        "contentType": "=json",
        "specifyBody": "json",
        "bodyParameters": {
          "parameters": [
            {}
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "1cd8c9f7-4de2-49a6-83e1-b324e9bc1c32",
      "name": "将视频 URL 标记为已抓取",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        240,
        180
      ],
      "parameters": {
        "columns": {
          "value": {
            "url": "={{ $json.url }}",
            "scrapped": "TRUE"
          },
          "schema": [
            {
              "id": "url",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "scrapped",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "scrapped",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "url"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OGX1bKAOeym8tEENP-zJAYXyZD6XnH6T5FV85J38H54/edit#gid=0",
          "cachedResultName": "videos"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1OGX1bKAOeym8tEENP-zJAYXyZD6XnH6T5FV85J38H54",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OGX1bKAOeym8tEENP-zJAYXyZD6XnH6T5FV85J38H54/edit?usp=drivesdk",
          "cachedResultName": "youtube leads"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "DUWLlaGsMF7Qxsiy",
          "name": "Google Sheets account 2"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "61fa66e6-eda8-4b0c-b1e1-f096ceda66fe",
      "name": "获取视频 URL",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        240,
        -60
      ],
      "parameters": {
        "options": {},
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "scrapped"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OGX1bKAOeym8tEENP-zJAYXyZD6XnH6T5FV85J38H54/edit#gid=0",
          "cachedResultName": "videos"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1OGX1bKAOeym8tEENP-zJAYXyZD6XnH6T5FV85J38H54",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OGX1bKAOeym8tEENP-zJAYXyZD6XnH6T5FV85J38H54/edit?usp=drivesdk",
          "cachedResultName": "youtube leads"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "DUWLlaGsMF7Qxsiy",
          "name": "Google Sheets account 2"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "cb589fa9-6eb6-401f-a6b5-feda95cf45cb",
      "name": "保存已抓取的评论",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        680,
        -60
      ],
      "parameters": {
        "columns": {
          "value": {
            "author": "={{ $json.author }}"
          },
          "schema": [
            {
              "id": "author",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "author",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "avatarAccessibilityText",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "avatarAccessibilityText",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "avatarImage",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "avatarImage",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "commentId",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "commentId",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "content",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "content",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "creatorThumbnailUrl",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "creatorThumbnailUrl",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "heartActiveTooltip",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "heartActiveTooltip",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "key",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "key",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "likeButtonA11y",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "likeButtonA11y",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "likeCount",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "likeCount",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "likeCountA11y",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "likeCountA11y",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "publishedTime",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "publishedTime",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "readMoreTrackingParams",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "readMoreTrackingParams",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "replyCount",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "replyCount",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "replyCountA11y",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "replyCountA11y",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "replyLevel",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "replyLevel",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "autoMapInputData",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 6484598,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OGX1bKAOeym8tEENP-zJAYXyZD6XnH6T5FV85J38H54/edit#gid=6484598",
          "cachedResultName": "comments"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1OGX1bKAOeym8tEENP-zJAYXyZD6XnH6T5FV85J38H54",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OGX1bKAOeym8tEENP-zJAYXyZD6XnH6T5FV85J38H54/edit?usp=drivesdk",
          "cachedResultName": "youtube leads"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "DUWLlaGsMF7Qxsiy",
          "name": "Google Sheets account 2"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "e26c4aab-267f-49ee-8fdb-b94176a645c1",
      "name": "当收到聊天消息时",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -80,
        1260
      ],
      "webhookId": "27609f77-6158-4c0b-84d0-e5008d950685",
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.1
    },
    {
      "id": "835181c3-3d43-45ac-b824-3e18241c4c6c",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "onError": "continueRegularOutput",
      "position": [
        300,
        1120
      ],
      "parameters": {
        "options": {
          "maxIterations": 100,
          "systemMessage": "You are an AI agent designed to assist in finding social media accounts and related information for authors of YouTube channel comments. Your primary goal is to systematically identify and gather publicly available data, such as social media profiles, websites, and contact details, associated with these comment authors.\n\n**Which information are you interested in finding?**\nYou are interested in finding various types of public information, including:\n* Social media profiles (e.g., Instagram, Twitter, LinkedIn, Facebook, TikTok, etc.)\n* Personal or company websites\n* Contact details such as email addresses (e.g., info@galad.ai, personal emails if publicly available)\n* Any other publicly available professional or personal affiliations that help identify the comment author.\n\n**Which social media presences should I look out for?**\nYou should actively look out for common social media platforms such as:\n* Instagram\n* Twitter (X)\n* LinkedIn\n* Facebook\n* TikTok\n* GitHub (especially for individuals involved in tech or development)\n* Any other platform mentioned or linked from their YouTube channel or associated websites.\n\n**Tools You Have Access To:**\n\n* **`get_comments()`:** To retrieve comment data from YouTube channels.\n* **`Google Search`:** To perform web searches for general information, social media profiles, and related entities.\n* **`Browse`.\n* **`create_new_row(user_id: str)`:** To initialize a new row in the database/sheet for the current user being investigated. This must be done at the very beginning of processing a new user.\n* **`save_to_sheet(data: dict)`:** To save all gathered information for a user to the database/sheet. This tool should be used only *after* all investigation avenues for the current user have been exhausted.\n\n**Core Functionality and Workflow:**\n\n1.  **Retrieve YouTube Comments:** You will initiate the process by fetching comments from a YouTube channel and then present a list of comment authors along with their YouTube channel URLs.\n2.  **Per Author Investigation (Proactive and Exhaustive - No Repetitive Confirmations):** Once an author is selected (or you move to the next author), you will **immediately** call `create_new_row()` for that author's ID. **You will then proceed with the following systematic investigation steps for that author without pausing to ask for confirmation at each sub-step.** You will only ask for user input when a major decision point is reached (e.g., moving to a new author) or if you encounter an unresolvable ambiguity.\n    * **1. YouTube Channel Description Analysis (First Step):** Prioritize extracting the description from the author's YouTube channel using `Browse` for YouTube URLs). This is the crucial first step to gather direct social media links or associated business information.\n    * **2. Google Search:** After analyzing the YouTube channel description, utilize `Google Search` to find social media profiles and related entities (e.g., companies, personal websites) based on the author's name, YouTube handle, or any information gleaned from their channel description.\n        * **Important Note for Google Search:** When searching for social media profiles, **do not use the \"@\" symbol** as part of the handle in your Google search queries (e.g., search for \"pablo.chepi Instagram\" instead of \"@pablo.chepi Instagram\"). Employ various search queries as needed (e.g., \"name social media\", \"company Instagram\", \"who is [YouTube handle]\").\n    * **3. Website Exploration:** If a website is identified (e.g., from the YouTube description or Google Search), thoroughly browse its content using `Browse` for user-provided or company/personal websites). Your objective is to extract comprehensive information, including additional social media links, contact details (like email addresses), and a deeper understanding of the author's professional or personal affiliations.\n    * **4. Social Media Profile Verification and Deep Dive:** When potential social media profiles are found, use `Google Search` to confirm the identity and relevance to the YouTube commenter. If a profile seems highly relevant, proactively browse it for more links or specific contact information where permissible.\n    * **5. Exhaustive Search Principle:** Continue searching across various platforms (Instagram, LinkedIn, Facebook, Twitter, etc.) until all likely avenues are exhausted or a clear conclusion about the author's public digital presence is reached.\n    * **6. Saving Data:** Once all investigation avenues for the current author have been exhausted and you have gathered as much information as possible, you **must** call `save_to_sheet()` with all the collected information for that author.\n\n3.  **User Interaction and Reporting:**\n    * Maintain clear communication with the user, providing updates on your findings.\n    * Report the *outcome* of each tool use clearly, even if it yields no new information, to avoid user confusion.\n    * Only ask for the user's direction when the investigation for the current author is deemed \"complete\" (i.e., all relevant information has been found and saved, or no more leads can be pursued), or if a significant decision point requiring user input (e.g., moving to the next author, or if a very ambiguous situation arises that you cannot resolve independently) is reached.\n\n**Constraints & Best Practices:**\n\n* Always prioritize direct information from official sources (e.g., YouTube descriptions, official websites).\n* Be persistent in your search; if one approach fails, try another.\n* Clearly state what information you have found and what actions you are taking or recommend next *only when necessary to guide the overall process*.\n\n\n\n\n\n\n\n\n\n\n\nDeep Research\n\nCanvas\n\n"
        }
      },
      "retryOnFail": true,
      "typeVersion": 2
    },
    {
      "id": "b52cb3a0-472a-4947-9ab2-6ee7b662bd0f",
      "name": "OpenRouter聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        80,
        1440
      ],
      "parameters": {
        "model": "google/gemini-2.5-flash-preview-05-20",
        "options": {}
      },
      "credentials": {
        "openRouterApi": {
          "id": "cIzX2I4YIr0QQq36",
          "name": "OpenRouter account 2"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "00f70b95-7980-4491-99b1-bc0fc18a7277",
      "name": "获取评论",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        1260,
        1280
      ],
      "parameters": {
        "options": {
          "dataLocationOnSheet": {
            "values": {
              "rangeDefinition": "detectAutomatically"
            }
          }
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "processed"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 6484598,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OGX1bKAOeym8tEENP-zJAYXyZD6XnH6T5FV85J38H54/edit#gid=6484598",
          "cachedResultName": "comments"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1OGX1bKAOeym8tEENP-zJAYXyZD6XnH6T5FV85J38H54",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OGX1bKAOeym8tEENP-zJAYXyZD6XnH6T5FV85J38H54/edit?usp=drivesdk",
          "cachedResultName": "youtube leads"
        },
        "descriptionType": "manual",
        "toolDescription": "list of comments to process"
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "DUWLlaGsMF7Qxsiy",
          "name": "Google Sheets account 2"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "acdff41b-c55f-4d7d-8a42-36d58a5bb018",
      "name": "简单记忆",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        360,
        1440
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "e44316ce-363b-4c70-8292-706354f4441e",
      "name": "搜索谷歌",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        600,
        1460
      ],
      "parameters": {
        "url": "https://google.serper.dev/search",
        "method": "POST",
        "options": {
          "redirect": {
            "redirect": {}
          }
        },
        "sendBody": true,
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "q",
              "value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('parameters0_Value', ``, 'string') }}"
            },
            {
              "name": "location",
              "value": "=United States"
            },
            {
              "name": "num",
              "value": "100"
            }
          ]
        },
        "toolDescription": "search engine to get usernames and emails from google",
        "headerParameters": {
          "parameters": [
            {
              "name": "X-API-KEY",
              "value": "{{your serper api key}}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "6cca7e09-b87c-47e8-9cac-77b2a0a5e3b8",
      "name": "获取 URL Markdown",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        740,
        1460
      ],
      "parameters": {
        "url": "https://api.apify.com/v2/acts/mohamedgb00714~firescraper-ai-website-content-markdown-scraper/run-sync-get-dataset-items?token={{your apify token}}",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"enqueue\": {{ $fromAI('crawelEnabled', 'get other links from this website', 'boolean', false) }},\n  \"getHtml\": false,\n  \"getText\": false,\n  \"screenshot\": false,\n  \"startUrls\": [\n    {\n      \"url\": \"{{ $fromAI('url', 'target url', 'string') }}\",\n      \"method\": \"GET\"\n    }\n  ],\n  \"maxPages\": 10,\n  \"proxyConfig\": {\n    \"useApifyProxy\": true\n  }\n}\n\n",
        "sendBody": true,
        "specifyBody": "json",
        "toolDescription": "get url markdown content"
      },
      "typeVersion": 4.2
    },
    {
      "id": "ac847dda-c6b1-4081-b602-3fc0300a2e3a",
      "name": "为新搜索用户创建行",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        1140,
        1440
      ],
      "parameters": {
        "columns": {
          "value": {
            "username": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('username', ``, 'string') }}"
          },
          "schema": [
            {
              "id": "username",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "username",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "email",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "bio",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "bio",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": " Instagram",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": " Instagram",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Twitter (X)",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Twitter (X)",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "LinkedIn",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "LinkedIn",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Facebook",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Facebook",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "TikTok",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "TikTok",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "GitHub",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "GitHub",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "username"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 395221622,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OGX1bKAOeym8tEENP-zJAYXyZD6XnH6T5FV85J38H54/edit#gid=395221622",
          "cachedResultName": "leads"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1OGX1bKAOeym8tEENP-zJAYXyZD6XnH6T5FV85J38H54",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OGX1bKAOeym8tEENP-zJAYXyZD6XnH6T5FV85J38H54/edit?usp=drivesdk",
          "cachedResultName": "youtube leads"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "DUWLlaGsMF7Qxsiy",
          "name": "Google Sheets account 2"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "6396b038-a0de-45a7-b848-bc90a870da2e",
      "name": "更新用户结果",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        1000,
        1460
      ],
      "parameters": {
        "columns": {
          "value": {
            "bio": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('bio', ``, 'string') }}",
            "email": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('email', ``, 'string') }}",
            "GitHub": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('GitHub', ``, 'string') }}",
            "TikTok": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('TikTok', ``, 'string') }}",
            "Facebook": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Facebook', ``, 'string') }}",
            "LinkedIn": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('LinkedIn', ``, 'string') }}",
            "username": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('username__using_to_match_', ``, 'string') }}",
            " Instagram": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('_Instagram', ``, 'string') }}",
            "Twitter (X)": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Twitter__X_', ``, 'string') }}",
            "short Description": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('short_Description', ``, 'string') }}"
          },
          "schema": [
            {
              "id": "username",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "username",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "email",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "bio",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "bio",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": " Instagram",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": " Instagram",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Twitter (X)",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Twitter (X)",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "LinkedIn",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "LinkedIn",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Facebook",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Facebook",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "TikTok",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "TikTok",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "GitHub",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "GitHub",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "short Description",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "short Description",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "username"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 395221622,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OGX1bKAOeym8tEENP-zJAYXyZD6XnH6T5FV85J38H54/edit#gid=395221622",
          "cachedResultName": "leads"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1OGX1bKAOeym8tEENP-zJAYXyZD6XnH6T5FV85J38H54",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OGX1bKAOeym8tEENP-zJAYXyZD6XnH6T5FV85J38H54/edit?usp=drivesdk",
          "cachedResultName": "youtube leads"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "DUWLlaGsMF7Qxsiy",
          "name": "Google Sheets account 2"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "54632fac-e65d-46ae-8ad1-9ab53889e5aa",
      "name": "Instagram 完整资料抓取器",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        480,
        1440
      ],
      "parameters": {
        "url": "https://api.apify.com/v2/acts/mohamedgb00714~instagram-full-profile-scraper/run-sync-get-dataset-items?token={{your apify token}}",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n    \"instagramUsernames\": [\n        \"{{ $fromAI('username', 'instagram profile user name', 'string') }}\"\n    ]\n}",
        "sendBody": true,
        "specifyBody": "json",
        "toolDescription": "get full profile informations just input user name"
      },
      "typeVersion": 4.2
    },
    {
      "id": "011caa9d-20f8-42c9-91e7-6e2978a6e308",
      "name": "将评论标记为已处理",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        1180,
        1100
      ],
      "parameters": {
        "columns": {
          "value": {
            "processed": "={{ $fromAI('processed', ``, 'boolean') }}",
            "avatarAccessibilityText": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('avatarAccessibilityText__using_to_match_', ``, 'string') }}"
          },
          "schema": [
            {
              "id": "author",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "author",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "avatarAccessibilityText",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "avatarAccessibilityText",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "avatarImage",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "avatarImage",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "commentId",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "commentId",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "content",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "content",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "creatorThumbnailUrl",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "creatorThumbnailUrl",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "heartActiveTooltip",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "heartActiveTooltip",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "key",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "key",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "likeButtonA11y",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "likeButtonA11y",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "likeCount",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "likeCount",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "likeCountA11y",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "likeCountA11y",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "publishedTime",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "publishedTime",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "readMoreTrackingParams",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "readMoreTrackingParams",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "replyCount",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "replyCount",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "replyCountA11y",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "replyCountA11y",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "replyLevel",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "replyLevel",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "processed",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "processed",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "avatarAccessibilityText"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 6484598,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OGX1bKAOeym8tEENP-zJAYXyZD6XnH6T5FV85J38H54/edit#gid=6484598",
          "cachedResultName": "comments"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1OGX1bKAOeym8tEENP-zJAYXyZD6XnH6T5FV85J38H54",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OGX1bKAOeym8tEENP-zJAYXyZD6XnH6T5FV85J38H54/edit?usp=drivesdk",
          "cachedResultName": "youtube leads"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "DUWLlaGsMF7Qxsiy",
          "name": "Google Sheets account 2"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "337727d9-96f6-4edd-b6dc-c02bb8c76d8c",
      "name": "计划触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -100,
        740
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes",
              "minutesInterval": 1
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "fdf66352-ffaf-4b8c-b529-410401e84bb4",
      "name": "代码",
      "type": "n8n-nodes-base.code",
      "position": [
        80,
        740
      ],
      "parameters": {
        "jsCode": "const items = $input.all();\nconst updatedItems = items.map((item) => {\n  item.json.chatInput =\n    `Initiate Autonomous User Information Gathering\n\n\"Please initiate the autonomous information gathering process for the first comment auther youtube user. My objective is to obtain all publicly available information concerning this user.\n\nYou are to operate with complete autonomy, without requiring any intermediate confirmations from me during the investigation phase.\n\nYour operational guidelines are as follows:\n\nExhaustive Search: Systematically search for all relevant information. This includes, but is not limited to, social media profiles (Instagram, Twitter/X, LinkedIn, Facebook, TikTok, GitHub, etc.), personal or company websites, publicly available contact details (especially email addresses), and any other professional or personal affiliations that can help identify or understand the user.\n\nAutonomous Decision-Making: You are empowered to make all necessary decisions regarding search queries, tool usage (e.g., Google Search, Browse), and navigation between different information sources, without my intervention.\n\nMandatory Information Update & Save:\n\nYou must not stop the process for a user until you have updated their information.\n\nOnce you have gathered all available information, or determined that there are no further options to collect more data for this user, you must save everything you have found. This involves populating all target fields with collected data.\n\nIf no information is collected for a specific target field (e.g., no Instagram profile found, no email address), you must explicitly put 'N/A' in that field.\n\nProcess Completion & Reporting:\n\nAfter saving all information, you must provide a short description about the process you undertook for this user (e.g., \"Investigation for [User ID/Name] completed. Found LinkedIn profile and a personal blog. No public email or other social media accounts were identified.\").\n\nCrucially, you are to then consider the comment (or user's investigation) as 'processed'. Do not ask me for any further confirmation regarding this user once these steps are completed.\n\n`;\n  item.json.sessionId =\n    Date.now().toString(36) + Math.random().toString(36).substring(2);\n  return item;\n});\nreturn updatedItems;\n"
      },
      "typeVersion": 2
    },
    {
      "id": "e01462f9-48b8-4a3f-b9b6-bbfdc21f844d",
      "name": "计划触发器1",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -240,
        -80
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "5e9e3db1-9991-40d7-93a3-71ad4bb8236f",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1120,
        -20
      ],
      "parameters": {
        "width": 740,
        "height": 3400,
        "content": "# 🚀 YouTube 潜在客户生成工作流"
      },
      "typeVersion": 1
    },
    {
      "id": "c3933a13-08b2-46ad-85d7-fff7f06b0613",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -220,
        480
      ],
      "parameters": {
        "color": 5,
        "width": 2160,
        "height": 1540,
        "content": "## 🟦 **第 2 部分:🕵️ 潜在客户研究与丰富 (AI Agent)**"
      },
      "typeVersion": 1
    },
    {
      "id": "6a0c50de-3b28-4000-857c-6c8c15ebd925",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -320,
        -180
      ],
      "parameters": {
        "color": 3,
        "width": 1240,
        "height": 580,
        "content": "## ⚙️ **第 1 部分:🎥 YouTube 评论提取**"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "Code": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get comments": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "search google": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Get rvideo urls": {
      "main": [
        [
          {
            "node": "HTTP apify get comments from video",
            "type": "main",
            "index": 0
          },
          {
            "node": "mark video url as scrapped",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get url mardown": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger1": {
      "main": [
        [
          {
            "node": "Get rvideo urls",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Save scrapped comments": {
      "main": [
        []
      ]
    },
    "update result for user": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "mark comment as processed": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "mark video url as scrapped": {
      "main": [
        []
      ]
    },
    "instagram full profile scraper": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "create a row for new search user": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "HTTP apify get comments from video": {
      "main": [
        [
          {
            "node": "Save scrapped comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Get rvideo urls",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

这是一个高级难度的工作流,适用于Lead Generation、AI Summarization等场景。适合高级用户,包含 16+ 个节点的复杂工作流

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
高级
节点数量22
分类2
节点类型12
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

作者
Msaid Mohamed el hadi

Msaid Mohamed el hadi

@mohamedgb00714

Hi! I’m Mohamed El Hadi, a passionate developer and automation expert from Algeria. I specialize in building smart, scalable workflows using n8n to streamline business operations, save time, and drive innovation. 🌍 Open to collaborations | 🤖 Automation lover | 💼 Founder of EcoPetDZ & AADL Auto Reload

外部链接
在 n8n.io 上查看 →

分享此工作流