8
n8n 中文网amn8n.com

使用APIFY和ChatGPT抓取并总结Google Maps企业信息

高级

这是一个Lead Generation, AI Summarization领域的自动化工作流,包含 16 个节点。主要使用 Wait, GoogleSheets, Apify, ManualTrigger, SplitInBatches 等节点。 使用 APIFY + GPT-4O 抓取并总结 Google Maps 企业信息到表格

前置要求
  • Google Sheets API 凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "IyvxP8Yujze5aEKB",
  "meta": {
    "instanceId": "237139412ba2bdccb5393d058ace6ee50c6bb809e4f130ea2f9b24f70a336b94",
    "templateCredsSetupCompleted": true
  },
  "name": "使用APIFY和ChatGPT抓取并总结Google Maps企业信息",
  "tags": [],
  "nodes": [
    {
      "id": "330c09af-1f34-4b17-9baf-1018f088a77f",
      "name": "点击\"执行工作流\"时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        0,
        0
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "dc21d5a5-2fa0-44db-b95e-5d3de2eeae74",
      "name": "获取数据集项",
      "type": "@apify/n8n-nodes-apify.apify",
      "position": [
        416,
        0
      ],
      "parameters": {
        "limit": {},
        "offset": {},
        "resource": "Datasets",
        "datasetId": "={{ $json.defaultDatasetId }}"
      },
      "credentials": {
        "apifyApi": {
          "id": "choqDlR2CQ2ezzuP",
          "name": "Jaures"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "aa25d18c-4d21-4742-a511-58cd4083b845",
      "name": "去除重复项",
      "type": "n8n-nodes-base.removeDuplicates",
      "position": [
        624,
        0
      ],
      "parameters": {
        "compare": "selectedFields",
        "options": {},
        "fieldsToCompare": "title"
      },
      "typeVersion": 2
    },
    {
      "id": "dc4e16bc-6c4c-4cd0-8ab2-20503ab85d32",
      "name": "运行Google Maps抓取器",
      "type": "@apify/n8n-nodes-apify.apify",
      "position": [
        208,
        0
      ],
      "parameters": {
        "actorId": {
          "__rl": true,
          "mode": "list",
          "value": "nwua9Gu5YrADL7ZDj",
          "cachedResultUrl": "https://console.apify.com/actors/nwua9Gu5YrADL7ZDj/input",
          "cachedResultName": "Google Maps Scraper (compass/crawler-google-places)"
        },
        "timeout": {},
        "customBody": "{\n    \"countryCode\": \"fr\",\n    \"includeWebResults\": false,\n    \"language\": \"fr\",\n    \"locationQuery\": \"France\",\n    \"maxCrawledPlacesPerSearch\": 5,\n    \"maxImages\": 0,\n    \"maximumLeadsEnrichmentRecords\": 0,\n    \"scrapeContacts\": true,\n    \"scrapeDirectories\": false,\n    \"scrapeImageAuthors\": false,\n    \"scrapePlaceDetailPage\": false,\n    \"scrapeReviewsPersonalData\": true,\n    \"scrapeTableReservationProvider\": false,\n    \"searchStringsArray\": [\n        \"restaurant\"\n    ],\n    \"skipClosedPlaces\": true,\n    \"website\": \"allPlaces\"\n}"
      },
      "credentials": {
        "apifyApi": {
          "id": "choqDlR2CQ2ezzuP",
          "name": "Jaures"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "872850ef-da9f-48b5-a5b1-4ec15482fcc8",
      "name": "公司摘要信息",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        1056,
        16
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "GPT-4O"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "You are a helpful assistant that generates professional and concise company summaries from raw data scraped from Google Maps. Your goal is to return a natural, readable paragraph containing the company name, business category, address, city, phone number, and a link to the company's location on Google Maps.\n"
            },
            {
              "content": "=Please generate a short and clear summary of the following company, including:\n- Company name\n- Business category\n- Address (with city and country)\n- Phone number\n- A link to the company’s page on Google Maps\n\nHere is the raw data:\nCompany Name: {{ $json.title }}\nCategory: {{ $json.categoryName }}\nAddress: {{ $json.address }}\nCity: {{ $json.city }}\nCountry: {{ $json.countryCode }}\nPhone: {{ $json.phone }}\nGoogle Maps URL:{{ $json.url }}\n\nOnly output a paragraph like this:\n\"The company name is [Name]. It is a [category] located at [address] in [city, country]. You can contact them at [phone]. For more info, visit their Google Maps page: [URL]\"\n"
            },
            {
              "content": "Output the result in the JSON format companySummary"
            }
          ]
        },
        "jsonOutput": true
      },
      "credentials": {
        "openAiApi": {
          "id": "4VqZqJC6pT0IuOn5",
          "name": "Masterclass"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "1283f68e-099e-4511-9706-5b342c4d9480",
      "name": "遍历项目",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        832,
        0
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "269e4e42-1186-452a-8258-23080f5071c4",
      "name": "Google Maps数据库",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1424,
        16
      ],
      "parameters": {
        "columns": {
          "value": {
            "url": "={{ $('Loop Over Items').item.json.url }}",
            "city": "={{ $('Loop Over Items').item.json.city }}",
            "rank": "={{ $('Loop Over Items').item.json.rank }}",
            "phone": "={{ $('Loop Over Items').item.json.phone }}",
            "title": "={{ $('Loop Over Items').item.json.title }}",
            "street": "={{ $('Loop Over Items').item.json.street }}",
            "address": "={{ $('Loop Over Items').item.json.address }}",
            "imageUrl": "={{ $('Loop Over Items').item.json.imageUrl }}",
            "scapedAt": "={{ $('Loop Over Items').item.json.scrapedAt }}",
            "categories": "={{ $('Loop Over Items').item.json.categories }}",
            "postalcode": "={{ $('Loop Over Items').item.json.postalCode }}",
            "totalScore": "={{ $('Loop Over Items').item.json.totalScore }}",
            "countryCode": "={{ $('Loop Over Items').item.json.countryCode }}",
            "categoryName": "={{ $('Loop Over Items').item.json.categoryName }}",
            "isAdvertissement": "={{ $('Loop Over Items').item.json.isAdvertisement }}",
            "phoneUnformattted": "={{ $('Loop Over Items').item.json.phoneUnformatted }}",
            "companySummaryInfo": "={{ $json.message.content.companySummary }}"
          },
          "schema": [
            {
              "id": "title",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "categoryName",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "categoryName",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "address",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "address",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "street",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "street",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "city",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "city",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "postalcode",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "postalcode",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "countryCode",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "countryCode",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "phone",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "phone",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "phoneUnformattted",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "phoneUnformattted",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "totalScore",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "totalScore",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "categories",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "categories",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "scapedAt",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "scapedAt",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "url",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "rank",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "rank",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "isAdvertissement",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "isAdvertissement",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "imageUrl",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "imageUrl",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "companySummaryInfo",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "companySummaryInfo",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/17VVXU_eUckRwJ7RaGN5v5hPmhQbNn1Q4pjwOkylNl10/edit#gid=0",
          "cachedResultName": "Feuille 1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "17VVXU_eUckRwJ7RaGN5v5hPmhQbNn1Q4pjwOkylNl10",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/17VVXU_eUckRwJ7RaGN5v5hPmhQbNn1Q4pjwOkylNl10/edit?usp=drivesdk",
          "cachedResultName": "Google map Template scrape"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "fvaXnOXV63MxY546",
          "name": "Google Sheets account 4"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "c817b53d-db25-4b16-9f27-51ad629bda5c",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        -80
      ],
      "parameters": {
        "color": 6,
        "width": 592,
        "height": 256,
        "content": "## 运行Google Maps抓取器并移除重复项"
      },
      "typeVersion": 1
    },
    {
      "id": "fc1d5d48-c0a8-4767-ae96-fa9604b01ae1",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        992,
        -80
      ],
      "parameters": {
        "color": 6,
        "width": 352,
        "height": 256,
        "content": "## 公司摘要信息生成器"
      },
      "typeVersion": 1
    },
    {
      "id": "df97187b-4de8-4a24-902d-b8cdc54416ac",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1376,
        -80
      ],
      "parameters": {
        "color": 6,
        "width": 192,
        "height": 256,
        "content": "## 数据库"
      },
      "typeVersion": 1
    },
    {
      "id": "b5933527-6eb7-4152-8635-95d17b96409e",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -128,
        -272
      ],
      "parameters": {
        "color": 7,
        "width": 1968,
        "height": 512,
        "content": "## 此自动化流程从Google Maps抓取企业信息,使用ChatGPT将其总结为易于阅读的段落,并将结果存储在Google Sheet中。"
      },
      "typeVersion": 1
    },
    {
      "id": "04638e55-2599-4cf7-b079-e522dff29569",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -912,
        -272
      ],
      "parameters": {
        "width": 752,
        "height": 2496,
        "content": "## 此工作流自动化了从Google Maps抓取本地企业列表并为每个企业生成清晰的AI驱动摘要的过程 — 使用Apify(社区节点)和OpenAI的GPT-4o。"
      },
      "typeVersion": 1
    },
    {
      "id": "b1391516-f1b9-48e7-a1d4-92388a3468c1",
      "name": "便签7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        80,
        -1328
      ],
      "parameters": {
        "width": 736,
        "height": 384,
        "content": "## Apify手动配置"
      },
      "typeVersion": 1
    },
    {
      "id": "62322350-6b03-4f5b-911d-efaefa9d2001",
      "name": "便签8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        80,
        -928
      ],
      "parameters": {
        "width": 736,
        "height": 624,
        "content": "## Apify JSON配置"
      },
      "typeVersion": 1
    },
    {
      "id": "5ef85869-6e7f-4282-bb74-241c6c8272b1",
      "name": "便签9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        880,
        -448
      ],
      "parameters": {
        "width": 1056,
        "height": 144,
        "content": "## Google Sheet列设置"
      },
      "typeVersion": 1
    },
    {
      "id": "ce3039af-de00-4066-9f7e-3407d7c8b044",
      "name": "暂停以避免速率限制",
      "type": "n8n-nodes-base.wait",
      "position": [
        1632,
        16
      ],
      "webhookId": "5140443a-da5e-41cc-aab3-2505e30c5efb",
      "parameters": {
        "amount": 2
      },
      "typeVersion": 1.1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "dbae08af-841b-4565-a96f-e23d61c792e8",
  "connections": {
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "company summary Info",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get dataset items": {
      "main": [
        [
          {
            "node": "Remove Duplicates",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remove Duplicates": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google maps database": {
      "main": [
        [
          {
            "node": "Pause for rate limit",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Pause for rate limit": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "company summary Info": {
      "main": [
        [
          {
            "node": "Google maps database",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Google Maps Scraper": {
      "main": [
        [
          {
            "node": "Get dataset items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Run Google Maps Scraper",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

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

需要付费吗?

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

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

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

作者
Jaures NYA

Jaures NYA

@jauresnya

Je rends l’IA claire et pratique même pour ceux qui débutent

外部链接
在 n8n.io 查看

分享此工作流