8
n8n 中文网amn8n.com

LinkedIn潜在客户信息丰富与AI个性化冷外联

高级

这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 18 个节点。主要使用 If, Set, Code, Wait, SplitOut 等节点。 LinkedIn潜在客户信息丰富与个性化冷外联,集成Hunter.io、GPT-4和Sheets

前置要求
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "",
  "meta": {
    "instanceId": "your-instance-id-here",
    "templateCredsSetupCompleted": false
  },
  "name": "LinkedIn 潜在客户信息丰富与 AI 个性化冷外联",
  "tags": [
    {
      "id": "1",
      "name": "Sales",
      "createdAt": "2025-01-01T00:00:00.000Z",
      "updatedAt": "2025-01-01T00:00:00.000Z"
    },
    {
      "id": "2",
      "name": "Lead Generation",
      "createdAt": "2025-01-01T00:00:00.000Z",
      "updatedAt": "2025-01-01T00:00:00.000Z"
    },
    {
      "id": "3",
      "name": "AI",
      "createdAt": "2025-01-01T00:00:00.000Z",
      "updatedAt": "2025-01-01T00:00:00.000Z"
    }
  ],
  "nodes": [
    {
      "id": "workflow-overview-note",
      "name": "📋 工作流概览与设置指南",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -420,
        240
      ],
      "parameters": {
        "color": 4,
        "width": 680,
        "height": 620,
        "content": "## 🎯 LinkedIn 潜在客户信息丰富与 AI 个性化"
      },
      "typeVersion": 1
    },
    {
      "id": "step-1-note",
      "name": "步骤 1 上下文",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        140,
        240
      ],
      "parameters": {
        "color": 7,
        "width": 380,
        "height": 180,
        "content": "## 步骤 1:配置您的营销活动"
      },
      "typeVersion": 1
    },
    {
      "id": "step-2-note",
      "name": "步骤 2 上下文",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        660,
        240
      ],
      "parameters": {
        "color": 7,
        "width": 380,
        "height": 180,
        "content": "## 步骤 2:提取 LinkedIn 数据"
      },
      "typeVersion": 1
    },
    {
      "id": "step-3-note",
      "name": "步骤 3 上下文",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1180,
        240
      ],
      "parameters": {
        "color": 7,
        "width": 380,
        "height": 180,
        "content": "## 步骤 3:查找电子邮件地址"
      },
      "typeVersion": 1
    },
    {
      "id": "step-4-note",
      "name": "步骤 4 上下文",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1700,
        240
      ],
      "parameters": {
        "color": 7,
        "width": 380,
        "height": 180,
        "content": "## 步骤 4:AI 个性化"
      },
      "typeVersion": 1
    },
    {
      "id": "step-5-note",
      "name": "步骤 5 上下文",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2220,
        240
      ],
      "parameters": {
        "color": 7,
        "width": 380,
        "height": 180,
        "content": "## 步骤 5:存储丰富后的潜在客户"
      },
      "typeVersion": 1
    },
    {
      "id": "campaign-settings-node",
      "name": "设置营销活动变量",
      "type": "n8n-nodes-base.set",
      "position": [
        180,
        480
      ],
      "parameters": {
        "mode": "raw",
        "options": {},
        "jsonOutput": "{\n  \"target_industry\": \"SaaS\",\n  \"target_role\": \"Head of Sales\",\n  \"company_name\": \"YourCompany\",\n  \"value_proposition\": \"We help sales teams book 30% more meetings using AI-powered personalization\",\n  \"linkedin_urls\": [\n    \"https://www.linkedin.com/in/sample-profile-1\",\n    \"https://www.linkedin.com/in/sample-profile-2\"\n  ]\n}"
      },
      "typeVersion": 3.4
    },
    {
      "id": "split-urls-node",
      "name": "拆分 LinkedIn URL",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        380,
        480
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "linkedin_urls"
      },
      "typeVersion": 1
    },
    {
      "id": "scrape-linkedin-node",
      "name": "抓取 LinkedIn 个人资料",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        700,
        480
      ],
      "parameters": {
        "url": "={{ $json.linkedin_urls }}",
        "options": {
          "timeout": 10000
        },
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "User-Agent",
              "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "parse-linkedin-data-node",
      "name": "解析 LinkedIn 数据",
      "type": "n8n-nodes-base.code",
      "position": [
        900,
        480
      ],
      "parameters": {
        "jsCode": "// Extract key information from LinkedIn HTML\nconst html = $input.item.json.data || '';\n\n// Helper function to extract text between patterns\nfunction extractText(pattern, text) {\n  const match = text.match(pattern);\n  return match ? match[1].trim() : null;\n}\n\n// Extract name\nconst name = extractText(/<title>([^|]+)/, html) || 'Unknown';\n\n// Extract current position\nconst title = extractText(/aria-label=\"Current position[^>]*>([^<]+)/, html) || 'Not specified';\n\n// Extract company\nconst company = extractText(/aria-label=\"Current company[^>]*>([^<]+)/, html) || 'Unknown';\n\n// Extract location\nconst location = extractText(/aria-label=\"Location[^>]*>([^<]+)/, html) || 'Unknown';\n\n// Clean up name\nconst cleanName = name.replace(/[\\|\\-].*$/, '').trim();\nconst nameParts = cleanName.split(' ');\nconst firstName = nameParts[0] || '';\nconst lastName = nameParts.slice(1).join(' ') || '';\n\nreturn {\n  full_name: cleanName,\n  first_name: firstName,\n  last_name: lastName,\n  title: title,\n  company: company,\n  location: location,\n  linkedin_url: $json.linkedin_urls,\n  raw_html: html.substring(0, 1000) // Keep snippet for debugging\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "find-email-node",
      "name": "使用 Hunter.io 查找电子邮件",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1220,
        480
      ],
      "parameters": {
        "url": "=https://api.hunter.io/v2/email-finder",
        "method": "GET",
        "options": {
          "response": {
            "response": {
              "neverError": true
            }
          }
        },
        "sendQuery": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "queryAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "domain",
              "value": "={{ $json.company.toLowerCase().replace(/[^a-z0-9]/g, '') }}.com"
            },
            {
              "name": "first_name",
              "value": "={{ $json.first_name }}"
            },
            {
              "name": "last_name",
              "value": "={{ $json.last_name }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "process-email-node",
      "name": "处理电子邮件结果",
      "type": "n8n-nodes-base.code",
      "position": [
        1420,
        480
      ],
      "parameters": {
        "jsCode": "// Extract email from Hunter.io response\nconst hunterData = $input.item.json.data || {};\nconst emailData = hunterData.email || null;\n\n// Get previous node data\nconst leadData = $('Parse LinkedIn Data').item.json;\n\nreturn {\n  ...leadData,\n  email: emailData,\n  email_confidence: hunterData.score || 0,\n  email_verified: emailData ? true : false\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "check-email-exists-node",
      "name": "找到电子邮件了吗?",
      "type": "n8n-nodes-base.if",
      "position": [
        1620,
        480
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "email-exists-condition",
              "operator": {
                "type": "string",
                "operation": "isNotEmpty"
              },
              "leftValue": "={{ $json.email }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "generate-personalization-node",
      "name": "生成 AI 个性化",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        1900,
        400
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4-turbo-preview",
          "cachedResultName": "GPT-4 Turbo"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "=You are an expert sales copywriter. Generate a highly personalized cold outreach message based on the prospect's information.\n\n**Prospect Details:**\n- Name: {{ $json.first_name }} {{ $json.last_name }}\n- Title: {{ $json.title }}\n- Company: {{ $json.company }}\n- Location: {{ $json.location }}\n\n**Our Company:** {{ $('Set Campaign Variables').item.json.company_name }}\n**Value Proposition:** {{ $('Set Campaign Variables').item.json.value_proposition }}\n\n**Instructions:**\n1. Start with a personalized opener that references their role or company\n2. Clearly state the value proposition in one sentence\n3. Include a soft call-to-action\n4. Keep it under 100 words\n5. Professional but conversational tone\n6. No hype or pushy language\n\n**Output Format:**\nProvide ONLY the message body, no subject line or greetings. Return as JSON:\n{\n  \"message\": \"your personalized message here\"\n}"
            }
          ]
        },
        "jsonOutput": true
      },
      "typeVersion": 1.8
    },
    {
      "id": "save-to-sheets-node",
      "name": "保存到 Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2260,
        480
      ],
      "parameters": {
        "columns": {
          "value": {
            "Email": "={{ $json.email }}",
            "Title": "={{ $json.title }}",
            "Company": "={{ $json.company }}",
            "Location": "={{ $json.location }}",
            "Full Name": "={{ $json.full_name }}",
            "Last Name": "={{ $json.last_name }}",
            "First Name": "={{ $json.first_name }}",
            "LinkedIn URL": "={{ $json.linkedin_url }}",
            "Enriched Date": "={{ $now.toFormat('yyyy-MM-dd HH:mm:ss') }}",
            "Email Confidence": "={{ $json.email_confidence }}",
            "Personalized Message": "={{ $json.ai_message }}"
          },
          "schema": [],
          "mappingMode": "defineBelow",
          "matchingColumns": []
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_GOOGLE_SHEET_ID",
          "cachedResultName": "Lead Enrichment Sheet"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "merge-ai-data-node",
      "name": "合并 AI 消息",
      "type": "n8n-nodes-base.code",
      "position": [
        2100,
        400
      ],
      "parameters": {
        "jsCode": "// Merge AI-generated message with lead data\nconst leadData = $('Process Email Result').item.json;\nconst aiResponse = $input.item.json.message?.content || {};\nconst aiMessage = aiResponse.message || 'Personalization failed - manual review needed';\n\nreturn {\n  ...leadData,\n  ai_message: aiMessage,\n  processing_timestamp: new Date().toISOString()\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "no-email-found-node",
      "name": "无电子邮件 - 跳过",
      "type": "n8n-nodes-base.noOp",
      "position": [
        1900,
        560
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "rate-limit-wait-node",
      "name": "速率限制延迟",
      "type": "n8n-nodes-base.wait",
      "position": [
        560,
        480
      ],
      "webhookId": "rate-limit-webhook-id",
      "parameters": {
        "unit": "seconds",
        "amount": 2
      },
      "typeVersion": 1.1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "callerPolicy": "workflowsFromSameOwner",
    "errorWorkflow": "",
    "executionOrder": "v1",
    "saveManualExecutions": true
  },
  "versionId": "",
  "connections": {
    "Email Found?": {
      "main": [
        [
          {
            "node": "Generate AI Personalization",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Email - Skip",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge AI Message": {
      "main": [
        [
          {
            "node": "Save to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Rate Limit Delay": {
      "main": [
        [
          {
            "node": "Scrape LinkedIn Profile",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse LinkedIn Data": {
      "main": [
        [
          {
            "node": "Find Email with Hunter.io",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split LinkedIn URLs": {
      "main": [
        [
          {
            "node": "Rate Limit Delay",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process Email Result": {
      "main": [
        [
          {
            "node": "Email Found?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Campaign Variables": {
      "main": [
        [
          {
            "node": "Split LinkedIn URLs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Scrape LinkedIn Profile": {
      "main": [
        [
          {
            "node": "Parse LinkedIn Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find Email with Hunter.io": {
      "main": [
        [
          {
            "node": "Process Email Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate AI Personalization": {
      "main": [
        [
          {
            "node": "Merge AI Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 内容创作, 多模态 AI

需要付费吗?

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

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

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

作者
Amirul Hakimi

Amirul Hakimi

@amirulhaaakimi

CS Student Specializing in Artificial Intelligence @UNITEN | Certified in CRO & Copywriting for High-Impact Digital Growth

外部链接
在 n8n.io 查看

分享此工作流