n8n Community Topic Tracker by Keyword
工作流概述
这是一个包含10个节点的复杂工作流,主要用于自动化处理各种任务。
工作流源代码
{
"id": "R6tFG45dQydBz63e",
"meta": {
"instanceId": "fb2ac1a770dc8dc4bb24d7e6a9ab7e89f53c6b6759adeb7ab76c09a3d8f6f4a9",
"templateCredsSetupCompleted": true
},
"name": "n8n Community Topic Tracker by Keyword",
"tags": [],
"nodes": [
{
"id": "b735226c-ce7f-4daf-8255-45ba80262aa5",
"name": "Google Sheets",
"type": "n8n-nodes-base.googleSheets",
"position": [
760,
0
],
"parameters": {
"columns": {
"value": {
"id": "={{ $json.id }}",
"url": "=https://community.n8n.io/t/{{ $json.slug }}",
"date": "={{ $json.created_at }}",
"title": "={{ $json.title }}",
"has_solution": "={{ $json.has_accepted_answer }}"
},
"schema": [
{
"id": "id",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "id",
"defaultMatch": true,
"canBeUsedToMatch": true
},
{
"id": "date",
"type": "string",
"display": true,
"required": false,
"displayName": "date",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "title",
"type": "string",
"display": true,
"required": false,
"displayName": "title",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "url",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "url",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "has_solution",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "has_solution",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"id"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "appendOrUpdate",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "",
"cachedResultName": ""
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "",
"cachedResultUrl": "",
"cachedResultName": ""
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "",
"name": ""
}
},
"notesInFlow": true,
"typeVersion": 4.5
},
{
"id": "bbcf5797-c3dc-495f-85e9-178755d29c50",
"name": "Schedule Trigger",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
-120,
0
],
"parameters": {
"rule": {
"interval": [
{
"field": "hours"
}
]
}
},
"typeVersion": 1.2
},
{
"id": "357975bc-9e13-494d-93da-c4238b42b5b3",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
60,
-220
],
"parameters": {
"width": 340,
"height": 420,
"content": "## Modify the Query Parameter
**Double-click** the node to open it for editing.
Adjust the value of the \"q\" parameter to match the keyword you wish to monitor.
"
},
"typeVersion": 1
},
{
"id": "f53b958d-71d4-49cb-9db2-48e8d12301a9",
"name": "Get topics",
"type": "n8n-nodes-base.splitOut",
"position": [
460,
0
],
"parameters": {
"options": {},
"fieldToSplitOut": "topics"
},
"typeVersion": 1
},
{
"id": "6fcd7991-4d3c-4705-a2f6-a85660cad80f",
"name": "Get latest topics",
"type": "n8n-nodes-base.httpRequest",
"position": [
180,
0
],
"parameters": {
"url": "https://community.n8n.io/search",
"options": {
"response": {
"response": {
"responseFormat": "json"
}
}
},
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "q",
"value": "ADD-YOUR-KEYWORD-HERE"
},
{
"name": "order",
"value": "latest"
}
]
}
},
"notesInFlow": true,
"typeVersion": 4.2
},
{
"id": "2483ecbc-6795-4fed-bce3-23108bc7087a",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
640,
-220
],
"parameters": {
"width": 340,
"height": 420,
"content": "## Add your Google Sheets API credentials
**Double-click** the node to open it for editing.
Select the document from the list. Please note to add columns \"id\", \"date\", \"title\", \"url\", \"has_solution\"
"
},
"typeVersion": 1
},
{
"id": "4791f99d-7bc2-4d85-8bd3-86a78475aed0",
"name": "Google Sheets Trigger",
"type": "n8n-nodes-base.googleSheetsTrigger",
"position": [
-80,
640
],
"parameters": {
"options": {},
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1DDVOKXbRGM_2lHZSUm4bH_VqAZ9jKBMOARVyf3hE5kI/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1DDVOKXbRGM_2lHZSUm4bH_VqAZ9jKBMOARVyf3hE5kI",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1DDVOKXbRGM_2lHZSUm4bH_VqAZ9jKBMOARVyf3hE5kI/edit?usp=drivesdk",
"cachedResultName": "n8n Community topic tracker based on keyword"
}
},
"credentials": {
"googleSheetsTriggerOAuth2Api": {
"id": "LGzWbSDkVxbOBOBT",
"name": "Google Sheets Trigger account"
}
},
"typeVersion": 1
},
{
"id": "c1d43a4b-f681-40f6-9736-10ee3ad511f2",
"name": "Slack",
"type": "n8n-nodes-base.slack",
"position": [
220,
580
],
"webhookId": "aca9b9e2-e9d4-40eb-a2be-bd2a07b31ce8",
"parameters": {
"text": "New topics are available in n8n community",
"otherOptions": {}
},
"typeVersion": 2.3
},
{
"id": "cc531378-6341-43ea-87c5-03a048ff74a9",
"name": "Send Email",
"type": "n8n-nodes-base.emailSend",
"position": [
220,
760
],
"parameters": {
"text": "New topics are available in n8n community.",
"options": {},
"emailFormat": "text"
},
"credentials": {
"smtp": {
"id": "tDSWM9BZ9H2FaedY",
"name": "SMTP account 2"
}
},
"typeVersion": 2.1
},
{
"id": "2b025fc2-4e78-4120-9d36-0ca3f4fd5743",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-140,
360
],
"parameters": {
"width": 580,
"height": 600,
"content": "## Send a message when Sheet is updated (Optional)
### Delete these nodes if you don't want to be alerted.
You can configure channels you want to connect, when Google Sheet is updated, so that you receive a message instantly."
},
"typeVersion": 1
}
],
"active": true,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "3cd62f18-29c4-4e14-b560-5c96e33650d4",
"connections": {
"Get topics": {
"main": [
[
{
"node": "Google Sheets",
"type": "main",
"index": 0
}
]
]
},
"Schedule Trigger": {
"main": [
[
{
"node": "Get latest topics",
"type": "main",
"index": 0
}
]
]
},
"Get latest topics": {
"main": [
[
{
"node": "Get topics",
"type": "main",
"index": 0
}
]
]
},
"Google Sheets Trigger": {
"main": [
[
{
"node": "Slack",
"type": "main",
"index": 0
},
{
"node": "Send Email",
"type": "main",
"index": 0
}
]
]
}
}
}
功能特点
- 自动检测新邮件
- AI智能内容分析
- 自定义分类规则
- 批量处理能力
- 详细的处理日志
技术分析
节点类型及作用
- Googlesheets
- Scheduletrigger
- Stickynote
- Splitout
- Httprequest
复杂度评估
配置难度:
维护难度:
扩展性:
实施指南
前置条件
- 有效的Gmail账户
- n8n平台访问权限
- Google API凭证
- AI分类服务订阅
配置步骤
- 在n8n中导入工作流JSON文件
- 配置Gmail节点的认证信息
- 设置AI分类器的API密钥
- 自定义分类规则和标签映射
- 测试工作流执行
- 配置定时触发器(可选)
关键参数
| 参数名称 | 默认值 | 说明 |
|---|---|---|
| maxEmails | 50 | 单次处理的最大邮件数量 |
| confidenceThreshold | 0.8 | 分类置信度阈值 |
| autoLabel | true | 是否自动添加标签 |
最佳实践
优化建议
- 定期更新AI分类模型以提高准确性
- 根据邮件量调整处理批次大小
- 设置合理的分类置信度阈值
- 定期清理过期的分类规则
安全注意事项
- 妥善保管API密钥和认证信息
- 限制工作流的访问权限
- 定期审查处理日志
- 启用双因素认证保护Gmail账户
性能优化
- 使用增量处理减少重复工作
- 缓存频繁访问的数据
- 并行处理多个邮件分类任务
- 监控系统资源使用情况
故障排除
常见问题
邮件未被正确分类
检查AI分类器的置信度阈值设置,适当降低阈值或更新训练数据。
Gmail认证失败
确认Google API凭证有效且具有正确的权限范围,重新进行OAuth授权。
调试技巧
- 启用详细日志记录查看每个步骤的执行情况
- 使用测试邮件验证分类逻辑
- 检查网络连接和API服务状态
- 逐步执行工作流定位问题节点
错误处理
工作流包含以下错误处理机制:
- 网络超时自动重试(最多3次)
- API错误记录和告警
- 处理失败邮件的隔离机制
- 异常情况下的回滚操作