8
n8n 中文网amn8n.com

AI驱动的谷歌地图商家数据抓取与表格导出

高级

这是一个Lead Generation, AI Summarization领域的自动化工作流,包含 25 个节点。主要使用 If, Code, Wait, Merge, Filter 等节点。 基于AI的谷歌地图商家数据抓取,支持数据丰富化并导出至表格

前置要求
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {},
  "nodes": [
    {
      "id": "79df5316-c210-478d-a4de-35b5d31924ee",
      "name": "移除重复 URL",
      "type": "n8n-nodes-base.removeDuplicates",
      "position": [
        2000,
        980
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "985ac7e3-b501-4079-a043-780677c94b52",
      "name": "遍历查询",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1500,
        580
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "3a478935-781b-4fb1-bdc7-fcf8be1334bc",
      "name": "使用查询搜索 Google Maps",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1280,
        980
      ],
      "parameters": {
        "url": "=https://www.google.com/maps/search/{{ $json.query }}",
        "options": {
          "allowUnauthorizedCerts": false
        }
      },
      "executeOnce": false,
      "typeVersion": 4.2,
      "alwaysOutputData": false
    },
    {
      "id": "477e7d55-b7d6-4b20-ac44-dd1f443e270a",
      "name": "从结果中抓取 URL",
      "type": "n8n-nodes-base.code",
      "position": [
        1480,
        980
      ],
      "parameters": {
        "jsCode": "const data = $input.first().json.data\n\nconst regex = /https?:\\/\\/[^\\/]+/g\n\nconst urls = data.match(regex)\n\nreturn urls.map(url => ({json: {url: url}}))"
      },
      "typeVersion": 2
    },
    {
      "id": "a5b67e45-a3f6-41d2-aa58-c26a441c41b2",
      "name": "过滤不相关的 URL",
      "type": "n8n-nodes-base.filter",
      "position": [
        1680,
        980
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "041797f2-2fe2-41dc-902a-d34050b9b304",
              "operator": {
                "type": "string",
                "operation": "notRegex"
              },
              "leftValue": "={{ $json.url }}",
              "rightValue": "=(google|gstatic|ggpht|schema\\.org|example\\.com|sentry-next\\.wixpress\\.com|imli\\.com|sentry\\.wixpress\\.com|ingest\\.sentry\\.io)"
            },
            {
              "id": "eb499a7e-17bc-453c-be08-a47286f726dd",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "12f662a8-c55f-409a-b381-f37ab6dd3794",
      "name": "遍历 URL",
      "type": "n8n-nodes-base.splitInBatches",
      "onError": "continueErrorOutput",
      "position": [
        2640,
        980
      ],
      "parameters": {
        "options": {
          "reset": false
        }
      },
      "typeVersion": 3
    },
    {
      "id": "93437e8b-4f8d-40a1-9585-cab1b556164a",
      "name": "启动抓取器工作流",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        800,
        980
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "dffaf04e-d1d2-4002-9a69-f0904b61fc2d",
      "name": "执行间隔等待",
      "type": "n8n-nodes-base.wait",
      "position": [
        2300,
        600
      ],
      "webhookId": "40eb11a9-0f7d-4932-993e-0052b69dbf9b",
      "parameters": {
        "unit": "minutes",
        "amount": 20
      },
      "typeVersion": 1.1
    },
    {
      "id": "18787007-1d11-41b9-89c3-d5f69756eda7",
      "name": "为查询执行抓取器",
      "type": "n8n-nodes-base.executeWorkflow",
      "position": [
        1800,
        600
      ],
      "parameters": {
        "mode": "each",
        "options": {
          "waitForSubWorkflow": false
        },
        "workflowId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $workflow.id }}"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "9fa06f2a-0e7a-43e1-b997-4b4288a990cd",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        4260,
        1360
      ],
      "parameters": {
        "text": "={{ $json.prompt }}",
        "options": {
          "systemMessage": "You are an expert business analyst.\n\nGiven a business website data, generate a JSON object with key business information and a detailed, insightful description that could be used to prepare for outreach or partnership discussions.\n\nFocus the description on:\n\n- What the business does (products/services)\n- Their strengths or market position\n- Technologies or platforms used (if identifiable)\n- Unique value proposition\n- Target customers\n- Any possible gaps, pain points, or areas for improvement\n- Why this business could benefit from external collaboration (e.g., automation, digital transformation, SEO, AI tools)\n\nFormat the output as a single JSON object with these fields:\n\n- business_name\n- website_url\n- email\n- phone_number\n- address\n- city\n- postal_code\n- country\n- latitude\n- longitude\n- category\n- subcategory\n- opening_hours\n- social_media_links (array)\n- about_us\n- services (array)\n- contact_page_url\n- privacy_policy_url\n- terms_conditions_url\n- logo_url\n- languages (array)\n- keywords (array)\n- google_maps_url\n- ai_description_detailed (a detailed paragraph or two with everything above)\n\nOnly output valid JSON.\nif prompt is empty just return empty json data "
        },
        "promptType": "define"
      },
      "typeVersion": 2
    },
    {
      "id": "c191a15f-2457-49c1-976b-90b0caaf3835",
      "name": "OpenRouter聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        4260,
        1620
      ],
      "parameters": {
        "model": "google/gemini-2.5-flash-lite-preview-06-17",
        "options": {}
      },
      "credentials": {
        "openRouterApi": {
          "id": "tC9q2VizRVbSvlww",
          "name": "OpenRouter account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "20c5612b-8fbf-4eb4-8f95-ca17acc5f0e2",
      "name": "代码",
      "type": "n8n-nodes-base.code",
      "position": [
        4680,
        960
      ],
      "parameters": {
        "jsCode": "const allPromptResults = $input.first().json.data.map(item => item.promptResult).join('\\n');\n\n\nreturn {\n  \"prompt\":allPromptResults\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "53d2251a-f7bb-43b1-8035-c7ac74e0aa62",
      "name": "聚合",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        4420,
        960
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData"
      },
      "typeVersion": 1
    },
    {
      "id": "67dfef97-0fc2-4fa8-a7a8-08c491f8785f",
      "name": "计划触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        1060,
        580
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "cb651c6d-eac0-44bc-8d80-c07c5a65ce6a",
      "name": "获取表格中的行",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1280,
        580
      ],
      "parameters": {
        "options": {},
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "processed"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1652190371,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1si2IQusnIF-Br8JdXSVd_Z9QvnXrKcieXOkxI0Xz9ks/edit#gid=1652190371",
          "cachedResultName": "keywords"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1si2IQusnIF-Br8JdXSVd_Z9QvnXrKcieXOkxI0Xz9ks",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1si2IQusnIF-Br8JdXSVd_Z9QvnXrKcieXOkxI0Xz9ks/edit?usp=drivesdk",
          "cachedResultName": "google maps  bussiness informations"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "c7TYv7ZcF6y7LGEQ",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "423dce21-e06d-4bd2-833b-976b3ce9e231",
      "name": "在表格中更新行",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2040,
        600
      ],
      "parameters": {
        "columns": {
          "value": {
            "query": "={{ $json.query }}",
            "processed": "TRUE"
          },
          "schema": [
            {
              "id": "query",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "query",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "processed",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "processed",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "query"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1652190371,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1si2IQusnIF-Br8JdXSVd_Z9QvnXrKcieXOkxI0Xz9ks/edit#gid=1652190371",
          "cachedResultName": "keywords"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1si2IQusnIF-Br8JdXSVd_Z9QvnXrKcieXOkxI0Xz9ks",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1si2IQusnIF-Br8JdXSVd_Z9QvnXrKcieXOkxI0Xz9ks/edit?usp=drivesdk",
          "cachedResultName": "google maps  bussiness informations"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "c7TYv7ZcF6y7LGEQ",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "a996171f-c358-471d-91ba-b6c9950e7edf",
      "name": "如果",
      "type": "n8n-nodes-base.if",
      "position": [
        3940,
        980
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "7eec5545-99ac-410a-87ec-4e5f79e30202",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.dontExist }}",
              "rightValue": ""
            },
            {
              "id": "96fe4cf5-4689-4140-8a75-8bdbc893b363",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "4575083d-5d45-497e-a5d1-5c369f2d7b91",
      "name": "合并",
      "type": "n8n-nodes-base.merge",
      "position": [
        3660,
        980
      ],
      "parameters": {
        "mode": "combineBySql",
        "query": "SELECT * FROM input1 LEFT JOIN input2 ON 1=1",
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "73814b4e-ab19-4a06-b180-a2997e43bdbd",
      "name": "将字符串转换为 JSON 对象",
      "type": "n8n-nodes-base.code",
      "onError": "continueRegularOutput",
      "position": [
        4640,
        1360
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "\n\nlet raw = $json.output;\n\n// Remove ```json or ``` wrapping if it exists\nraw = raw.replace(/^```json\\s*|\\s*```$/g, '').trim();\n\nlet outputJson;\n\ntry {\n  outputJson = JSON.parse(raw);\n} catch (err) {\n  outputJson = { error: 'Invalid JSON format in promptResult' };\n}\n\nreturn {\n  json: outputJson\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "54d94ef2-84cf-4568-a9d5-28ec9a818ffd",
      "name": "将数据保存到 Google Sheet1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        5060,
        1360
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [
            {
              "id": "Business Name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Business Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Website URL",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Website URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Phone Number",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Phone Number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Address",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Address",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "City",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "City",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Postal Code",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Postal Code",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Country",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Country",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Latitude",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Latitude",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Longitude",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Longitude",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Category",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Category",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Subcategory",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Subcategory",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Opening Hours",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Opening Hours",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Social Media Links",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Social Media Links",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "About Us",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "About Us",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Services",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Services",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Contact Page URL",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Contact Page URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Privacy Policy URL",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Privacy Policy URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Terms & Conditions URL",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Terms & Conditions URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Logo URL",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Logo URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Languages",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Languages",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Keywords",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Keywords",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Google Maps URL",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Google Maps URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "AI Description",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "AI Description",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "autoMapInputData",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1si2IQusnIF-Br8JdXSVd_Z9QvnXrKcieXOkxI0Xz9ks/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1si2IQusnIF-Br8JdXSVd_Z9QvnXrKcieXOkxI0Xz9ks",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1si2IQusnIF-Br8JdXSVd_Z9QvnXrKcieXOkxI0Xz9ks/edit?usp=drivesdk",
          "cachedResultName": "google maps  bussiness informations"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "c7TYv7ZcF6y7LGEQ",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "40ec6d1f-1c98-4c9f-8499-c5893c3df7b9",
      "name": "使用 APIFY",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        4200,
        960
      ],
      "parameters": {
        "url": "=https://api.apify.com/v2/acts/mohamedgb00714~firescraper-ai-prompt-website-content-markdown-scraper/run-sync-get-dataset-items?token=apify_api_DUMMY_TOKEN",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"enqueue\": true,\n  \"getHtml\": false,\n  \"getText\": false,\n  \"prompt\": \"You are an expert business analyst.\\n\\nGiven a business website URL, generate a JSON object with key business information and a detailed, insightful description that could be used to prepare for outreach or partnership discussions.\\n\\nFocus the description on:\\n\\n- What the business does (products/services)\\n- Their strengths or market position\\n- Technologies or platforms used (if identifiable)\\n- Unique value proposition\\n- Target customers\\n- Any possible gaps, pain points, or areas for improvement\\n- Why this business could benefit from external collaboration (e.g., automation, digital transformation, SEO, AI tools)\\n\\nFormat the output as a single JSON object with these fields:\\n\\n- business_name\\n- website_url\\n- email\\n- phone_number\\n- address\\n- city\\n- postal_code\\n- country\\n- latitude\\n- longitude\\n- category\\n- subcategory\\n- opening_hours\\n- social_media_links (array)\\n- about_us\\n- services (array)\\n- contact_page_url\\n- privacy_policy_url\\n- terms_conditions_url\\n- logo_url\\n- languages (array)\\n- keywords (array)\\n- google_maps_url\\n- ai_description_detailed (a detailed paragraph or two with everything above)\\n\\nOnly output valid JSON.\",\n  \"screenshot\": false,\n  \"startUrls\": [\n    {\n      \"url\": \"{{$json.url}}\",\n      \"method\": \"GET\"\n    }\n  ]\n}\n",
        "sendBody": true,
        "specifyBody": "json"
      },
      "typeVersion": 4.2,
      "alwaysOutputData": false
    },
    {
      "id": "e4997964-dc80-4778-9f79-ae4dc9e41284",
      "name": "获取记录(如果存在)",
      "type": "n8n-nodes-base.googleSheets",
      "onError": "continueErrorOutput",
      "position": [
        2900,
        1300
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1si2IQusnIF-Br8JdXSVd_Z9QvnXrKcieXOkxI0Xz9ks/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1si2IQusnIF-Br8JdXSVd_Z9QvnXrKcieXOkxI0Xz9ks",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1si2IQusnIF-Br8JdXSVd_Z9QvnXrKcieXOkxI0Xz9ks/edit?usp=drivesdk",
          "cachedResultName": "google maps  bussiness informations"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "c7TYv7ZcF6y7LGEQ",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.6,
      "alwaysOutputData": true
    },
    {
      "id": "d2380d4e-20a5-48bb-9d87-3f2c638f2fc7",
      "name": "代码1",
      "type": "n8n-nodes-base.code",
      "position": [
        3400,
        1280
      ],
      "parameters": {
        "jsCode": "let dontExist = true;\n\n// Get reference domain from 'Loop over URLs' node\nconst referenceUrl = $('Loop over URLs').first().json.url;\nconst referenceDomain = referenceUrl.match(/^https?:\\/\\/([^\\/?#]+)(?:[\\/?#]|$)/i)?.[1]?.toLowerCase();\n\nif (!referenceDomain) {\n  throw new Error('Invalid reference URL');\n}\n\n// Loop over input items\nfor (const item of $input.all()) {\n  const urls = item.json.website_url;\n\n  for (const url of urls) {\n    const domain = url.match(/^https?:\\/\\/([^\\/?#]+)(?:[\\/?#]|$)/i)?.[1]?.toLowerCase();\n    if (!domain) continue;\n\n    if (domain === referenceDomain) {\n      dontExist = false;\n      break;\n    }\n  }\n\n  if (!dontExist) break;\n}\n\n// Return result\nreturn {\n  json: {\n    dontExist\n  }\n};\n"
      },
      "typeVersion": 2
    },
    {
      "id": "0273b1f4-5912-41fd-9899-3ec0a5a24f6c",
      "name": "聚合1",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        3160,
        1280
      ],
      "parameters": {
        "options": {},
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "fieldToAggregate": "website_url"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "2adf371b-2b7b-4ce9-9666-95a4b892a963",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        20,
        240
      ],
      "parameters": {
        "width": 680,
        "height": 2220,
        "content": ""
      },
      "typeVersion": 1
    }
  ],
  "pinData": {
    "Starts scraper workflow": [
      {
        "query": "restaurant+paris"
      }
    ]
  },
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "use APIFY",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop over URLs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code1": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "convert string to json object",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "use APIFY": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate1": {
      "main": [
        [
          {
            "node": "Code1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop over URLs": {
      "main": [
        [],
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          },
          {
            "node": "get records if exist",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get row(s) in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop over queries": {
      "main": [
        [],
        [
          {
            "node": "Execute scraper for query",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet": {
      "main": [
        [
          {
            "node": "Loop over queries",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update row in sheet": {
      "main": [
        [
          {
            "node": "Wait between executions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get records if exist": {
      "main": [
        [
          {
            "node": "Aggregate1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Remove Duplicate URLs": {
      "main": [
        [
          {
            "node": "Loop over URLs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter irrelevant URLs": {
      "main": [
        [
          {
            "node": "Remove Duplicate URLs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Starts scraper workflow": {
      "main": [
        [
          {
            "node": "Search Google Maps with query",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait between executions": {
      "main": [
        [
          {
            "node": "Loop over queries",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Scrape URLs from results": {
      "main": [
        [
          {
            "node": "Filter irrelevant URLs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Execute scraper for query": {
      "main": [
        [
          {
            "node": "Update row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save DATA to Google Sheet1": {
      "main": [
        [
          {
            "node": "Loop over URLs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search Google Maps with query": {
      "main": [
        [
          {
            "node": "Scrape URLs from results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "convert string to json object": {
      "main": [
        [
          {
            "node": "Save DATA to Google Sheet1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 潜在客户开发, AI 摘要总结

需要付费吗?

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

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

适合高级用户,包含 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 查看

分享此工作流