初学者数据分析:使用 GPT-4o 在 Google Sheets 中合并
高级
这是一个Document Extraction, AI Summarization领域的自动化工作流,包含 21 个节点。主要使用 If, Set, Code, Merge, Filter 等节点。 初学者数据分析:使用 GPT-4o 在 Google Sheets 中合并、筛选和汇总
前置要求
- •Google Sheets API 凭证
- •OpenAI API Key
使用的节点 (21)
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"meta": {
"instanceId": "efb474b59b0341d7791932605bd9ff04a6c7ed9941fdd53dc4a2e4b99a6f9439",
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "a241764c-eb51-4d7a-b5d4-3aa517a9195f",
"name": "Google Sheets1",
"type": "n8n-nodes-base.googleSheets",
"position": [
-160,
280
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": 173686600,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/19aUQYZq02qHsCelO4eeV4sx_MTJJupC5qe0gDLQBtRA/edit#gid=173686600",
"cachedResultName": "Sheet2"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "19aUQYZq02qHsCelO4eeV4sx_MTJJupC5qe0gDLQBtRA",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/19aUQYZq02qHsCelO4eeV4sx_MTJJupC5qe0gDLQBtRA/edit?usp=drivesdk",
"cachedResultName": "Sample Marketing Data"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "WsgMg14OYooIdvn7",
"name": "Google Sheets account"
}
},
"typeVersion": 4.6
},
{
"id": "d7b9ee1a-f87d-42f6-b480-8ee687612f33",
"name": "过滤器",
"type": "n8n-nodes-base.filter",
"position": [
340,
120
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "65acf956-5912-4070-8896-923b74548a5e",
"operator": {
"type": "number",
"operation": "gte"
},
"leftValue": "={{ $json.Clicks }}",
"rightValue": 5
}
]
}
},
"typeVersion": 2.2
},
{
"id": "872dd275-ca9a-4d30-8ac1-e1e921f5e6fd",
"name": "将表名和列名转换为代理可读的单一文本",
"type": "n8n-nodes-base.code",
"position": [
1380,
280
],
"parameters": {
"jsCode": "return [\n {\n json: {\n text: items.map(item => JSON.stringify(item.json)).join('\\n'),\n },\n },\n];\n"
},
"typeVersion": 2
},
{
"id": "4b8595d1-d975-49f6-bff0-265aef52042f",
"name": "OpenAI 聊天模型",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
1620,
500
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "ghJTvay8CvwXDsXz",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
},
{
"id": "c83d8a13-b2da-42f5-b137-763fa06e22e4",
"name": "结构化输出解析器",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
1800,
500
],
"parameters": {
"jsonSchemaExample": "{\n\t\"paragraph\": \"full paragraph\"\n}"
},
"typeVersion": 1.2
},
{
"id": "c1ad3e75-1964-4f3b-b60c-a9531f8770f7",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
-440,
-200
],
"parameters": {
"width": 700,
"height": 880,
"content": "### 📌 合并多个数据集"
},
"typeVersion": 1
},
{
"id": "9de427fa-c2e0-4de0-8e7b-35d4566f3d6e",
"name": "便签1",
"type": "n8n-nodes-base.stickyNote",
"position": [
280,
-200
],
"parameters": {
"color": 5,
"width": 380,
"height": 880,
"content": ""
},
"typeVersion": 1
},
{
"id": "8aa28836-07db-42f7-b2da-0b2e656e92c7",
"name": "便签2",
"type": "n8n-nodes-base.stickyNote",
"position": [
680,
-200
],
"parameters": {
"color": 3,
"width": 380,
"height": 880,
"content": "### 📌 汇总和设置步骤"
},
"typeVersion": 1
},
{
"id": "1fb89d3c-a10e-490d-998a-42436a1d05d0",
"name": "便签3",
"type": "n8n-nodes-base.stickyNote",
"position": [
1100,
-200
],
"parameters": {
"color": 2,
"width": 860,
"height": 880,
"content": "### 📌 使用 AI 代理分析结果"
},
"typeVersion": 1
},
{
"id": "02854b46-8baf-438e-b110-92ce4e96dd6b",
"name": "营销数据示例",
"type": "n8n-nodes-base.googleSheets",
"position": [
-160,
80
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/19aUQYZq02qHsCelO4eeV4sx_MTJJupC5qe0gDLQBtRA/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "19aUQYZq02qHsCelO4eeV4sx_MTJJupC5qe0gDLQBtRA",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/19aUQYZq02qHsCelO4eeV4sx_MTJJupC5qe0gDLQBtRA/edit?usp=drivesdk",
"cachedResultName": "Sample Marketing Data"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "WsgMg14OYooIdvn7",
"name": "Google Sheets account"
}
},
"typeVersion": 4.6
},
{
"id": "cf5b6397-fe1a-46db-928a-5903507ef424",
"name": "启动工作流",
"type": "n8n-nodes-base.manualTrigger",
"position": [
-380,
180
],
"parameters": {},
"typeVersion": 1
},
{
"id": "58039c62-8b23-4114-9e86-5502c82719ee",
"name": "基于渠道字段合并",
"type": "n8n-nodes-base.merge",
"position": [
60,
180
],
"parameters": {
"mode": "combine",
"options": {},
"fieldsToMatchString": "Channel"
},
"typeVersion": 3.2
},
{
"id": "7ed757ca-05b7-41af-9f70-f88b9aba4981",
"name": "检查支出是否超过 350 美元",
"type": "n8n-nodes-base.if",
"position": [
460,
340
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "c0cba05b-63ba-420e-851a-caf2bf9b9914",
"operator": {
"type": "number",
"operation": "gte"
},
"leftValue": "={{ $json['Spend ($)'] }}",
"rightValue": 350
}
]
}
},
"typeVersion": 2.2
},
{
"id": "73aeb996-58d7-4492-a948-bc6f9f92cb46",
"name": "统计差评天数",
"type": "n8n-nodes-base.summarize",
"position": [
740,
100
],
"parameters": {
"options": {},
"fieldsToSplitBy": "Leader",
"fieldsToSummarize": {
"values": [
{
"field": "row_number"
}
]
}
},
"typeVersion": 1.1
},
{
"id": "af21446e-d779-4937-bee4-d650dccd8f32",
"name": "统计好评天数",
"type": "n8n-nodes-base.summarize",
"position": [
760,
300
],
"parameters": {
"options": {},
"fieldsToSplitBy": "Leader",
"fieldsToSummarize": {
"values": [
{
"field": "row_number"
}
]
}
},
"typeVersion": 1.1
},
{
"id": "9b6bb3eb-aae2-4317-8551-78fb81312765",
"name": "将字段组织成表格",
"type": "n8n-nodes-base.set",
"position": [
920,
120
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "e2f52c05-13a5-4692-bbea-87642535145e",
"name": "Outcome",
"type": "string",
"value": "Poor"
},
{
"id": "8c353e0a-409f-4cff-a1b9-17259cc3a1dd",
"name": "# of Days",
"type": "number",
"value": "={{ $json.count_row_number }}"
},
{
"id": "82d2f8dd-54b8-42c8-b502-6ae1fc76e1fe",
"name": "Leader",
"type": "string",
"value": "={{ $json.Leader }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "b5780191-2068-4595-b18c-16626003145d",
"name": "将第二组数据组织成表格",
"type": "n8n-nodes-base.set",
"position": [
920,
320
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "f3f79a06-acb9-4b89-a7ab-438358b4395e",
"name": "Outcome",
"type": "string",
"value": "Great"
},
{
"id": "e79913fa-a2ec-459c-a00d-df23bb1a2a25",
"name": "# of Days",
"type": "number",
"value": "={{ $json.count_row_number }}"
},
{
"id": "a6b563e3-0776-4916-a9f3-05d38a67330a",
"name": "Leader",
"type": "string",
"value": "={{ $json.Leader }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "097dc227-3999-427c-9900-008845b00131",
"name": "合并数据源",
"type": "n8n-nodes-base.merge",
"position": [
1180,
220
],
"parameters": {},
"typeVersion": 3.2
},
{
"id": "1ec5183b-be3f-447a-b312-56420ac5c706",
"name": "AI 代理 - 总结负责人绩效",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
1600,
180
],
"parameters": {
"text": "={{ $json.text }}",
"options": {
"systemMessage": "You are given a list of outcomes by leader. write a summary of the outcomes and identify who is doing the best and worst, and why. \n\noutput as one paragraph. \n\nOutput like this. \n\n{\n\t\"paragraph\": \"full paragraph\"\n}"
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 2
},
{
"id": "0a53ca1a-53f0-4d68-b70f-e5fff251af5f",
"name": "便签4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-440,
-400
],
"parameters": {
"color": 4,
"width": 1100,
"content": "### 📌 设置说明"
},
"typeVersion": 1
},
{
"id": "4dffd2eb-9a06-4103-97a5-47aeccdca95c",
"name": "便利贴5",
"type": "n8n-nodes-base.stickyNote",
"position": [
680,
-400
],
"parameters": {
"color": 2,
"width": 1280,
"content": "### 👋 有问题或反馈?"
},
"typeVersion": 1
}
],
"pinData": {},
"connections": {
"d7b9ee1a-f87d-42f6-b480-8ee687612f33": {
"main": [
[
{
"node": "7ed757ca-05b7-41af-9f70-f88b9aba4981",
"type": "main",
"index": 0
}
]
]
},
"73aeb996-58d7-4492-a948-bc6f9f92cb46": {
"main": [
[
{
"node": "9b6bb3eb-aae2-4317-8551-78fb81312765",
"type": "main",
"index": 0
}
]
]
},
"a241764c-eb51-4d7a-b5d4-3aa517a9195f": {
"main": [
[
{
"node": "58039c62-8b23-4114-9e86-5502c82719ee",
"type": "main",
"index": 1
}
]
]
},
"cf5b6397-fe1a-46db-928a-5903507ef424": {
"main": [
[
{
"node": "02854b46-8baf-438e-b110-92ce4e96dd6b",
"type": "main",
"index": 0
},
{
"node": "a241764c-eb51-4d7a-b5d4-3aa517a9195f",
"type": "main",
"index": 0
}
]
]
},
"af21446e-d779-4937-bee4-d650dccd8f32": {
"main": [
[
{
"node": "b5780191-2068-4595-b18c-16626003145d",
"type": "main",
"index": 0
}
]
]
},
"4b8595d1-d975-49f6-bff0-265aef52042f": {
"ai_languageModel": [
[
{
"node": "1ec5183b-be3f-447a-b312-56420ac5c706",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"02854b46-8baf-438e-b110-92ce4e96dd6b": {
"main": [
[
{
"node": "58039c62-8b23-4114-9e86-5502c82719ee",
"type": "main",
"index": 0
}
]
]
},
"58039c62-8b23-4114-9e86-5502c82719ee": {
"main": [
[
{
"node": "d7b9ee1a-f87d-42f6-b480-8ee687612f33",
"type": "main",
"index": 0
}
]
]
},
"7ed757ca-05b7-41af-9f70-f88b9aba4981": {
"main": [
[
{
"node": "73aeb996-58d7-4492-a948-bc6f9f92cb46",
"type": "main",
"index": 0
}
],
[
{
"node": "af21446e-d779-4937-bee4-d650dccd8f32",
"type": "main",
"index": 0
}
]
]
},
"c83d8a13-b2da-42f5-b137-763fa06e22e4": {
"ai_outputParser": [
[
{
"node": "1ec5183b-be3f-447a-b312-56420ac5c706",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"9b6bb3eb-aae2-4317-8551-78fb81312765": {
"main": [
[
{
"node": "097dc227-3999-427c-9900-008845b00131",
"type": "main",
"index": 0
}
]
]
},
"097dc227-3999-427c-9900-008845b00131": {
"main": [
[
{
"node": "872dd275-ca9a-4d30-8ac1-e1e921f5e6fd",
"type": "main",
"index": 0
}
]
]
},
"b5780191-2068-4595-b18c-16626003145d": {
"main": [
[
{
"node": "097dc227-3999-427c-9900-008845b00131",
"type": "main",
"index": 1
}
]
]
},
"1ec5183b-be3f-447a-b312-56420ac5c706": {
"main": [
[]
]
},
"872dd275-ca9a-4d30-8ac1-e1e921f5e6fd": {
"main": [
[
{
"node": "1ec5183b-be3f-447a-b312-56420ac5c706",
"type": "main",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
高级 - 文档提取, AI 摘要总结
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
使用Google Sheets、SerpAPI
使用Google Sheets、SerpAPI、Apify和GPT-4o提取本地企业联系人
Code
Filter
Summarize
+
Code
Filter
Summarize
18 节点Robert Breen
潜在客户开发
使用Google Sheets、GPT-4o和电子邮件生成营销活动ROI报告
使用Google Sheets、GPT-4o和电子邮件生成营销活动ROI报告
Code
Merge
Aggregate
+
Code
Merge
Aggregate
16 节点Robert Breen
AI 摘要总结
使用GPT-4洞察和PDF.co从Google Sheets生成营销报告
使用GPT-4洞察和PDF.co从Google Sheets生成营销报告
Code
Merge
Aggregate
+
Code
Merge
Aggregate
15 节点Robert Breen
文档提取
使用GPT和Gemini结合性能数据创建高转化率Meta广告脚本
使用GPT和Gemini结合性能数据创建高转化率Meta广告脚本
Set
Code
Merge
+
Set
Code
Merge
24 节点Robert Breen
文档提取
在可视化参考库中探索n8n节点
在可视化参考库中探索n8n节点
If
Ftp
Set
+
If
Ftp
Set
113 节点I versus AI
其他
AI生成LinkedIn帖子含人工审批
使用GPT-4、GoToHuman和Blotato的AI生成LinkedIn帖子含人工审批
Code
Merge
Filter
+
Code
Merge
Filter
19 节点Robert Breen
社交媒体
工作流信息
难度等级
高级
节点数量21
分类2
节点类型12
作者
Robert Breen
@rbreenProfessional services consultant with over 10 years of experience solving complex business problems across industries. I specialize in n8n and process automation—designing custom workflows that integrate tools like Google Calendar, Airtable, GPT, and internal systems. Whether you need to automate scheduling, sync data, or streamline operations, I build solutions that save time and drive results.
外部链接
在 n8n.io 查看 →
分享此工作流