Instagram恶意评论审核与自动防御工作流
这是一个Social Media, AI Summarization领域的自动化工作流,包含 15 个节点。主要使用 If, Set, Cron, Slack, Webhook 等节点。 使用Perspective API和Slack提醒自动审核Instagram评论
- •Slack Bot Token 或 Webhook URL
- •HTTP Webhook 端点(n8n 会自动生成)
- •可能需要目标 API 的认证凭证
- •Google Sheets API 凭证
{
"id": "m2mL2bEzyCxMyMUm",
"meta": {
"instanceId": "dd69efaf8212c74ad206700d104739d3329588a6f3f8381a46a481f34c9cc281",
"templateCredsSetupCompleted": true
},
"name": "Instagram 恶意评论审核与自动防御工作流",
"tags": [],
"nodes": [
{
"id": "042e2d57-9f5b-4990-9f8c-96c571f4afb9",
"name": "由 Github 模型提供支持",
"type": "n8n-nodes-base.cron",
"position": [
-544,
240
],
"parameters": {},
"typeVersion": 1
},
{
"id": "fbcd13d4-752b-47bf-9486-83c6d4d0ba36",
"name": "获取评论",
"type": "n8n-nodes-base.httpRequest",
"position": [
-96,
336
],
"parameters": {
"url": "=https://graph.facebook.com/v12.0/{{$node[\"Get Instagram Posts\"].json[\"data\"][0][\"id\"]}}/comments?access_token=YOUR_INSTAGRAM_ACCESS_TOKEN",
"options": {},
"authentication": "headerAuth"
},
"credentials": {
"httpHeaderAuth": {
"id": "ASXerwNuOMbStjih",
"name": "Header - test"
}
},
"typeVersion": 1
},
{
"id": "4f906e36-0ce8-4fdf-a1e3-f6eafdec200a",
"name": "检测恶意内容",
"type": "n8n-nodes-base.httpRequest",
"position": [
352,
336
],
"parameters": {
"url": "https://api.moderatehate.com/v1/toxicity",
"options": {},
"requestMethod": "POST",
"jsonParameters": true,
"bodyParametersJson": "={\"comment\": {\"text\": \"{{$json[\"text\"]}}\"}, \"requestedAttributes\": {\"TOXICITY\": {}}, \"clientToken\": \"YOUR_PERSPECTIVE_API_KEY\"}"
},
"typeVersion": 1
},
{
"id": "7ee26cdf-d244-4e29-b501-fd938ad9ccc7",
"name": "如果恶意",
"type": "n8n-nodes-base.if",
"position": [
576,
336
],
"parameters": {
"conditions": {
"number": [
{
"value1": "={{$json[\"attributeScores\"][\"TOXICITY\"][\"summaryScore\"][\"value\"]}}",
"value2": 0.7,
"operation": "larger"
}
]
}
},
"typeVersion": 1
},
{
"id": "2dec3548-e9b4-4706-98c3-2b6a09c08812",
"name": "隐藏评论",
"type": "n8n-nodes-base.httpRequest",
"position": [
800,
48
],
"parameters": {
"url": "=https://graph.facebook.com/v12.0/{{$json[\"id\"]}}?access_token=YOUR_INSTAGRAM_ACCESS_TOKEN",
"options": {},
"requestMethod": "POST",
"jsonParameters": true,
"bodyParametersJson": "={\"hide\": true}"
},
"typeVersion": 1
},
{
"id": "bfc8fd2d-d547-4bd4-acea-c5e5df672ab4",
"name": "提醒团队 (Slack)",
"type": "n8n-nodes-base.slack",
"position": [
800,
240
],
"parameters": {
"text": "=Toxic Comment Detected!\nText: {{$json[\"text\"]}}\nUser: {{$json[\"username\"]}}\nToxicity Score: {{$node[\"Detect Toxicity\"].json[\"attributeScores\"][\"TOXICITY\"][\"summaryScore\"][\"value\"]}}\nPost ID: {{$node[\"Get Instagram Posts\"].json[\"data\"][0][\"id\"]}}",
"channel": "your-slack-channel",
"attachments": [],
"otherOptions": {}
},
"credentials": {
"slackApi": {
"id": "MQ0fgwuS8AzfwFvy",
"name": "Slack account - test "
}
},
"typeVersion": 1
},
{
"id": "90946996-b976-40a5-a80d-f869b79b30c3",
"name": "存储证据 (Google Sheets)",
"type": "n8n-nodes-base.googleSheets",
"position": [
800,
432
],
"parameters": {
"range": "A:Z",
"options": {},
"sheetId": {
"__rl": true,
"mode": "list",
"value": "your-google-sheet-id",
"cachedResultName": "Your Evidence Sheet"
},
"operation": "append"
},
"credentials": {
"googleApi": {
"id": "ScSS2KxGQULuPtdy",
"name": "Google Sheets- test"
}
},
"typeVersion": 1
},
{
"id": "b31bf33e-5be7-41da-be9b-89cac55e33dd",
"name": "结束 (非恶意路径)",
"type": "n8n-nodes-base.set",
"position": [
800,
624
],
"parameters": {
"options": {},
"keepOnlySet": true
},
"typeVersion": 1
},
{
"id": "2452c3a8-68ef-4e46-b2c3-04b10e76c2e9",
"name": "获取 Instagram 帖子",
"type": "n8n-nodes-base.httpRequest",
"position": [
-320,
336
],
"parameters": {
"url": "https://graph.facebook.com/v12.0/YOUR_INSTAGRAM_BUSINESS_ACCOUNT_ID/media?access_token=YOUR_INSTAGRAM_ACCESS_TOKEN",
"options": {}
},
"typeVersion": 1
},
{
"id": "c07fa30c-3c9b-46b6-9cd7-bd186ad641bd",
"name": "遍历评论",
"type": "n8n-nodes-base.splitInBatches",
"position": [
128,
336
],
"parameters": {
"options": {},
"batchSize": 1
},
"typeVersion": 1
},
{
"id": "d0b8d990-b005-4827-8033-54c5649db2ec",
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"position": [
-544,
432
],
"webhookId": "8a81934f-bd1e-400e-9eb4-bb540db73b2b",
"parameters": {
"path": "8a81934f-bd1e-400e-9eb4-bb540db73b2b",
"options": {}
},
"typeVersion": 2.1
},
{
"id": "c9200031-8fa3-4c6e-9684-1ea457cd3cfa",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
-608,
32
],
"parameters": {
"width": 432,
"height": 528,
"content": "计划节点每 15 分钟运行一次以轮询新评论(Instagram 本身不易推送通知,因此使用轮询)。如果您通过 Graph API 设置了 Instagram webhook,可以将其替换为 Webhook。"
},
"typeVersion": 1
},
{
"id": "8f5a8cfd-09ac-4d23-a1c1-7f1246f1becb",
"name": "便签1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-144,
32
],
"parameters": {
"color": 5,
"width": 416,
"height": 528,
"content": "使用 Instagram Graph API(通过 HTTP 请求)获取最近的帖子及其评论。假设您拥有 Instagram 商业账户和有效的访问令牌(来自 Facebook 开发者门户)。"
},
"typeVersion": 1
},
{
"id": "57d6f1fe-6179-4425-b661-aec2c1dc735d",
"name": "便签2",
"type": "n8n-nodes-base.stickyNote",
"position": [
288,
32
],
"parameters": {
"width": 416,
"height": 528,
"content": "对于每个评论,它将文本发送到 Google 的 Perspective API(免费的恶意内容检测 API;在 https://perspectiveapi.com/ 注册获取 API 密钥)。\"恶意\"阈值设置为 >0.7 毒性分数(可配置)。"
},
"typeVersion": 1
},
{
"id": "e2b718f0-28ea-4bf1-a5d5-26e84be318c9",
"name": "便签3",
"type": "n8n-nodes-base.stickyNote",
"position": [
752,
-224
],
"parameters": {
"color": 5,
"height": 992,
"content": "**自动隐藏冒犯性评论**:如果恶意,使用 Instagram API 隐藏评论。"
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "a867b0b0-5297-42da-aa5c-f2dca4f413f9",
"connections": {
"Webhook": {
"main": [
[
{
"node": "Get Instagram Posts",
"type": "main",
"index": 0
}
]
]
},
"IF Toxic": {
"main": [
[
{
"node": "Hide Comment",
"type": "main",
"index": 0
},
{
"node": "Alert Team (Slack)",
"type": "main",
"index": 0
},
{
"node": "Store Evidence (Google Sheet)",
"type": "main",
"index": 0
}
],
[
{
"node": "End (Non-Toxic Path)",
"type": "main",
"index": 0
}
]
]
},
"Get Comments": {
"main": [
[
{
"node": "Loop Over Comments",
"type": "main",
"index": 0
}
]
]
},
"Detect Toxicity": {
"main": [
[
{
"node": "IF Toxic",
"type": "main",
"index": 0
}
]
]
},
"Schedule Trigger": {
"main": [
[
{
"node": "Get Instagram Posts",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Comments": {
"main": [
[
{
"node": "Detect Toxicity",
"type": "main",
"index": 0
}
]
]
},
"Get Instagram Posts": {
"main": [
[
{
"node": "Get Comments",
"type": "main",
"index": 0
}
]
]
}
}
}如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
中级 - 社交媒体, AI 摘要总结
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
Oneclick AI Squad
@oneclick-aiThe AI Squad Initiative is a pioneering effort to build, automate and scale AI-powered workflows using n8n.io. Our mission is to help individuals and businesses integrate AI agents seamlessly into their daily operations from automating tasks and enhancing productivity to creating innovative, intelligent solutions. We design modular, reusable AI workflow templates that empower creators, developers and teams to supercharge their automation with minimal effort and maximum impact.
分享此工作流