8
n8n 中文网amn8n.com

使用GPT4o自动从名片提取联系人到表格

高级

这是一个Lead Generation, Multimodal AI领域的自动化工作流,包含 16 个节点。主要使用 Code, Filter, FormTrigger, GoogleDrive, GoogleSheets 等节点。 使用GPT4o从名片提取联系人到Google表格

前置要求
  • Google Drive API 凭证
  • Google Sheets API 凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "d7F1dEqCRoIUVdYj",
  "meta": {
    "instanceId": "4a2e6764ba7a6bc9890d9225f4b21d570ce88fc9bd57549c89057fcee58fed0f",
    "templateId": "5453",
    "templateCredsSetupCompleted": true
  },
  "name": "使用 GPT4o 自动从名片提取联系人到表格",
  "tags": [
    {
      "id": "pg2i0mqcvGPoanrU",
      "name": "Sales Workflow",
      "createdAt": "2025-08-02T06:00:12.615Z",
      "updatedAt": "2025-08-02T06:00:12.615Z"
    }
  ],
  "nodes": [
    {
      "id": "20d8f543-4115-4190-b5f9-ff9ff374a7e9",
      "name": "便签7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2864,
        1216
      ],
      "parameters": {
        "width": 1312,
        "height": 1568,
        "content": "# 📄 使用 GPT4o 自动从名片提取联系人到表格"
      },
      "typeVersion": 1
    },
    {
      "id": "72a04c4f-59f9-4556-98fc-1c9116be6cc1",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1536,
        1216
      ],
      "parameters": {
        "width": 540,
        "height": 932,
        "content": "![替代文本](https://wisestackai.s3.ap-southeast-1.amazonaws.com/namecard.jpg \"可选标题文本\")"
      },
      "typeVersion": 1
    },
    {
      "id": "f036f0ca-7b80-4573-bdc1-266eb97a8bd5",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -272,
        1616
      ],
      "parameters": {
        "width": 636,
        "height": 496,
        "content": "## 1.1. 智能代理从名片图片提取联系人"
      },
      "typeVersion": 1
    },
    {
      "id": "1dd2dc2f-488d-4dce-8c03-e2d508e07ffd",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        912,
        1648
      ],
      "parameters": {
        "width": 556,
        "height": 304,
        "content": "## 3. 将记录添加到 Google 表格"
      },
      "typeVersion": 1
    },
    {
      "id": "513be31a-68e9-418c-a328-9ca65cf91df2",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1504,
        1616
      ],
      "parameters": {
        "width": 1020,
        "height": 356,
        "content": "![替代文本](https://wisestackai.s3.ap-southeast-1.amazonaws.com/Screenshot+2025-08-02+at+1.28.06%E2%80%AFPM.png \"可选标题文本\")"
      },
      "typeVersion": 1
    },
    {
      "id": "156a2e1e-81ab-4650-b6d1-5a289fd4e8dd",
      "name": "表单提交时",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -464,
        1600
      ],
      "webhookId": "916fbea3-2f7f-47fe-9580-fd1eda1936ca",
      "parameters": {
        "options": {},
        "formTitle": "Name Card Uploader Form",
        "formFields": {
          "values": [
            {
              "fieldType": "file",
              "fieldLabel": "Name Card Picture",
              "multipleFiles": false,
              "acceptFileTypes": ".jpg,.jpge,.png"
            }
          ]
        },
        "formDescription": "Upload a photo of one or more business cards. Our system will automatically extract contact details, such as name, company, phone number, and email, and save them to your team’s Google Sheet for easy access and follow-up."
      },
      "typeVersion": 2.2
    },
    {
      "id": "da4c7125-eb33-4770-a6c0-a797a20117e5",
      "name": "添加联系人至跟踪表格",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1088,
        1760
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [
            {
              "id": "Name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "JobTitle",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "JobTitle",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Company",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Company",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Phone",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Phone",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Website",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Website",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Address",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Address",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "LinkedIn",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "LinkedIn",
              "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/1cQtyFzPqq7h9sUsfKj1miAK5gA3de7MKya8HRLD_Pzw/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1cQtyFzPqq7h9sUsfKj1miAK5gA3de7MKya8HRLD_Pzw",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1cQtyFzPqq7h9sUsfKj1miAK5gA3de7MKya8HRLD_Pzw/edit?usp=drivesdk",
          "cachedResultName": "Contacts"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "L670Nly6gZGo71br",
          "name": "Google Sheets account 2"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "d489224d-5b58-4e43-aa70-11a2d8f1ec76",
      "name": "转换输出",
      "type": "n8n-nodes-base.code",
      "position": [
        480,
        1760
      ],
      "parameters": {
        "jsCode": "const allItems = $input.all();\nlet output = [];\n\nfor (const item of allItems) {\n  const contacts = item.json.output;\n\n  for (const contact of contacts) {\n    const cleanedPhone = contact.phone ? contact.phone.replace(/\\+/g, '') : '';\n    output.push({\n      json: {\n        Name: contact.name || '',\n        JobTitle: contact.job_title || '',\n        Company: contact.company || '',\n        Phone: cleanedPhone || '',\n        Email: contact.email.toLowerCase() || '',\n        Website: contact.website || '',\n        Address: contact.address || '',\n        LinkedIn: contact.linkedin || ''\n      }\n    });\n  }\n}\n\nreturn output;"
      },
      "typeVersion": 2
    },
    {
      "id": "abd70432-b13a-4e20-8ef2-eaa70f59db1d",
      "name": "结构化输出解析器",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        80,
        2064
      ],
      "parameters": {
        "jsonSchemaExample": "[{\n    \"name\": \"John Doe\",\n    \"job_title\": \"Sales Manager\",\n    \"company\": \"TechCorp Inc.\",\n    \"phone\": \"+1 234 567 890\",\n    \"email\": \"john.doe@techcorp.com\",\n    \"website\": \"https://www.techcorp.com\",\n    \"address\": \"123 Market Street, San Francisco, CA\",\n    \"linkedin\": \"https://linkedin.com/in/johndoe\"\n  }]"
      },
      "typeVersion": 1.3
    },
    {
      "id": "4cf62a29-c529-401d-a675-ccda319620d9",
      "name": "GPT4o",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -64,
        2064
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "gpt-4o"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "PPSwAKeLQYgAPobT",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "2470ecbd-18a6-4c82-864c-781410922d75",
      "name": "便签8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -992,
        1424
      ],
      "parameters": {
        "width": 540,
        "height": 468,
        "content": "![替代文本](https://wisestackai.s3.ap-southeast-1.amazonaws.com/Screenshot+2025-08-02+at+1.25.32%E2%80%AFPM.png \"可选标题文本\")"
      },
      "typeVersion": 1
    },
    {
      "id": "8eaed946-7f53-4f93-82c1-7a709639e62c",
      "name": "用于联系人提取的神经助手",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -96,
        1808
      ],
      "parameters": {
        "text": "=Extract all business contact details from this image of multiple name cards. Return full names, job titles, company names, phone numbers, email addresses, websites, office addresses, and any relevant information such as QR code content or social media links. Do not include decorative elements or branding.",
        "options": {
          "systemMessage": "You are a smart assistant that helps sales and business development teams extract business contact information from images containing multiple business cards. Your role is to analyze the image, detect all individual cards, and extract relevant details such as full name, job title, company name, phone number, email address, website, office address, social media links, and any QR code content. You should skip any decorative or branding elements and focus only on useful business information. Maintain a logical reading order from top to bottom, left to right. Your output will be used by a downstream parser, so return clean, readable text without additional formatting or structure."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2.1
    },
    {
      "id": "ab5f4a90-be5f-478e-b471-de0f24cae931",
      "name": "过滤不良数据",
      "type": "n8n-nodes-base.filter",
      "position": [
        704,
        1760
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "841d0d69-4413-43dd-a48b-034d0f6af183",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json.Name }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "e163856a-b1ee-4d38-af8d-b272b772cddd",
      "name": "上传文件",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -16,
        1424
      ],
      "parameters": {
        "name": "={{ $now.toFormat(\"yyyyLLdd-HHmmss\") }}-{{$binary.data.fileName}}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "1IPcko8bzogO3W4mxhrW2Q017QA0Lc5MI",
          "cachedResultUrl": "https://drive.google.com/drive/folders/1IPcko8bzogO3W4mxhrW2Q017QA0Lc5MI",
          "cachedResultName": "SmartSales"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "fC471es5gk5Mm900",
          "name": "Google Drive account"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "d3624f8d-148b-433a-9b84-b613a080f016",
      "name": "便签9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -272,
        1376
      ],
      "parameters": {
        "width": 636,
        "height": 208,
        "content": "## 1.2. 上传到 Google Drive 文件夹供后续处理"
      },
      "typeVersion": 1
    },
    {
      "id": "71d1d6e2-e107-4b55-8321-d7aac1930adb",
      "name": "便签10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        1712
      ],
      "parameters": {
        "width": 492,
        "height": 208,
        "content": "## 2. 转换和清理数据"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "b71fa024-0e46-4615-86b4-8afcc5dddc68",
  "connections": {
    "GPT4o": {
      "ai_languageModel": [
        [
          {
            "node": "Neural assistant for contact extraction",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Filter bad data": {
      "main": [
        [
          {
            "node": "Add contact to tracking sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transform Output": {
      "main": [
        [
          {
            "node": "Filter bad data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "Neural assistant for contact extraction",
            "type": "main",
            "index": 0
          },
          {
            "node": "Upload file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Neural assistant for contact extraction",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Neural assistant for contact extraction": {
      "main": [
        [
          {
            "node": "Transform Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

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

需要付费吗?

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

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

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

作者
Trung Tran

Trung Tran

@trungtran

Helps small and medium businesses grow with intelligent automation and practical AI tools, no heavy tech team needed.

外部链接
在 n8n.io 查看

分享此工作流