8
n8n 中文网amn8n.com

基于 AI、社交媒体和 WhatsApp 链接的自动化本地商业线索生成器

高级

这是一个Lead Generation, Multimodal AI领域的自动化工作流,包含 29 个节点。主要使用 If, Code, Limit, SplitOut, Telegram 等节点。 使用 AI、社交媒体和 WhatsApp 链接自动生成本地商业线索

前置要求
  • Telegram Bot Token
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "4Gt0UvB5ArkeE7Hi",
  "meta": {
    "instanceId": "0d045f8fe3802ff2be0bb9a9ea445ee6c9ed61973377effe00767e483681e2f4",
    "templateCredsSetupCompleted": true
  },
  "name": "基于 AI、社交媒体和 WhatsApp 链接的自动化本地商业线索生成器",
  "tags": [],
  "nodes": [
    {
      "id": "e1e728f2-c48b-493b-8d73-0f72993083cd",
      "name": "HTTP 请求",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        420,
        0
      ],
      "parameters": {
        "url": "https://serpapi.com/search",
        "options": {},
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "api_key",
              "value": "YOUR_SERPAPI_KEY"
            },
            {
              "name": "engine",
              "value": "google_maps"
            },
            {
              "name": "type",
              "value": "search"
            },
            {
              "name": "google_domain",
              "value": "google.com"
            },
            {
              "name": "q",
              "value": "={{ $json.keyword }} {{ $json['city or specific location'] }}"
            },
            {
              "name": "gl",
              "value": "={{ $json['country code'] }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "efd6137c-6c9a-482c-92e4-e4691361be26",
      "name": "基础 LLM 链",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        1720,
        -100
      ],
      "parameters": {
        "text": "=Business Information:\n\nName: {{ $json.title }}\nAddress: {{ $json.address }}\nRating: {{ $json.rating }} (based on {{ $json.reviews }} reviews)\nTypes: {{ $json.types }}\nPhone: {{ $json.phone }}\nWebsite: {{ $json.website }}\nReviews Link: {{ $json.reviews_link }}",
        "batching": {},
        "messages": {
          "messageValues": [
            {
              "message": "=You are a digital business consultant. Based on the business information below, write a professional message directly addressed to the business owner.\nThe message should include:\n\nA brief summary of how the business is currently positioned (based on business type and typical customers)\nWhat customers likely appreciate most about the business\nAreas that could be improved for better visibility, engagement, or conversions\nOne actionable suggestion or opportunity for growth\nA short, persuasive closing line or CTA inviting them to improve their online presence or marketing strategy\nUse a helpful and respectful tone as if offering a free evaluation. Write in the language corresponding to the country code: {{ $('Get row(s) in sheet').item.json['country code'] }}."
            }
          ]
        },
        "promptType": "define"
      },
      "typeVersion": 1.7
    },
    {
      "id": "933599b0-9cd8-4719-8c58-d3c6bae7c720",
      "name": "在表格中追加或更新行",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        860,
        0
      ],
      "parameters": {
        "columns": {
          "value": {
            "phone": "={{ \"https://wa.me/\" + $json.phone.replace(/\\D/g, \"\") }}",
            "title": "={{ $json.title }}",
            "types": "={{ $json.types }}",
            "rating": "={{ $json.rating }}",
            "address": "={{ $json.address }}",
            "data_id": "={{ $json.data_id }}",
            "reviews": "={{ $json.reviews }}",
            "website": "={{ $json.website }}",
            "reviews_link": "={{ $json.reviews_link }}"
          },
          "schema": [
            {
              "id": "data_id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "data_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "title",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "address",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "address",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "rating",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "rating",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "reviews",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "reviews",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "reviews_link",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "reviews_link",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "types",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "types",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "phone",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "phone",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "website",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "website",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "review_summary",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "review_summary",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "whatsapp_link_1",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "whatsapp_link_1",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "whatsapp_link_1_status",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "whatsapp_link_1_status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "instagram",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "instagram",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "tiktok",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "tiktok",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "web_summary",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "web_summary",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "whatsapp_link_2",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "whatsapp_link_2",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "whatsapp_link_2_status",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "whatsapp_link_2_status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "data_id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1321933612,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEET_ID/edit#gid=1321933612",
          "cachedResultName": "results"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_GOOGLE_SHEET_ID",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEET_ID/edit?usp=drivesdk",
          "cachedResultName": "Automated Local Business Lead Generator using AI, Gmail & Telegram"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "9eb71830-c068-4121-98fb-2fea45840451",
      "name": "发送短信",
      "type": "n8n-nodes-base.telegram",
      "position": [
        2540,
        160
      ],
      "webhookId": "73212779-f86d-4e82-bdd2-605adac6069f",
      "parameters": {
        "text": "=----\n\nLatest Data for Follow Up\n\nBusiness Name: {{ $('Limit').item.json.title }}\nBusiness Types : {{ $('Limit').item.json.types }}\nLocation: {{ $('Limit').item.json.address }}\n\nWhatsapp Link: \n{{ $('Limit').item.json.phone }}\n\n----",
        "chatId": "YOUR_TELEGRAM_CHAT_ID",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "692059f0-ee24-409e-8f0c-1169404e4831",
      "name": "计划触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        20,
        0
      ],
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "bfbc2bdb-f14a-4788-8775-2459caae979d",
      "name": "获取表格中的行",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        220,
        0
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEET_ID/edit#gid=0",
          "cachedResultName": "data"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_GOOGLE_SHEET_ID",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEET_ID/edit?usp=drivesdk",
          "cachedResultName": "Automated Local Business Lead Generator using AI, Gmail & Telegram"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "0ece857b-9e1e-4dc2-b368-71226683bd70",
      "name": "OpenRouter 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        1720,
        80
      ],
      "parameters": {
        "model": "google/gemini-2.0-flash-exp:free",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "71fea344-66b3-4042-aa2b-424b6d50bfb5",
      "name": "如果存在网站",
      "type": "n8n-nodes-base.if",
      "position": [
        2260,
        -100
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "6a19bdfe-33c6-4786-897a-1d292f647db6",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $('Limit').item.json.website }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "0a4385ce-7460-43eb-99ba-2552e90f2b7f",
      "name": "在表格1中追加或更新行",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2960,
        -680
      ],
      "parameters": {
        "columns": {
          "value": {
            "tiktok": "={{ $json.tiktok }}",
            "data_id": "={{ $('Limit').item.json.data_id }}",
            "instagram": "={{ $json.instagram }}"
          },
          "schema": [
            {
              "id": "data_id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "data_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "title",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "address",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "address",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "rating",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "rating",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "reviews",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "reviews",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "reviews_link",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "reviews_link",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "types",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "types",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "phone",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "phone",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "website",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "website",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "review_summary",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "review_summary",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "whatsapp_link_1",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "whatsapp_link_1",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "whatsapp_link_1_status",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "whatsapp_link_1_status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "instagram",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "instagram",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "tiktok",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "tiktok",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "web_summary",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "web_summary",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "whatsapp_link_2",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "whatsapp_link_2",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "whatsapp_link_2_status",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "whatsapp_link_2_status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "data_id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1321933612,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEET_ID/edit#gid=1321933612",
          "cachedResultName": "results"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_GOOGLE_SHEET_ID",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEET_ID/edit?usp=drivesdk",
          "cachedResultName": "Automated Local Business Lead Generator using AI, Gmail & Telegram"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "ff892256-4826-4d6b-a467-c25ac1feed85",
      "name": "基础 LLM 链1",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        2960,
        -220
      ],
      "parameters": {
        "text": "=Business name: {{ $('Limit').item.json.title }}\nWebsite URL: {{ $('Limit').item.json.website }}\nWebsite content: {{ $('HTTP Request1').item.json.data }}\n",
        "batching": {},
        "messages": {
          "messageValues": [
            {
              "message": "=Please help create a professional message to the business owner based on the following website content. Focus on a brief analysis and improvement suggestions, and conclude with an invitation to discuss with our digital agency.\n\nFormat the message like this:\n---\n\nWe visited [business name]'s website and found that [...].\n[Paragraph 2: Suggested technical/UX/SEO improvements in a polite and professional manner.]\n[Paragraph 3: Suggestion from the agency, including name and CTA.]\n\nUse a polite, clear, and concise style. Use emoji to make more interactive. Write in country code {{ $('Get row(s) in sheet').item.json['country code'] }} language."
            }
          ]
        },
        "promptType": "define"
      },
      "typeVersion": 1.7
    },
    {
      "id": "d721c358-0fa8-4b76-ad68-81871439f497",
      "name": "在表格2中追加或更新行",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        3300,
        -220
      ],
      "parameters": {
        "columns": {
          "value": {
            "data_id": "={{ $('Limit').item.json.data_id }}",
            "web_summary": "={{ $json.text }}"
          },
          "schema": [
            {
              "id": "data_id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "data_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "title",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "address",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "address",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "rating",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "rating",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "reviews",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "reviews",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "reviews_link",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "reviews_link",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "types",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "types",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "phone",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "phone",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "website",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "website",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "review_summary",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "review_summary",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "whatsapp_link_1",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "whatsapp_link_1",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "whatsapp_link_1_status",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "whatsapp_link_1_status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "instagram",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "instagram",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "tiktok",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "tiktok",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "web_summary",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "web_summary",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "whatsapp_link_2",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "whatsapp_link_2",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "whatsapp_link_2_status",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "whatsapp_link_2_status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "data_id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1321933612,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEET_ID/edit#gid=1321933612",
          "cachedResultName": "results"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_GOOGLE_SHEET_ID",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEET_ID/edit?usp=drivesdk",
          "cachedResultName": "Automated Local Business Lead Generator using AI, Gmail & Telegram"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "da07d108-1e9a-4165-a00c-46a34ab0ef98",
      "name": "发送短信1",
      "type": "n8n-nodes-base.telegram",
      "position": [
        3520,
        -220
      ],
      "webhookId": "6f77a0b9-23cb-4a4b-8f23-c47f816e4fde",
      "parameters": {
        "text": "=----\n\nLatest Data for Follow Up\n\nBusiness Name: {{ $('Limit').item.json.title }}\nBusiness Types : {{ $('Limit').item.json.types }}\nLocation: {{ $('Limit').item.json.address }}\n\nWhatsapp Link: \n{{ $('Limit').item.json.phone }}\n\n----",
        "chatId": "=YOUR_TELEGRAM_CHAT_ID",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "ed94c401-a892-44a4-ae30-7e15a23acfcc",
      "name": "拆分输出",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        640,
        0
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "local_results"
      },
      "executeOnce": true,
      "typeVersion": 1
    },
    {
      "id": "f9817682-0399-4635-82ba-9f9e9f8c1ddd",
      "name": "获取表格1中的行",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1080,
        0
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1321933612,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEET_ID/edit#gid=1321933612",
          "cachedResultName": "results"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_GOOGLE_SHEET_ID",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEET_ID/edit?usp=drivesdk",
          "cachedResultName": "Automated Local Business Lead Generator using AI, Gmail & Telegram"
        }
      },
      "executeOnce": true,
      "typeVersion": 4.6
    },
    {
      "id": "dcbf3521-62f1-4ece-b590-d018fa18fc56",
      "name": "条件判断",
      "type": "n8n-nodes-base.if",
      "position": [
        1300,
        0
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "febcf30b-1a4b-4ac3-971a-dcb5f471dee0",
              "operator": {
                "type": "string",
                "operation": "empty",
                "singleValue": true
              },
              "leftValue": "={{ $json.review_summary }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "373f6a6f-4bf1-4403-8ba2-01d7cd3bebd5",
      "name": "限制",
      "type": "n8n-nodes-base.limit",
      "position": [
        1520,
        -100
      ],
      "parameters": {
        "maxItems": 5
      },
      "typeVersion": 1
    },
    {
      "id": "e2a8be2e-1476-491c-97c2-48a80d65006c",
      "name": "在表格3中追加或更新行",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2060,
        -100
      ],
      "parameters": {
        "columns": {
          "value": {
            "data_id": "={{ $('Limit').item.json.data_id }}",
            "review_summary": "={{ $json.text }}"
          },
          "schema": [
            {
              "id": "data_id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "data_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "title",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "address",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "address",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "rating",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "rating",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "reviews",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "reviews",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "reviews_link",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "reviews_link",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "types",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "types",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "phone",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "phone",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "website",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "website",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "review_summary",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "review_summary",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "whatsapp_link_1",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "whatsapp_link_1",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "whatsapp_link_1_status",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "whatsapp_link_1_status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "instagram",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "instagram",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "tiktok",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "tiktok",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "web_summary",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "web_summary",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "whatsapp_link_2",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "whatsapp_link_2",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "whatsapp_link_2_status",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "whatsapp_link_2_status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "data_id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1321933612,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEET_ID/edit#gid=1321933612",
          "cachedResultName": "results"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_GOOGLE_SHEET_ID",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEET_ID/edit?usp=drivesdk",
          "cachedResultName": "Automated Local Business Lead Generator using AI, Gmail & Telegram"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "65bea1ea-2295-4e6d-8c63-4fbde97d1d1e",
      "name": "HTTP 请求1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2540,
        -220
      ],
      "parameters": {
        "url": "={{ $('Limit').item.json.website }}",
        "options": {}
      },
      "executeOnce": true,
      "typeVersion": 4.2
    },
    {
      "id": "b9c345c3-f9ca-4620-85e5-fea50f92192e",
      "name": "代码",
      "type": "n8n-nodes-base.code",
      "position": [
        2740,
        -680
      ],
      "parameters": {
        "jsCode": "const html = $json[\"data\"];\nconst ig = html.match(/https?:\\/\\/(www\\.)?instagram\\.com\\/[^\\s\"']+/i);\nconst tiktok = html.match(/https?:\\/\\/(www\\.)?tiktok\\.com\\/[^\\s\"']+/i);\n\nreturn [{\n  json: {\n    instagram: ig ? ig[0] : null,\n    tiktok: tiktok ? tiktok[0] : null\n  }\n}];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "f2d95980-fb2c-4d47-ac8a-cbd7d81e09cb",
      "name": "OpenRouter 聊天模型1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        2960,
        -40
      ],
      "parameters": {
        "model": "google/gemini-2.0-flash-exp:free",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "e540d2bc-d534-44ac-9367-7c3c847fdc86",
      "name": "空操作,不执行任何动作",
      "type": "n8n-nodes-base.noOp",
      "position": [
        1520,
        280
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "27a67c3f-249b-44c5-b500-e77812bf3369",
      "name": "代码1",
      "type": "n8n-nodes-base.code",
      "position": [
        2740,
        -220
      ],
      "parameters": {
        "jsCode": "const html = $json[\"data\"] || \"\";\n\n// Fungsi bantu untuk ekstrak teks antar tag\nfunction extractTag(tag, html) {\n  const regex = new RegExp(`<${tag}[^>]*>(.*?)<\\\\/${tag}>`, 'gis');\n  const matches = [];\n  let match;\n  while ((match = regex.exec(html)) !== null) {\n    const clean = match[1].replace(/<[^>]*>/g, '').trim();\n    if (clean.length > 5) matches.push(clean);\n  }\n  return matches;\n}\n\n// Fungsi untuk ambil meta tag\nfunction extractMeta(name, html) {\n  const regex = new RegExp(`<meta[^>]+name=[\"']${name}[\"'][^>]+content=[\"']([^\"']+)[\"']`, 'i');\n  const match = regex.exec(html);\n  return match ? match[1].trim() : '';\n}\n\n// Ambil bagian penting\nconst title = extractTag('title', html)[0] || '';\nconst description = extractMeta('description', html);\nconst keywords = extractMeta('keywords', html);\nconst headings = extractTag('h1', html).concat(extractTag('h2', html), extractTag('h3', html), extractTag('h4', html));\nconst paragraphs = extractTag('p', html).filter(p => p.length > 30 && p.length < 300);\nconst buttons = extractTag('button', html).concat(extractTag('a', html)).filter(t => /order|buy|join|shop|sign|book|start|contact|subscribe/i.test(t));\n\n// Hasil akhir\nconst summary = [\n  `🔹 Title:\\n${title}`,\n  `🔹 Description:\\n${description}`,\n  `🔹 Keywords:\\n${keywords}`,\n  `🔹 Headings:\\n${headings.slice(0, 5).join('\\n') || '(Tidak ditemukan)'}`,\n  `🔹 Paragraf Penting:\\n${paragraphs.slice(0, 3).join('\\n\\n') || '(Tidak ditemukan)'}`,\n  `🔹 CTA / Tombol:\\n${buttons.slice(0, 5).join('\\n') || '(Tidak ditemukan)'}`\n].join('\\n\\n');\n\nreturn [{ json: { simplified_summary: summary } }];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "f2af7012-3463-4e49-aa21-7c18625026c5",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -600,
        -540
      ],
      "parameters": {
        "width": 540,
        "height": 1240,
        "content": "# 基于 AI、社交媒体和 WhatsApp 链接的自动化本地商业线索生成器"
      },
      "typeVersion": 1
    },
    {
      "id": "ee7d5e30-8c35-4278-96f9-97a31a3b3204",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -20,
        -200
      ],
      "parameters": {
        "color": 2,
        "width": 580,
        "height": 380,
        "content": "- 根据指定计划自动运行工作流"
      },
      "typeVersion": 1
    },
    {
      "id": "cfacf4f1-b561-4e48-8306-63567d337f30",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        620,
        -200
      ],
      "parameters": {
        "color": 4,
        "width": 800,
        "height": 380,
        "content": "- 将 SerpAPI JSON 输出中的本地结果数组拆分为独立项进行单独处理"
      },
      "typeVersion": 1
    },
    {
      "id": "82526c8d-2ff1-42b9-9de7-b3c56d49d96e",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1480,
        -340
      ],
      "parameters": {
        "color": 5,
        "width": 920,
        "height": 560,
        "content": "- 为提升效率限制提交给 LLM 的项目数量(例如每批次仅处理5家企业)"
      },
      "typeVersion": 1
    },
    {
      "id": "3ed718a5-eab3-4bee-a114-14248fcb3f99",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2720,
        -400
      ],
      "parameters": {
        "color": 6,
        "width": 500,
        "height": 500,
        "content": "- 从企业网站获取 HTML 内容"
      },
      "typeVersion": 1
    },
    {
      "id": "4a093569-46b8-4066-ba07-b751f2003419",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3260,
        -400
      ],
      "parameters": {
        "color": 7,
        "width": 500,
        "height": 500,
        "content": "- 将分析结果保存到 Google Sheets"
      },
      "typeVersion": 1
    },
    {
      "id": "b138f46b-a0bd-43e0-89b6-b51e76178082",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2720,
        -840
      ],
      "parameters": {
        "color": 7,
        "width": 500,
        "height": 400,
        "content": "- 从企业网站页面查找 Instagram 和 TikTok 账户链接"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "d17193ca-d795-492a-985a-4183538f81ab",
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Limit",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code": {
      "main": [
        [
          {
            "node": "Append or update row in sheet1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code1": {
      "main": [
        [
          {
            "node": "Basic LLM Chain1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Limit": {
      "main": [
        [
          {
            "node": "Basic LLM Chain",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Append or update row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If has a web": {
      "main": [
        [
          {
            "node": "HTTP Request1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send a text message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request1": {
      "main": [
        [
          {
            "node": "Code1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Basic LLM Chain": {
      "main": [
        [
          {
            "node": "Append or update row in sheet3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Basic LLM Chain1": {
      "main": [
        [
          {
            "node": "Append or update row in sheet2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get row(s) in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet1": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Basic LLM Chain",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Basic LLM Chain1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Append or update row in sheet": {
      "main": [
        [
          {
            "node": "Get row(s) in sheet1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append or update row in sheet2": {
      "main": [
        [
          {
            "node": "Send a text message1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append or update row in sheet3": {
      "main": [
        [
          {
            "node": "If has a web",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 潜在客户开发, 多模态 AI

需要付费吗?

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

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

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

作者
Budi SJ

Budi SJ

@budisj

I’m a Product Designer who also works as an Automation Developer. With a background in product design and systems thinking, I build user-centered workflows. My focus is on helping teams and businesses work more productively through impactful automation systems.

外部链接
在 n8n.io 查看

分享此工作流