8
n8n 中文网amn8n.com

我的工作流 3

中级

这是一个AI领域的自动化工作流,包含 15 个节点。主要使用 Set, Code, Wait, Switch, Airtable 等节点,结合人工智能技术实现智能自动化。 通过 Google Search 和 Airtable 查找 LinkedIn 专业人士

前置要求
  • Airtable API Key
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "G4qcWIDe1FQsEXGv",
  "meta": {
    "instanceId": "ea94475e7076b2e72d3d36bb4202c7da062eea5a94e247647c6066ed6cd6f743"
  },
  "name": "我的工作流 3",
  "tags": [],
  "nodes": [
    {
      "id": "2298912a-0c4b-4d29-adab-ea744dcf8e6c",
      "name": "准备搜索参数",
      "type": "n8n-nodes-base.set",
      "position": [
        1500,
        280
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "e17f3c0e-aaa0-406e-a88b-c71da9b3043d",
              "name": "start_index",
              "type": "number",
              "value": 1
            },
            {
              "id": "57148c16-323e-4ef0-88f2-e3c9603907e0",
              "name": "MaxPages",
              "type": "number",
              "value": "={{ $json.Maxresults }}"
            },
            {
              "id": "4954325e-7508-40df-96ab-2541ab82a11a",
              "name": "Position",
              "type": "string",
              "value": "={{ $json.Position }}"
            },
            {
              "id": "52b9ac6d-3c37-4ffc-842b-fe3aaaa202b3",
              "name": "Industry",
              "type": "string",
              "value": "={{ $json.Industry }}"
            },
            {
              "id": "096d13b7-53bb-4f04-8c1b-0d6ce773a515",
              "name": "Region",
              "type": "string",
              "value": "={{ $json.Location }}"
            },
            {
              "id": "ae918172-114a-4d09-b71a-14dce5715b73",
              "name": "IndianKeyword",
              "type": "string",
              "value": "={{ $json['Indian Keyword'] }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "fbedd9dc-fb2d-40a5-8103-e9e3c744586d",
      "name": "Google 自定义搜索 API",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        900,
        640
      ],
      "parameters": {
        "url": "https://www.googleapis.com/customsearch/v1",
        "options": {},
        "sendQuery": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpQueryAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "q",
              "value": "={{ $node['Prepare Search Parameters'].json.Position }} {{ $node['Prepare Search Parameters'].json.Industry }} site:linkedin.com/in"
            },
            {
              "name": "start",
              "value": "={{ $runIndex == 0 ? $('Prepare Search Parameters').item.json.start_index : $('Clean Search Results').item.json.nextPageStartIndex}}"
            },
            {
              "name": "cx",
              "value": "839bb5f56024e4ef5"
            }
          ]
        }
      },
      "credentials": {
        "httpQueryAuth": {
          "id": "9hmD5HuqDDGusrxX",
          "name": "Google Query Auth"
        },
        "httpCustomAuth": {
          "id": "KW4CxrRNOOCs6LmK",
          "name": "Google Custom Search"
        },
        "httpHeaderAuth": {
          "id": "Yd118GvwDLKCBP3V",
          "name": "Google Header Search"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "a30fbcb1-ee95-4629-9d5f-a75532be844e",
      "name": "解析 LinkedIn 个人资料",
      "type": "n8n-nodes-base.code",
      "position": [
        1200,
        640
      ],
      "parameters": {
        "jsCode": "const results = [];\n\nfor (const input of $input.all()) {\n  const response = input.json;\n  const itemsArray = response.items || [];\n  const searchTerms = response.queries?.request?.[0]?.searchTerms || null;\n  const nextPageStartIndex = response.queries?.nextPage?.[0]?.startIndex || null;\n\n  for (const item of itemsArray) {\n    const metatags = item?.pagemap?.metatags?.[0] || {};\n    results.push({\n      json: {\n        title: item.title || null,\n        link: item.link || null,\n        searchTerms: searchTerms,\n        nextPageStartIndex: nextPageStartIndex,\n        snippet: item.snippet || null,\n        ogDescription: metatags[\"og:description\"] || null,\n        twitterImage: metatags[\"twitter:image\"] || null\n      }\n    });\n  }\n}\n\nreturn results;"
      },
      "typeVersion": 2
    },
    {
      "id": "1cce64f7-1875-4ea1-97f9-608942b7185e",
      "name": "清理搜索结果",
      "type": "n8n-nodes-base.set",
      "position": [
        1480,
        640
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "01199a01-b14a-4dcf-9725-bc9a1f9f8ade",
              "name": "Title",
              "type": "string",
              "value": "={{ $json.title }}"
            },
            {
              "id": "641266d0-7325-417a-8dbd-6b9147b6caeb",
              "name": "URL",
              "type": "string",
              "value": "={{ $json.link }}"
            },
            {
              "id": "878fb57e-cd4c-4ed4-aa37-1b172fc5216d",
              "name": "Search",
              "type": "string",
              "value": "={{ $json.searchTerms }}"
            },
            {
              "id": "80f24267-3449-4dbf-8cfb-5932d62b013c",
              "name": "Snippet",
              "type": "string",
              "value": "={{ $json.snippet }}"
            },
            {
              "id": "d5bdea17-1b9c-4fb6-ad4e-f24049ac234f",
              "name": "Description",
              "type": "string",
              "value": "={{ $json.ogDescription }}"
            },
            {
              "id": "8dd30e05-0beb-4ec5-bff7-e2414d659532",
              "name": "nextPageStartIndex",
              "type": "number",
              "value": "={{ $json.nextPageStartIndex }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "2e7d9c6d-4338-4b3b-b84f-5548ca13d272",
      "name": "保存到 Airtable",
      "type": "n8n-nodes-base.airtable",
      "position": [
        1740,
        640
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appwXYS4iHyBt84oE",
          "cachedResultUrl": "https://airtable.com/appwXYS4iHyBt84oE",
          "cachedResultName": "n8n Base"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblaqQMs7pDPtkjee",
          "cachedResultUrl": "https://airtable.com/appwXYS4iHyBt84oE/tblaqQMs7pDPtkjee",
          "cachedResultName": "LinkedIn Prospects"
        },
        "columns": {
          "value": {
            "Title": "={{ $json.Title }}",
            "Search": "={{ $json.Search }}",
            "Snippet": "={{ $json.Snippet }}",
            "Description": "={{ $json.Description }}",
            "linkedin_url": "={{ $json.URL }}"
          },
          "schema": [
            {
              "id": "Title",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "linkedin_url",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "linkedin_url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Search",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Search",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Description",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Description",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Snippet",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Snippet",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "linkedin_url"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "upsert"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "mAzozYUk4HSPBXsi",
          "name": "Airtable Personal Access Token account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "ff878d7b-99e1-4b9b-9e5d-b44452f48b39",
      "name": "当点击\"测试工作流\"时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        120,
        280
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "0df3c92d-ef34-4f24-bfac-f3ae838c87d2",
      "name": "配置搜索设置",
      "type": "n8n-nodes-base.set",
      "position": [
        1220,
        280
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "64c94773-eea2-4013-9718-c9ef5e29ff7c",
              "name": "Position",
              "type": "string",
              "value": "={{ $json.keywords_string }}"
            },
            {
              "id": "89220317-aced-4cfb-8900-841ee0f70a68",
              "name": "Industry",
              "type": "string",
              "value": ""
            },
            {
              "id": "10e66f39-dd61-4a48-b500-18f5854d39ba",
              "name": "Location",
              "type": "string",
              "value": ""
            },
            {
              "id": "428c29b2-17fb-44e5-aeb5-87b30400b591",
              "name": "Maxresults",
              "type": "number",
              "value": 30
            },
            {
              "id": "f610c45f-cf2f-490e-a7e7-53009edf9f87",
              "name": "Indian Keyword",
              "type": "string",
              "value": ""
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "54aa747d-77f1-4403-9af7-dab57b251b18",
      "name": "检查分页",
      "type": "n8n-nodes-base.switch",
      "position": [
        2060,
        640
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "Continue Searching",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "26e85b9b-dfa1-4e00-9ee1-56b912a3b8cd",
                    "operator": {
                      "type": "number",
                      "operation": "lt"
                    },
                    "leftValue": "={{ parseInt($('Clean Search Results').item.json.nextPageStartIndex) }}",
                    "rightValue": "={{ $node['Configure Search Settings'].json.Maxresults}}"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Search Complete",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "8ee350ce-2838-4daa-a6b7-816de8b8c0d4",
                    "operator": {
                      "type": "number",
                      "operation": "gte"
                    },
                    "leftValue": "={{ parseInt($('Clean Search Results').item.json.nextPageStartIndex) }}",
                    "rightValue": "={{ $node['Configure Search Settings'].json.Maxresults}}"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "executeOnce": true,
      "typeVersion": 3.2
    },
    {
      "id": "c40c7226-0d9c-4b5f-b849-ce9fae847407",
      "name": "速率限制延迟",
      "type": "n8n-nodes-base.wait",
      "position": [
        2400,
        620
      ],
      "webhookId": "23f72108-6cd7-4dc3-a81b-16bdae1fa0b5",
      "parameters": {
        "amount": 2
      },
      "typeVersion": 1.1
    },
    {
      "id": "5beda166-e0aa-4080-8434-963f3eb052f1",
      "name": "遍历项目",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        820,
        280
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "63b32072-13fe-4c06-9a95-fe2efb861128",
      "name": "工作流概览",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        -220
      ],
      "parameters": {
        "color": 4,
        "width": 2720,
        "height": 480,
        "content": "## 🔍 使用 Google 搜索的 LinkedIn 潜在客户查找器"
      },
      "typeVersion": 1
    },
    {
      "id": "ea0f16a3-41f4-4567-b788-b74558817915",
      "name": "⚙️ 在此处自定义您的搜索关键词",
      "type": "n8n-nodes-base.set",
      "position": [
        480,
        280
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "c0e68cbc-6e8d-40d7-85d5-ddb60af1389a",
              "name": "keywords_string",
              "type": "string",
              "value": "Store Manager Retail London"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "6c7c6e49-3d78-42af-ae91-25acd9158fce",
      "name": "搜索配置指南",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        480
      ],
      "parameters": {
        "color": 7,
        "width": 760,
        "height": 300,
        "content": "## 🎯 搜索配置"
      },
      "typeVersion": 1
    },
    {
      "id": "60bed7a2-6b9d-4d81-93bb-d07070869360",
      "name": "Google 搜索流程",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        620,
        860
      ],
      "parameters": {
        "color": 5,
        "width": 780,
        "height": 300,
        "content": "## 🔍 Google 搜索引擎"
      },
      "typeVersion": 1
    },
    {
      "id": "1d89f94f-9dc0-43d6-995a-b285438364ee",
      "name": "Airtable 存储",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1400,
        860
      ],
      "parameters": {
        "width": 1200,
        "height": 300,
        "content": "## 📊 数据存储"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "e5c86953-c7a2-466b-948a-ebabada3b069",
  "connections": {
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Configure Search Settings",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Pagination": {
      "main": [
        [
          {
            "node": "Rate Limit Delay",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Rate Limit Delay": {
      "main": [
        [
          {
            "node": "Google Custom Search API",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save to Airtable": {
      "main": [
        [
          {
            "node": "Check Pagination",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clean Search Results": {
      "main": [
        [
          {
            "node": "Save to Airtable",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse LinkedIn Profiles": {
      "main": [
        [
          {
            "node": "Clean Search Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Custom Search API": {
      "main": [
        [
          {
            "node": "Parse LinkedIn Profiles",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Configure Search Settings": {
      "main": [
        [
          {
            "node": "Prepare Search Parameters",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Search Parameters": {
      "main": [
        [
          {
            "node": "Google Custom Search API",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking 'Test workflow'": {
      "main": [
        [
          {
            "node": "⚙️ CUSTOMIZE YOUR SEARCH KEYWORDS HERE",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "⚙️ CUSTOMIZE YOUR SEARCH KEYWORDS HERE": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 人工智能

需要付费吗?

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

工作流信息
难度等级
中级
节点数量15
分类1
节点类型9
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者
Javier Hita

Javier Hita

@javierhita

Building Automation tools as a Data Analyst for over 6 years, N8N is a great tool to leverage that background.

外部链接
在 n8n.io 查看

分享此工作流