8
n8n 中文网amn8n.com

🧾 使用Mistral OCR + GPT-4o-mini自动处理发票

中级

这是一个Finance, AI领域的自动化工作流,包含 11 个节点。主要使用 Set, SplitOut, Summarize, GoogleDrive, HttpRequest 等节点,结合人工智能技术实现智能自动化。 🧾 使用Mistral OCR + GPT-4o-mini自动处理发票

前置要求
  • Google Drive API 凭证
  • 可能需要目标 API 的认证凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "4786bf0f18c0e8e92c361de5a158cabf4eb0bb3b9c113091b054ff26e359a029",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "d7086584-965b-467b-b453-4e43936a4bbe",
      "name": "Google Drive触发器:新发票检测",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        180,
        -240
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "0af0b6a6-7ee8-4fdb-a88b-38abad155962",
      "name": "Google Drive:下载发票",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        400,
        -240
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "e0f5e5d0-95a5-4ac2-9de2-995e45def8c3",
      "name": "工作流文档",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -820,
        -500
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "9b1fe096-3c01-4c63-85fa-c54432680b8e",
      "name": "Mistral OCR API:提取文本",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        840,
        -240
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "d0443dba-2b91-4750-8d44-9e4312806941",
      "name": "数据分割器:OCR页面",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        1080,
        -240
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "0ae469f6-378b-4d0e-8ba5-6dd2c87ab2da",
      "name": "字段提取器:页面Markdown",
      "type": "n8n-nodes-base.set",
      "position": [
        1320,
        -240
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "ff714c7c-9b60-4074-8003-a0fbca9d9f39",
      "name": "数据聚合器:合并页面",
      "type": "n8n-nodes-base.summarize",
      "position": [
        1540,
        -240
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "42b4088b-2433-4024-8e69-6f9de1969979",
      "name": "AI助手:结构化发票数据",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1760,
        -240
      ],
      "parameters": {},
      "typeVersion": 1.9
    },
    {
      "id": "ae95c2f9-f8b3-4b16-b0bb-c0fcc34365cb",
      "name": "AI引擎:GPT-4o-mini",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1640,
        -20
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "ad61f397-d923-481b-b48c-376e4e287ca7",
      "name": "JSON解析器:发票结构",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1940,
        -20
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "bc22f1eb-4efa-463c-b86f-6fc8fa76746d",
      "name": "将发票文件转换为 Base64",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        640,
        -240
      ],
      "parameters": {},
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "AI Engine: GPT-4o-mini": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent: Structure Invoice Data",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Data Splitter: OCR Pages": {
      "main": [
        [
          {
            "node": "Field Extractor: Page Markdown",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mistral OCR API: Extract Text": {
      "main": [
        [
          {
            "node": "Data Splitter: OCR Pages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert invoice File to Base64": {
      "main": [
        [
          {
            "node": "Mistral OCR API: Extract Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Data Aggregator: Combine Pages": {
      "main": [
        [
          {
            "node": "AI Agent: Structure Invoice Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Field Extractor: Page Markdown": {
      "main": [
        [
          {
            "node": "Data Aggregator: Combine Pages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive: Download Invoice": {
      "main": [
        [
          {
            "node": "Convert invoice File to Base64",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "JSON Parser: Invoice Structure": {
      "ai_outputParser": [
        [
          {
            "node": "AI Agent: Structure Invoice Data",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent: Structure Invoice Data": {
      "main": [
        []
      ]
    },
    "Google Drive Trigger: New Invoice Detection": {
      "main": [
        [
          {
            "node": "Google Drive: Download Invoice",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 财务, 人工智能

需要付费吗?

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

工作流信息
难度等级
中级
节点数量11
分类2
节点类型11
难度说明

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

外部链接
在 n8n.io 查看

分享此工作流