8
n8n 中文网amn8n.com

我的工作流 2

中级

这是一个Miscellaneous, AI Summarization领域的自动化工作流,包含 12 个节点。主要使用 If, Code, Telegram, ScheduleTrigger, ScrapegraphAi 等节点。 使用ScrapeGraphAI检测版权侵权并自动发送法律响应

前置要求
  • Telegram Bot Token
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "VhEwspDqzu7ssFVE",
  "meta": {
    "instanceId": "f4b0efaa33080e7774e0d9285c40c7abcd2c6f7cf1a8b901fa7106170dd4cda3",
    "templateCredsSetupCompleted": true
  },
  "name": "我的工作流 2",
  "tags": [
    {
      "id": "DxXGubfBzRKh6L8T",
      "name": "Revenue Optimization",
      "createdAt": "2025-07-25T16:24:30.370Z",
      "updatedAt": "2025-07-25T16:24:30.370Z"
    },
    {
      "id": "IxkcJ2IpYIxivoHV",
      "name": "Content Strategy",
      "createdAt": "2025-07-25T12:57:37.677Z",
      "updatedAt": "2025-07-25T12:57:37.677Z"
    },
    {
      "id": "PAKIJ2Mm9EvRcR3u",
      "name": "Trend Monitoring",
      "createdAt": "2025-07-25T12:57:37.670Z",
      "updatedAt": "2025-07-25T12:57:37.670Z"
    },
    {
      "id": "YtfXmaZk44MYedPO",
      "name": "Dynamic Pricing",
      "createdAt": "2025-07-25T16:24:30.369Z",
      "updatedAt": "2025-07-25T16:24:30.369Z"
    },
    {
      "id": "wJ30mjhtrposO8Qt",
      "name": "Simple RAG",
      "createdAt": "2025-07-28T12:55:14.424Z",
      "updatedAt": "2025-07-28T12:55:14.424Z"
    }
  ],
  "nodes": [
    {
      "id": "d14c0190-4c72-43aa-aad1-fa97bf8c79d4",
      "name": "计划触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -464,
        64
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 24
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "7027c64b-a3d8-4e72-9cb4-c02a5a563aaf",
      "name": "ScrapeGraphAI 网络搜索",
      "type": "n8n-nodes-scrapegraphai.scrapegraphAi",
      "position": [
        -64,
        400
      ],
      "parameters": {
        "userPrompt": "Search for potential copyright infringement by extracting any content that matches our copyrighted material. Look for: exact text matches, paraphrased content, unauthorized use of brand names, stolen images or videos, and plagiarized articles. Return results in this schema: { \"url\": \"https://example.com/page\", \"title\": \"Page Title\", \"content_snippet\": \"Matching content found\", \"match_type\": \"exact_match|paraphrase|brand_usage|image_theft\", \"confidence_score\": \"high|medium|low\", \"domain\": \"example.com\", \"date_found\": \"2024-01-01\" }",
        "websiteUrl": "https://www.google.com/search?q=\"your+copyrighted+content+here\"+OR+\"brand+name\"+OR+\"unique+phrase\""
      },
      "typeVersion": 1
    },
    {
      "id": "e526d918-fa3d-40f2-882f-5e2f7d3e40a0",
      "name": "内容比较器",
      "type": "n8n-nodes-base.code",
      "notes": "Analyzes potential\ninfringements and\ncalculates similarity",
      "position": [
        480,
        336
      ],
      "parameters": {
        "jsCode": "// Get the input data from ScrapeGraphAI\nconst inputData = $input.all()[0].json;\n\n// Extract potential infringements from result\nconst potentialInfringements = inputData.result.copyright_matches || inputData.result.matches || inputData.result.infringements || [];\n\n// Define your copyrighted content for comparison\nconst copyrightedContent = {\n  texts: [\n    \"Your unique copyrighted text here\",\n    \"Another protected phrase or paragraph\",\n    \"Brand slogan or tagline\"\n  ],\n  brandNames: [\"YourBrand\", \"CompanyName\", \"ProductName\"],\n  domains: [\"yourwebsite.com\", \"yourcompany.com\"]\n};\n\n// Function to calculate similarity score\nfunction calculateSimilarity(text1, text2) {\n  const words1 = text1.toLowerCase().split(/\\W+/);\n  const words2 = text2.toLowerCase().split(/\\W+/);\n  const intersection = words1.filter(word => words2.includes(word));\n  return intersection.length / Math.max(words1.length, words2.length);\n}\n\n// Function to analyze potential infringement\nfunction analyzeInfringement(item) {\n  const analysis = {\n    url: item.url,\n    title: item.title,\n    content_snippet: item.content_snippet,\n    domain: item.domain,\n    date_found: new Date().toISOString().split('T')[0],\n    infringement_type: [],\n    similarity_scores: [],\n    risk_level: 'low',\n    requires_action: false\n  };\n\n  // Check for exact text matches\n  copyrightedContent.texts.forEach((protectedText, index) => {\n    const similarity = calculateSimilarity(protectedText, item.content_snippet || '');\n    analysis.similarity_scores.push({\n      text_index: index,\n      score: similarity\n    });\n    \n    if (similarity > 0.8) {\n      analysis.infringement_type.push('high_similarity_text');\n      analysis.risk_level = 'high';\n      analysis.requires_action = true;\n    } else if (similarity > 0.5) {\n      analysis.infringement_type.push('moderate_similarity_text');\n      analysis.risk_level = analysis.risk_level === 'low' ? 'medium' : analysis.risk_level;\n    }\n  });\n\n  // Check for brand name usage\n  const contentLower = (item.content_snippet || '').toLowerCase();\n  const titleLower = (item.title || '').toLowerCase();\n  \n  copyrightedContent.brandNames.forEach(brand => {\n    if (contentLower.includes(brand.toLowerCase()) || titleLower.includes(brand.toLowerCase())) {\n      analysis.infringement_type.push('unauthorized_brand_usage');\n      analysis.risk_level = analysis.risk_level === 'low' ? 'medium' : 'high';\n      if (analysis.risk_level === 'high') {\n        analysis.requires_action = true;\n      }\n    }\n  });\n\n  // Check if it's from competitor or suspicious domain\n  const suspiciousDomains = ['competitor.com', 'copycatsite.com'];\n  if (suspiciousDomains.some(domain => item.url?.includes(domain))) {\n    analysis.infringement_type.push('competitor_usage');\n    analysis.risk_level = 'high';\n    analysis.requires_action = true;\n  }\n\n  // Filter out our own domains\n  if (copyrightedContent.domains.some(domain => item.url?.includes(domain))) {\n    return null; // Skip our own content\n  }\n\n  return analysis;\n}\n\n// Process all potential infringements\nconst analyzedResults = potentialInfringements\n  .map(analyzeInfringement)\n  .filter(result => result !== null)\n  .filter(result => result.requires_action || result.risk_level !== 'low');\n\nconsole.log(`Analyzed ${potentialInfringements.length} potential matches, found ${analyzedResults.length} concerning cases`);\n\n// Return each concerning case as separate execution\nreturn analyzedResults.map(analysis => ({\n  json: {\n    ...analysis,\n    alert_message: `🚨 COPYRIGHT INFRINGEMENT DETECTED\\n\\n📍 URL: ${analysis.url}\\n📄 Title: ${analysis.title}\\n⚠️ Risk Level: ${analysis.risk_level.toUpperCase()}\\n🔍 Issues: ${analysis.infringement_type.join(', ')}\\n📝 Content: ${analysis.content_snippet?.substring(0, 200)}...\\n📅 Detected: ${analysis.date_found}`\n  }\n}));"
      },
      "notesInFlow": true,
      "typeVersion": 2
    },
    {
      "id": "321a94a8-6846-4bb9-93ae-f1eb1aa19bb7",
      "name": "侵权检测器",
      "type": "n8n-nodes-base.code",
      "notes": "Determines legal\naction required and\ncreates case reports",
      "position": [
        736,
        64
      ],
      "parameters": {
        "jsCode": "// Get analyzed infringement data\nconst infringementData = $input.all()[0].json;\n\n// Define thresholds and rules for legal action\nconst legalActionRules = {\n  immediate_action: {\n    conditions: [\n      'high_similarity_text',\n      'unauthorized_brand_usage',\n      'competitor_usage'\n    ],\n    risk_level: 'high'\n  },\n  monitoring_required: {\n    conditions: [\n      'moderate_similarity_text'\n    ],\n    risk_level: 'medium'\n  }\n};\n\n// Function to determine legal action required\nfunction determineLegalAction(data) {\n  const actionPlan = {\n    immediate_cease_desist: false,\n    dmca_takedown: false,\n    legal_consultation: false,\n    monitoring_only: false,\n    evidence_collection: true, // Always collect evidence\n    priority: 'low'\n  };\n\n  // Check for immediate action conditions\n  const hasImmediateConditions = data.infringement_type.some(type => \n    legalActionRules.immediate_action.conditions.includes(type)\n  );\n\n  if (hasImmediateConditions && data.risk_level === 'high') {\n    actionPlan.immediate_cease_desist = true;\n    actionPlan.dmca_takedown = true;\n    actionPlan.legal_consultation = true;\n    actionPlan.priority = 'high';\n  } else if (data.risk_level === 'medium') {\n    actionPlan.monitoring_only = true;\n    actionPlan.priority = 'medium';\n  }\n\n  return actionPlan;\n}\n\n// Generate legal action plan\nconst legalAction = determineLegalAction(infringementData);\n\n// Create comprehensive report\nconst legalReport = {\n  case_id: `COPY-${Date.now()}`,\n  detected_date: infringementData.date_found,\n  infringement_details: {\n    url: infringementData.url,\n    domain: infringementData.domain,\n    title: infringementData.title,\n    content_snippet: infringementData.content_snippet,\n    infringement_types: infringementData.infringement_type,\n    similarity_scores: infringementData.similarity_scores,\n    risk_assessment: infringementData.risk_level\n  },\n  recommended_actions: legalAction,\n  next_steps: [],\n  estimated_timeline: ''\n};\n\n// Define next steps based on action plan\nif (legalAction.immediate_cease_desist) {\n  legalReport.next_steps.push(\n    '1. Send cease and desist letter within 24 hours',\n    '2. File DMCA takedown notice with hosting provider',\n    '3. Schedule legal consultation within 48 hours',\n    '4. Document all evidence and screenshots',\n    '5. Monitor for compliance'\n  );\n  legalReport.estimated_timeline = '24-72 hours for initial action';\n} else if (legalAction.monitoring_only) {\n  legalReport.next_steps.push(\n    '1. Add to monitoring watchlist',\n    '2. Collect additional evidence over 7 days',\n    '3. Assess if infringement escalates',\n    '4. Prepare preliminary legal documentation'\n  );\n  legalReport.estimated_timeline = '7-14 days monitoring period';\n}\n\nconsole.log(`Legal action determination complete for case ${legalReport.case_id}`);\n\nreturn {\n  json: {\n    ...legalReport,\n    alert_priority: legalAction.priority,\n    requires_immediate_attention: legalAction.immediate_cease_desist\n  }\n};"
      },
      "notesInFlow": true,
      "typeVersion": 2
    },
    {
      "id": "2b5a649b-2f09-4fb1-969e-e142f691ecc9",
      "name": "法律行动触发器",
      "type": "n8n-nodes-base.if",
      "position": [
        1152,
        368
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 1,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "legal-action-condition",
              "operator": {
                "type": "boolean",
                "operation": "equals"
              },
              "leftValue": "={{ $json.requires_immediate_attention }}",
              "rightValue": true
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "7a7cbecd-0a04-4ef5-bf56-3f3dfe17bf94",
      "name": "品牌保护警报",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1664,
        48
      ],
      "webhookId": "4c70943a-e94f-47dd-a335-31441ff85d51",
      "parameters": {
        "text": "🚨 **URGENT COPYRIGHT INFRINGEMENT DETECTED** 🚨\n\n📋 **Case ID:** {{ $json.case_id }}\n📅 **Date:** {{ $json.detected_date }}\n⚡ **Priority:** {{ $json.alert_priority.toUpperCase() }}\n\n🌐 **Infringing Site:**\n• URL: {{ $json.infringement_details.url }}\n• Domain: {{ $json.infringement_details.domain }}\n• Title: {{ $json.infringement_details.title }}\n\n⚠️ **Violation Type:**\n{{ $json.infringement_details.infringement_types.join(', ') }}\n\n📊 **Risk Level:** {{ $json.infringement_details.risk_assessment.toUpperCase() }}\n\n📋 **Next Steps:**\n{{ $json.next_steps.join('\\n') }}\n\n⏰ **Timeline:** {{ $json.estimated_timeline }}\n\n🔗 **Evidence:** [View Full Report](#)\n\n━━━━━━━━━━━━━━━━━━━━━━\n⚖️ **Legal Team Action Required**",
        "chatId": "@copyright_alerts",
        "additionalFields": {
          "parse_mode": "Markdown"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "20846c4f-d0b9-4f08-8181-d2fbf9a986d0",
      "name": "监控警报",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1680,
        736
      ],
      "webhookId": "be33b1da-270a-4e6f-ad9f-328679cee420",
      "parameters": {
        "text": "📊 **Copyright Monitoring Report**\n\n📋 **Case ID:** {{ $json.case_id }}\n📅 **Date:** {{ $json.detected_date }}\n📈 **Priority:** {{ $json.alert_priority }}\n\n🌐 **Monitored Site:**\n• URL: {{ $json.infringement_details.url }}\n• Domain: {{ $json.infringement_details.domain }}\n\n📝 **Assessment:** {{ $json.infringement_details.risk_assessment }}\n📋 **Actions:** {{ $json.next_steps.join(', ') }}\n\n━━━━━━━━━━━━━━━━━━━━━━\n👁️ **Monitoring Dashboard**",
        "chatId": "@copyright_monitoring",
        "additionalFields": {
          "parse_mode": "Markdown"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "534f51b7-0e8c-4775-9030-fe244e9e4a19",
      "name": "便签 - 触发器",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1472,
        -384
      ],
      "parameters": {
        "color": 5,
        "width": 575,
        "height": 658,
        "content": "# 步骤5:法律行动触发器 🎯"
      },
      "typeVersion": 1
    },
    {
      "id": "9ec87a46-c585-4075-ba15-3b097c3aa9af",
      "name": "便签 - 搜索",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -256,
        -208
      ],
      "parameters": {
        "color": 5,
        "width": 575,
        "height": 898,
        "content": "# 步骤2:ScrapeGraphAI 网络搜索 🔍"
      },
      "typeVersion": 1
    },
    {
      "id": "00380ed5-caeb-4c9f-9900-a6202f680b38",
      "name": "便签 - 比较器",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        320,
        -208
      ],
      "parameters": {
        "color": 5,
        "width": 575,
        "height": 898,
        "content": "# 步骤3:内容比较器 🔍"
      },
      "typeVersion": 1
    },
    {
      "id": "b0f30500-0353-47d7-979b-83bf4e589863",
      "name": "便签 - 检测器",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        896,
        -208
      ],
      "parameters": {
        "color": 5,
        "width": 575,
        "height": 898,
        "content": "# 步骤4:侵权检测器 ⚖️"
      },
      "typeVersion": 1
    },
    {
      "id": "e5dcf0d2-f199-4c11-9f1b-6d528e25c5c4",
      "name": "便签 - 警报",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1472,
        272
      ],
      "parameters": {
        "color": 5,
        "width": 575,
        "height": 690,
        "content": "# 步骤6:品牌保护警报 🚨"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "90f4a869-5a6c-4081-ba47-96ea07ff7965",
  "connections": {
    "Content Comparer": {
      "main": [
        [
          {
            "node": "Infringement Detector",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "ScrapeGraphAI Web Search",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Legal Action Trigger": {
      "main": [
        [
          {
            "node": "Brand Protection Alert",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Monitoring Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Infringement Detector": {
      "main": [
        [
          {
            "node": "Legal Action Trigger",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ScrapeGraphAI Web Search": {
      "main": [
        [
          {
            "node": "Content Comparer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 杂项, AI 摘要总结

需要付费吗?

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

工作流信息
难度等级
中级
节点数量12
分类2
节点类型6
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

外部链接
在 n8n.io 查看

分享此工作流