照片自动OCR → AI摘要 → Google表格和Gmail通知
中级
这是一个Document Extraction, AI Summarization领域的自动化工作流,包含 15 个节点。主要使用 Code, Gmail, GoogleDrive, HttpRequest, GoogleSheets 等节点。 使用OCR.space从Google Drive图片中提取文本,通过OpenRouter AI生成摘要至表格和Gmail通知
前置要求
- •Google 账号和 Gmail API 凭证
- •Google Drive API 凭证
- •可能需要目标 API 的认证凭证
- •Google Sheets API 凭证
使用的节点 (15)
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"id": "4neKxxXCjvUq8XV7",
"meta": {
"instanceId": "15d6057a37b8367f33882dd60593ee5f6cc0c59310ff1dc66b626d726083b48d",
"templateCredsSetupCompleted": true
},
"name": "照片自动 OCR → AI 摘要 → Google Sheets 和 Gmail 通知",
"tags": [],
"nodes": [
{
"id": "14484c3d-1f78-45b1-a778-48b9d7ac1eee",
"name": "OpenRouter 聊天模型1",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
"position": [
880,
336
],
"parameters": {
"options": {}
},
"credentials": {
"openRouterApi": {
"id": "fMR5QJezr3tD108w",
"name": "簡易デモ"
}
},
"typeVersion": 1
},
{
"id": "b8538a4f-9319-46b6-be09-5e343850d1dc",
"name": "在 sheet1 中追加行",
"type": "n8n-nodes-base.googleSheets",
"position": [
1312,
160
],
"parameters": {
"columns": {
"value": {
"処理日": "={{ $now.toISO().split('T')[0] }}",
"要約結果": "={{ $('Generate Summary with OpenRouter AI1').first().json.output }}",
"ファイル名": "={{ $('Format OCR Result & Check for Empty1').first().json.fileName }}"
},
"schema": [
{
"id": "ファイル名",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "ファイル名",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "要約結果",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "要約結果",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "処理日",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "処理日",
"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/11BmQnKfY4MmCD4iwlvOFUZPAM6kGMWdny8MefHzE2_0/edit#gid=0",
"cachedResultName": "要約"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "11BmQnKfY4MmCD4iwlvOFUZPAM6kGMWdny8MefHzE2_0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/11BmQnKfY4MmCD4iwlvOFUZPAM6kGMWdny8MefHzE2_0/edit?usp=drivesdk",
"cachedResultName": "画像要約記録"
}
},
"typeVersion": 4.7
},
{
"id": "11238230-9772-4fce-a3b9-b1c3a3cfffd1",
"name": "Google Drive 新文件触发器1",
"type": "n8n-nodes-base.googleDriveTrigger",
"position": [
-48,
160
],
"parameters": {
"event": "fileCreated",
"options": {},
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
},
"triggerOn": "specificFolder",
"folderToWatch": {
"__rl": true,
"mode": "list",
"value": "1jTs0NNXMFTcChRq0C1KEoARVdIOOjQ1r",
"cachedResultUrl": "https://drive.google.com/drive/folders/1jTs0NNXMFTcChRq0C1KEoARVdIOOjQ1r",
"cachedResultName": "イメージファイル"
}
},
"typeVersion": 1
},
{
"id": "b31e181b-5ee1-4008-b3c9-541f3b3e65b8",
"name": "下载图片文件1",
"type": "n8n-nodes-base.googleDrive",
"position": [
224,
160
],
"parameters": {
"fileId": {
"__rl": true,
"mode": "id",
"value": "={{ $json.id }}"
},
"options": {
"binaryPropertyName": "data"
},
"operation": "download"
},
"typeVersion": 3
},
{
"id": "dd60b9e0-1bfc-4ce3-9e2a-86a5582b1dac",
"name": "使用 OCR.space1 提取文本",
"type": "n8n-nodes-base.httpRequest",
"position": [
496,
160
],
"parameters": {
"url": "https://api.ocr.space/parse/image",
"method": "POST",
"options": {},
"sendBody": true,
"contentType": "multipart-form-data",
"bodyParameters": {
"parameters": [
{
"name": "apikey",
"value": "*****APIKEY*****"
},
{
"name": "language",
"value": "jpn"
},
{
"name": "isOverlayRequired",
"value": "false"
},
{
"name": "file",
"parameterType": "formBinaryData",
"inputDataFieldName": "data"
}
]
}
},
"typeVersion": 4.3
},
{
"id": "74bc17b2-2556-4a8e-b331-fe5fee94a711",
"name": "格式化 OCR 结果并检查是否为空1",
"type": "n8n-nodes-base.code",
"position": [
752,
160
],
"parameters": {
"jsCode": "const raw = $input.first()?.json?.ParsedResults?.[0]?.ParsedText || '';\nconst text = String(raw).replace(/\\r/g, ' ').replace(/\\n+/g, ' ').replace(/\\s{2,}/g, ' ').trim();\nconst fileName = $('Download Image File1').first()?.json?.name || 'unknown';\nreturn [{ json: { extractedText: text, fileName: fileName, hasText: text.length > 0 } }];"
},
"typeVersion": 2
},
{
"id": "82e9b60c-eaba-434e-ba0d-3f41ed0bbcf8",
"name": "使用 OpenRouter AI1 生成摘要",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
960,
160
],
"parameters": {
"text": "=以下の文章を簡潔に要約してください:\n{{ \n $if(\n $('Format OCR Result & Check for Empty1').first()?.json?.extractedText, \n $('Format OCR Result & Check for Empty1').first().json.extractedText, \n \"(テキストが見つかりませんでした)\"\n ) \n}}",
"options": {},
"promptType": "define"
},
"typeVersion": 3
},
{
"id": "bba8e569-d625-476f-869d-e3c5c39f166b",
"name": "通过 Gmail1 发送完成通知",
"type": "n8n-nodes-base.gmail",
"position": [
1584,
160
],
"webhookId": "66c7ac47-8411-437c-8132-f89b024f7e09",
"parameters": {
"sendTo": " shukuwa@yubipass.tokyo",
"message": "=画像ファイル「{{ $('Format OCR Result & Check for Empty1').first().json.fileName }}」のOCR処理が完了しました。\n\n【要約】\n{{ $('Generate Summary with OpenRouter AI1').first().json.message.content }}\n\n【Google Docs】\n新規ドキュメントを作成しました。\nドキュメントID: {{ $('Google Docs へ要約を追記').first().json.documentId }}",
"options": {},
"subject": "=OCR処理完了: {{ $('Format OCR Result & Check for Empty1').first().json.fileName }}"
},
"typeVersion": 2.1
},
{
"id": "d0cacb65-5059-4def-bb53-9f0026938075",
"name": "处理完成1",
"type": "n8n-nodes-base.noOp",
"position": [
1872,
160
],
"parameters": {},
"typeVersion": 1
},
{
"id": "7c8f33d6-080b-4a16-b7df-d389c1b65b37",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
-608,
-496
],
"parameters": {
"width": 480,
"height": 640,
"content": "## 概述:自动 OCR → AI 摘要 → Google Sheets 和 Gmail"
},
"typeVersion": 1
},
{
"id": "6a7a6bfa-3a55-4348-b87c-303ef20a91ee",
"name": "便签1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-64,
-160
],
"parameters": {
"color": 7,
"height": 304,
"content": "### 第 1 部分 - 检测和下载图像"
},
"typeVersion": 1
},
{
"id": "e8596db6-7332-4257-9863-1d4099879c61",
"name": "便签2",
"type": "n8n-nodes-base.stickyNote",
"position": [
192,
-160
],
"parameters": {
"color": 7,
"height": 304,
"content": "### 第 2 部分 - 提取和清理文本"
},
"typeVersion": 1
},
{
"id": "58a38290-9e3a-41c2-9a1b-b3c026eb9c00",
"name": "便签3",
"type": "n8n-nodes-base.stickyNote",
"position": [
448,
-160
],
"parameters": {
"color": 7,
"height": 304,
"content": "### 第 3 部分 - 使用 AI 总结"
},
"typeVersion": 1
},
{
"id": "696b9c8a-05e3-44bf-aff0-693d969178de",
"name": "便签4",
"type": "n8n-nodes-base.stickyNote",
"position": [
704,
-160
],
"parameters": {
"color": 7,
"height": 304,
"content": "### 第 4 部分 - 保存到 Google Sheets"
},
"typeVersion": 1
},
{
"id": "6b0c9994-a22f-41aa-968e-36a9adca53bd",
"name": "便签5",
"type": "n8n-nodes-base.stickyNote",
"position": [
960,
-160
],
"parameters": {
"color": 7,
"height": 304,
"content": "### 第 5 部分 - 通过 Gmail 通知"
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "cbc1e6fc-2b5e-47f2-8026-909093af9325",
"connections": {
"Append row in sheet1": {
"main": [
[
{
"node": "Send Completion Notification via Gmail1",
"type": "main",
"index": 0
}
]
]
},
"Download Image File1": {
"main": [
[
{
"node": "Extract Text with OCR.space1",
"type": "main",
"index": 0
}
]
]
},
"OpenRouter Chat Model1": {
"ai_languageModel": [
[
{
"node": "Generate Summary with OpenRouter AI1",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Extract Text with OCR.space1": {
"main": [
[
{
"node": "Format OCR Result & Check for Empty1",
"type": "main",
"index": 0
}
]
]
},
"Google Drive New File Trigger1": {
"main": [
[
{
"node": "Download Image File1",
"type": "main",
"index": 0
}
]
]
},
"Format OCR Result & Check for Empty1": {
"main": [
[
{
"node": "Generate Summary with OpenRouter AI1",
"type": "main",
"index": 0
}
]
]
},
"Generate Summary with OpenRouter AI1": {
"main": [
[
{
"node": "Append row in sheet1",
"type": "main",
"index": 0
}
]
]
},
"Send Completion Notification via Gmail1": {
"main": [
[
{
"node": "Process Completed1",
"type": "main",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
中级 - 文档提取, AI 摘要总结
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
基于AI的政府资助追踪器(RSS → AI → Google Sheets → 电子邮件)
使用OpenRouter AI、RSS源、Google Sheets和Gmail追踪政府资助
Code
Gmail
Aggregate
+9
21 节点Tsubasa Shukuwa
文档提取
AI医疗报告生成器
使用Gemini AI和Google Workspace从电子邮件生成医疗报告
Set
Code
Gmail
+8
21 节点Abdullah Alshiekh
文档提取
自动向客户发送发票
通过 OCR.Space、GPT-4 和 Google Drive 到 Gmail 实现发票处理的自动化
If
Set
Code
+12
29 节点Michael Taleb
AI 摘要总结
使用 Bright Data API 和 AI 抓取分析 Google 广告并发送邮件报告
使用 Bright Data API 和 AI 抓取分析 Google 广告并发送邮件报告
Set
Code
Gmail
+15
45 节点Zacharia Kimotho
市场调研
仅限表单提交_双源音频转录 --> AI摘要与情感分析 --> Gmail投递
音频转执行简报:使用AssemblyAI和GPT-4进行转录与分析
If
Code
Wait
+7
22 节点Sridevi Edupuganti
文档提取
智能文档流
使用Foxit和Diffbot提取机构信息并总结文档
If
Code
Wait
+5
16 节点Raymond Camden
文档提取