Amazon keywords
工作流概述
这是一个包含12个节点的复杂工作流,主要用于自动化处理各种任务。
工作流源代码
{
"id": "kJMoiGRorIlsTYZv",
"meta": {
"instanceId": "558d88703fb65b2d0e44613bc35916258b0f0bf983c5d4730c00c424b77ca36a",
"templateCredsSetupCompleted": true
},
"name": "Amazon keywords",
"tags": [],
"nodes": [
{
"id": "ac4b8cad-b8a3-4cc0-a848-1b6976c1d78a",
"name": "Clean Keywords",
"type": "n8n-nodes-base.set",
"position": [
380,
620
],
"parameters": {
"options": {
"ignoreConversionErrors": true
},
"assignments": {
"assignments": [
{
"id": "fb95058f-0c20-4249-8a45-7b935fde1874",
"name": "Keywords",
"type": "array",
"value": "={{ $json.value }}"
}
]
}
},
"typeVersion": 3.3
},
{
"id": "62575572-e4d2-43e8-9339-d4737961883e",
"name": "Get airtable data",
"type": "n8n-nodes-base.airtable",
"position": [
-220,
620
],
"parameters": {
"id": "={{ $json.query.q }}",
"base": {
"__rl": true,
"mode": "list",
"value": "appGZ14ny5J2PYbq8",
"cachedResultUrl": "https://airtable.com/appGZ14ny5J2PYbq8",
"cachedResultName": "Amazon keyword"
},
"table": {
"__rl": true,
"mode": "list",
"value": "tblvK8Nq4Jqb2Ubun",
"cachedResultUrl": "https://airtable.com/appGZ14ny5J2PYbq8/tblvK8Nq4Jqb2Ubun",
"cachedResultName": "Table 1"
},
"options": {}
},
"credentials": {
"airtableTokenApi": {
"id": "FV1F34pRcGoKZ8GY",
"name": "Airtable Personal Access Token account"
}
},
"typeVersion": 2.1
},
{
"id": "e165df91-c212-4c47-8b79-2e637d0fcb7b",
"name": "Get Amazon keywords",
"type": "n8n-nodes-base.httpRequest",
"position": [
0,
620
],
"parameters": {
"url": "=https://completion.amazon.com/api/2017/suggestions?mid=ATVPDKIKX0DER&alias=aps&prefix={{ $json.Keyword }}",
"options": {}
},
"typeVersion": 4.1
},
{
"id": "49fca0c4-7d1b-4369-9274-2c0b2bb81c8b",
"name": "Format output",
"type": "n8n-nodes-base.splitOut",
"position": [
200,
620
],
"parameters": {
"options": {},
"fieldToSplitOut": "suggestions"
},
"typeVersion": 1
},
{
"id": "cb00c467-49dd-4504-b5bb-d512baf55bfd",
"name": "Aggregate keywords",
"type": "n8n-nodes-base.aggregate",
"position": [
600,
620
],
"parameters": {
"options": {},
"fieldsToAggregate": {
"fieldToAggregate": [
{
"fieldToAggregate": "Keywords"
}
]
}
},
"typeVersion": 1
},
{
"id": "0b04d232-488d-4420-b991-d12b511d5fde",
"name": "Combine into string",
"type": "n8n-nodes-base.code",
"position": [
800,
620
],
"parameters": {
"jsCode": "return [{
json: {
keywords: items[0].json.Keywords.join(\", \")
}
}];"
},
"typeVersion": 2
},
{
"id": "dae32617-6d15-4f30-a27f-894787c137e2",
"name": "Save keywords",
"type": "n8n-nodes-base.airtable",
"position": [
1000,
620
],
"parameters": {
"base": {
"__rl": true,
"mode": "list",
"value": "appGZ14ny5J2PYbq8",
"cachedResultUrl": "https://airtable.com/appGZ14ny5J2PYbq8",
"cachedResultName": "Amazon keyword"
},
"table": {
"__rl": true,
"mode": "list",
"value": "tblvK8Nq4Jqb2Ubun",
"cachedResultUrl": "https://airtable.com/appGZ14ny5J2PYbq8/tblvK8Nq4Jqb2Ubun",
"cachedResultName": "Table 1"
},
"columns": {
"value": {
"id": "={{ $('Get airtable data').item.json.id }}",
"Keyword output": "={{ $json.keywords }}"
},
"schema": [
{
"id": "id",
"type": "string",
"display": true,
"removed": false,
"readOnly": true,
"required": false,
"displayName": "id",
"defaultMatch": true
},
{
"id": "Keyword",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Keyword",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Trigger",
"type": "string",
"display": true,
"removed": true,
"readOnly": true,
"required": false,
"displayName": "Trigger",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Keyword output",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Keyword output",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"id"
]
},
"options": {},
"operation": "update"
},
"credentials": {
"airtableTokenApi": {
"id": "FV1F34pRcGoKZ8GY",
"name": "Airtable Personal Access Token account"
}
},
"typeVersion": 2.1
},
{
"id": "aa451c9b-cfc7-4a9a-9ab5-1e6690039eb6",
"name": "Receive Keyword",
"type": "n8n-nodes-base.webhook",
"position": [
-460,
620
],
"webhookId": "e1df17af-e8b8-4261-ba45-aba7106c65bd",
"parameters": {
"path": "e1df17af-e8b8-4261-ba45-aba7106c65bd",
"options": {},
"responseMode": "lastNode"
},
"typeVersion": 1.1
},
{
"id": "8dc19b86-ac56-487d-9678-04c9f8306786",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-560,
140
],
"parameters": {
"width": 589.0376569037658,
"height": 163.2468619246862,
"content": "## How to build your own Amazon keywords tool with n8n (For free and no coding)
This workflow gives you Amazon keywords for your Amazon FBA business.
[💡 You can read more about this workflow here](https://rumjahn.com/how-to-build-your-own-amazon-keywords-tool-with-n8n-for-free-and-no-coding/)"
},
"typeVersion": 1
},
{
"id": "c1341984-f1a7-4c7e-8a23-46adea6d2afe",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-520,
420
],
"parameters": {
"color": 4,
"width": 239.99999999999977,
"height": 389.08073541167073,
"content": "## Send keywords
You need to send the workflow a keyword through webhook. You can get my airtable example to see how to send keyword.
[Download airtable here.](https://airtable.com/invite/l?inviteId=invgv9FzNB258bm5Z&inviteToken=6f820e142d3324318254c1768fa57809b3ef0bcb7212ea27730fd2d140c69ad5&utm_medium=email&utm_source=product_team&utm_content=transactional-alerts)"
},
"typeVersion": 1
},
{
"id": "17c13b36-a350-4031-bb9b-a6f8dabd1b90",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-60,
418.41726618705036
],
"parameters": {
"color": 6,
"width": 218.65707434052769,
"height": 386.2350119904079,
"content": "## Send to Amazon
Amazon has a completion API that gives you keyword data."
},
"typeVersion": 1
},
{
"id": "3deef28b-90b9-4357-a46d-78d750126b65",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
960,
400
],
"parameters": {
"color": 4,
"width": 181.6626698641084,
"height": 389.08073541167073,
"content": "## Save keywords
Download my airtable example to save the keywords.
[Download airtable here.](https://airtable.com/invite/l?inviteId=invgv9FzNB258bm5Z&inviteToken=6f820e142d3324318254c1768fa57809b3ef0bcb7212ea27730fd2d140c69ad5&utm_medium=email&utm_source=product_team&utm_content=transactional-alerts)"
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "6db9ae9c-6c1f-48e0-8bb0-b18db21809bf",
"connections": {
"Format output": {
"main": [
[
{
"node": "Clean Keywords",
"type": "main",
"index": 0
}
]
]
},
"Clean Keywords": {
"main": [
[
{
"node": "Aggregate keywords",
"type": "main",
"index": 0
}
]
]
},
"Receive Keyword": {
"main": [
[
{
"node": "Get airtable data",
"type": "main",
"index": 0
}
]
]
},
"Get airtable data": {
"main": [
[
{
"node": "Get Amazon keywords",
"type": "main",
"index": 0
}
]
]
},
"Aggregate keywords": {
"main": [
[
{
"node": "Combine into string",
"type": "main",
"index": 0
}
]
]
},
"Combine into string": {
"main": [
[
{
"node": "Save keywords",
"type": "main",
"index": 0
}
]
]
},
"Get Amazon keywords": {
"main": [
[
{
"node": "Format output",
"type": "main",
"index": 0
}
]
]
}
}
}
功能特点
- 自动检测新邮件
- AI智能内容分析
- 自定义分类规则
- 批量处理能力
- 详细的处理日志
技术分析
节点类型及作用
- Set
- Airtable
- Httprequest
- Splitout
- Aggregate
复杂度评估
配置难度:
维护难度:
扩展性:
实施指南
前置条件
- 有效的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错误记录和告警
- 处理失败邮件的隔离机制
- 异常情况下的回滚操作