8
n8n 中文网amn8n.com

使用GPT-4o OCR从Slack提取名片数据到Google Sheets

中级

这是一个Miscellaneous, AI Summarization, Multimodal AI领域的自动化工作流,包含 10 个节点。主要使用 Slack, SplitOut, HttpRequest, GoogleSheets, SlackTrigger 等节点。 使用GPT-4o OCR从Slack提取名片数据到Google Sheets

前置要求
  • Slack Bot Token 或 Webhook URL
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "e04cc86c30b0cecda8e6bbc7cc41459d9bf4d76816638a14d42d636b91913ebc",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "21c87864-6365-4d62-95e6-01576fb3f01d",
      "name": "Slack 触发器",
      "type": "n8n-nodes-base.slackTrigger",
      "position": [
        -496,
        0
      ],
      "webhookId": "82952e59-1102-42c9-811e-db9c35954466",
      "parameters": {
        "options": {},
        "trigger": [
          "message"
        ],
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "C09DW6Q03T8",
          "cachedResultName": "card"
        }
      },
      "credentials": {
        "slackApi": {
          "id": "VLK4L2mMCF7UFZXF",
          "name": "Slack account 4"
        }
      },
      "notesInFlow": false,
      "typeVersion": 1
    },
    {
      "id": "bd53e180-a97f-4ffc-af2e-e95408c52fbf",
      "name": "在表格中追加行",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        528,
        0
      ],
      "parameters": {
        "columns": {
          "value": {
            "Name": "={{ $json.output['full names'] }}",
            "Email": "={{ $json.output.email }}",
            "Phone": "={{ $json.output['phone numbers'] }}",
            "Company": "={{ $json.output['company names'] }}",
            "Job Title": "={{ $json.output['job titles'] }}"
          },
          "schema": [
            {
              "id": "Name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Company",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Company",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Job Title",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Job Title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Phone",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Phone",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Email",
              "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/1NEmgb1BU706kR4k-H2e3L6T8AnUPxFsNzkQZNhVAP90/edit#gid=0",
          "cachedResultName": "総合リスト"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1NEmgb1BU706kR4k-H2e3L6T8AnUPxFsNzkQZNhVAP90",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1NEmgb1BU706kR4k-H2e3L6T8AnUPxFsNzkQZNhVAP90/edit?usp=drivesdk",
          "cachedResultName": "名刺リスト"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "OADOUEa3B96W0iqk",
          "name": "Google Sheets account 2"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "c0881266-4f48-47e4-9da9-5a9c15c019f4",
      "name": "转换数据",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        304,
        0
      ],
      "parameters": {
        "include": "allOtherFields",
        "options": {},
        "fieldToSplitOut": "output"
      },
      "typeVersion": 1
    },
    {
      "id": "8183cd9c-512f-4f5c-aaa6-6897a89e1fb7",
      "name": "发送消息",
      "type": "n8n-nodes-base.slack",
      "position": [
        752,
        0
      ],
      "webhookId": "c67bd6d3-d8d3-41ec-b12f-f4ee57b536d0",
      "parameters": {
        "text": "=---\nName: {{ $json.Name }}\nTitle: {{ $json['Job Title']}}\nCompany: {{ $json.Company }}\nPhone: {{ $json.Phone }}\nEmail: {{ $json.Email }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "C09DW6Q03T8",
          "cachedResultName": "card"
        },
        "otherOptions": {}
      },
      "credentials": {
        "slackApi": {
          "id": "VLK4L2mMCF7UFZXF",
          "name": "Slack account 4"
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "59ea6f4b-f9c4-4873-856e-356599ae22ea",
      "name": "结构化输出",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        96,
        224
      ],
      "parameters": {
        "jsonSchemaExample": "[{\n\t\"full names\": \"Toshiki Hirao\",\n\t\"job titles\": \"CEO\",\n  \"company names\": \"dTosh\",\n  \"phone numbers\": \"012-3456-938\",\n  \"email\": \"xxx@yyy.jp\"\n}]"
      },
      "typeVersion": 1.3
    },
    {
      "id": "8ca7e36b-2066-4a45-b09b-de49648111c5",
      "name": "AI 模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -48,
        224
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "gpt-4o"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "in4FUooE7goQS8l0",
          "name": "OpenAi account 2"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "7153c21f-d2d7-455d-9d88-a3cb4b1a20c2",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1040,
        -48
      ],
      "parameters": {
        "width": 448,
        "height": 880,
        "content": "## 工作原理"
      },
      "typeVersion": 1
    },
    {
      "id": "2b3d9219-4616-4a95-b255-dbb1eab2ffd3",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1040,
        -272
      ],
      "parameters": {
        "width": 608,
        "height": 192,
        "content": "## 在 Slack 中扫描名片到 Google Sheets"
      },
      "typeVersion": 1
    },
    {
      "id": "2e313bd5-2046-4ed0-a521-d28dc962b0b9",
      "name": "获取图像",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -272,
        0
      ],
      "parameters": {
        "url": "={{ $json.files[0].url_private_download }}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file"
            }
          }
        },
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "slackApi"
      },
      "credentials": {
        "slackApi": {
          "id": "VLK4L2mMCF7UFZXF",
          "name": "Slack account 4"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "3d8e76d9-9bcb-4e52-ac45-b560d9086e47",
      "name": "扫描联系人信息",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -48,
        0
      ],
      "parameters": {
        "text": "Please identify and extract all professional contact information from the image containing several business cards. You have to include details that are full names, job titles, company names, phone numbers, and email addresses.",
        "options": {
          "systemMessage": "You assist sales/BD teams by parsing images with several business cards. Identify every card and pull the essentials—full names, job titles, companies, phone numbers, and emails."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2.1
    }
  ],
  "pinData": {},
  "connections": {
    "AI model": {
      "ai_languageModel": [
        [
          {
            "node": "Scan Contact Information",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Fetch images": {
      "main": [
        [
          {
            "node": "Scan Contact Information",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Slack Trigger": {
      "main": [
        [
          {
            "node": "Fetch images",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send a message": {
      "main": [
        []
      ]
    },
    "Structure Output": {
      "ai_outputParser": [
        [
          {
            "node": "Scan Contact Information",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Transforming data": {
      "main": [
        [
          {
            "node": "Append row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append row in sheet": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Scan Contact Information": {
      "main": [
        [
          {
            "node": "Transforming data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 杂项, AI 摘要总结, 多模态 AI

需要付费吗?

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

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

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

作者
Toshiki Hirao

Toshiki Hirao

@hirao

dTosh Inc., CEO Nara Institute of Science and Technology, Assistant Professor

外部链接
在 n8n.io 查看

分享此工作流