8
n8n 中文网amn8n.com

AI驱动的Instagram竞争对手趋势与策略警报系统

高级

这是一个Market Research, AI Summarization领域的自动化工作流,包含 18 个节点。主要使用 Set, Code, Cron, Twilio, EmailSend 等节点。 使用Claude 3.5监控Instagram竞争对手趋势并发送多渠道警报

前置要求
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "DxYN54X8SAzfDq3l",
  "meta": {
    "instanceId": "dd69efaf8212c74ad206700d104739d3329588a6f3f8381a46a481f34c9cc281",
    "templateCredsSetupCompleted": true
  },
  "name": "AI驱动的Instagram竞争对手趋势与策略警报系统",
  "tags": [],
  "nodes": [
    {
      "id": "f6c99e64-9618-4af5-aed8-183fd93eee6f",
      "name": "计划触发器",
      "type": "n8n-nodes-base.cron",
      "position": [
        -704,
        80
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "4bcd51e8-2fe4-47ec-8373-87cfa99cc51b",
      "name": "获取竞争对手列表",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -480,
        80
      ],
      "parameters": {
        "options": {},
        "sheetId": "your-competitors-sheet-id!A:C"
      },
      "credentials": {
        "googleApi": {
          "id": "ScSS2KxGQULuPtdy",
          "name": "Google Sheets- test"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "1e12d7a7-a5e2-4346-a05d-86960a593ea7",
      "name": "遍历竞争对手",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -256,
        80
      ],
      "parameters": {
        "options": {},
        "batchSize": 1
      },
      "typeVersion": 1
    },
    {
      "id": "cf2b7ce8-b8c2-451d-b7d1-0549f048e09b",
      "name": "获取竞争对手帖子",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -32,
        80
      ],
      "parameters": {
        "url": "=https://graph.facebook.com/v12.0/{{ $json[\"competitorUserId\"] }}/media?fields=id,media_type,media_url,like_count,comments_count,caption,timestamp&access_token=YOUR_INSTAGRAM_ACCESS_TOKEN&limit=10",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "bec4e963-91f8-485d-8175-80321f9d7f1e",
      "name": "计算性能指标",
      "type": "n8n-nodes-base.code",
      "position": [
        192,
        80
      ],
      "parameters": {
        "jsCode": "// Calculate average engagement rate (likes + comments) / 10 posts\nconst posts = $json['data'] || [];\nlet totalLikes = 0, totalComments = 0, totalPosts = posts.length;\n\nposts.forEach(post => {\n  totalLikes += post.like_count || 0;\n  totalComments += post.comments_count || 0;\n});\n\nconst avgEngagement = totalPosts > 0 ? (totalLikes + totalComments) / totalPosts : 0;\nconst trend = avgEngagement > 50 ? 'Rising' : 'Stable'; // Simple threshold\n\nreturn {\n  json: {\n    ...$json,\n    avgEngagement,\n    trend,\n    competitorName: $input.item.json.competitorName\n  }\n};"
      },
      "typeVersion": 1
    },
    {
      "id": "28319c72-8fa6-4b3a-9f17-3b068e0351fe",
      "name": "生成AI洞察(Claude AI)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        416,
        80
      ],
      "parameters": {
        "url": "https://api.anthropic.com/v1/messages",
        "options": {},
        "requestMethod": "POST",
        "jsonParameters": true,
        "bodyParametersJson": "={\"model\": \"claude-3-5-sonnet-20241022\", \"max_tokens\": 1024, \"messages\": [{\"role\": \"user\", \"content\": \"Analyze these competitor Instagram trends: {{ JSON.stringify($json) }}. Provide 3 strategic insights to stay ahead, focusing on content strategy, posting frequency, and engagement tactics. Output as bullet points.\"}]}"
      },
      "typeVersion": 1
    },
    {
      "id": "965cc026-e14b-45a9-8645-e060199498c0",
      "name": "发送邮件警报",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        640,
        -112
      ],
      "parameters": {
        "options": {},
        "subject": "=Competitor Trends Alert: {{ $node[\"Loop Over Competitors\"].json[\"competitorName\"] }} - {{ $json[\"trend\"] }} Engagement",
        "toEmail": "alerts@yourcompany.com",
        "fromEmail": "your-email@domain.com"
      },
      "credentials": {
        "smtp": {
          "id": null,
          "name": "SMTP Credentials"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "25703d3a-af25-499f-9e69-dd5c5f5ed9a9",
      "name": "发送WhatsApp警报(Twilio)",
      "type": "n8n-nodes-base.twilio",
      "position": [
        640,
        80
      ],
      "parameters": {
        "to": "+919282772672",
        "from": "+919988776677",
        "message": "=🚨 Competitor Alert: {{ $node[\"Loop Over Competitors\"].json[\"competitorName\"] }} | Engagement: {{ $json[\"avgEngagement\"] }} | Trend: {{ $json[\"trend\"] }}\n\nInsights:\n{{ $json[\"content\"][0][\"text\"].substring(0, 100) }}...",
        "options": {}
      },
      "credentials": {
        "twilioApi": {
          "id": "4XZXejd5UmXan7os",
          "name": "Twilio account-test"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c51d8a17-7d50-451a-8b0c-3d9198c79fd3",
      "name": "记录警报",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        640,
        272
      ],
      "parameters": {
        "options": {},
        "sheetId": "your-alerts-log-sheet-id!A:E",
        "operation": "append"
      },
      "credentials": {
        "googleApi": {
          "id": "ScSS2KxGQULuPtdy",
          "name": "Google Sheets- test"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "38ecc1c4-4bbe-4e32-8d2d-48e03fb50db7",
      "name": "结束工作流",
      "type": "n8n-nodes-base.set",
      "position": [
        864,
        80
      ],
      "parameters": {
        "options": {},
        "keepOnlySet": true
      },
      "typeVersion": 1
    },
    {
      "id": "3caf3759-cf89-45fa-a86e-5926540a4393",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -736,
        -80
      ],
      "parameters": {
        "width": 176,
        "height": 304,
        "content": "每天上午10点运行或通过webhook(/competitor-alert)触发"
      },
      "typeVersion": 1
    },
    {
      "id": "15b0107a-bdef-41ca-93e5-8698cde79fd9",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -288,
        -80
      ],
      "parameters": {
        "width": 176,
        "height": 304,
        "content": "处理每个竞争对手以避免API限制"
      },
      "typeVersion": 1
    },
    {
      "id": "e72a0fd9-0f52-4d6f-9550-d1cb9a45dc28",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        -80
      ],
      "parameters": {
        "width": 176,
        "height": 304,
        "content": "使用代码节点计算平均参与度和趋势"
      },
      "typeVersion": 1
    },
    {
      "id": "4335d38f-6d10-4372-8a85-bff4eeb40efb",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -64,
        -80
      ],
      "parameters": {
        "width": 176,
        "height": 304,
        "content": "通过Instagram Graph API获取最近10个帖子"
      },
      "typeVersion": 1
    },
    {
      "id": "ab3a4d4a-785f-4357-985c-ee698393437f",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -512,
        -80
      ],
      "parameters": {
        "width": 176,
        "height": 304,
        "content": "从竞争对手表格加载竞争对手"
      },
      "typeVersion": 1
    },
    {
      "id": "f383e5df-cc87-4244-ba1e-cf8ac4e31ea2",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        608,
        -320
      ],
      "parameters": {
        "width": 176,
        "height": 768,
        "content": "向团队发送详细报告邮件"
      },
      "typeVersion": 1
    },
    {
      "id": "cb90b7f3-157d-427a-931e-178307ba6d27",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        368,
        -80
      ],
      "parameters": {
        "width": 176,
        "height": 304,
        "content": "分析数据以获取3个策略性要点洞察"
      },
      "typeVersion": 1
    },
    {
      "id": "5a936a09-a87c-4559-ace4-052966bc3abe",
      "name": "便签7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        832,
        -80
      ],
      "parameters": {
        "width": 176,
        "height": 304,
        "content": "终止执行"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "556221cf-0c2d-44ce-b34d-cead62cd5fb5",
  "connections": {
    "Log Alert": {
      "main": [
        [
          {
            "node": "End Workflow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get Competitor List",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Email Alert": {
      "main": [
        [
          {
            "node": "End Workflow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Competitor List": {
      "main": [
        [
          {
            "node": "Loop Over Competitors",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Competitor Posts": {
      "main": [
        [
          {
            "node": "Calculate Performance Metrics",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Competitors": {
      "main": [
        [
          {
            "node": "Get Competitor Posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send WhatsApp Alert (Twilio)": {
      "main": [
        [
          {
            "node": "End Workflow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Performance Metrics": {
      "main": [
        [
          {
            "node": "Generate AI Insights (Claude AI)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate AI Insights (Claude AI)": {
      "main": [
        [
          {
            "node": "Send Email Alert",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send WhatsApp Alert (Twilio)",
            "type": "main",
            "index": 0
          },
          {
            "node": "Log Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

高级 - 市场调研, AI 摘要总结

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
高级
节点数量18
分类2
节点类型9
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

作者
Oneclick AI Squad

Oneclick AI Squad

@oneclick-ai

The 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.

外部链接
在 n8n.io 查看

分享此工作流