8
n8n 中文网amn8n.com

使用 RapidAPI 和 Google Sheets 的自动抄袭检测与邮件报告

高级

这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 19 个节点。主要使用 If, Code, EmailSend, HttpRequest, GoogleSheets 等节点。 使用 RapidAPI 和 Google Sheets 的自动抄袭检测与邮件报告

前置要求
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "60c025075753afcab9f803964b4caaca9402f435deb4efafbb8e3b93b54d8752",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "806a295f-8337-4459-bdc7-5e3b9f3634de",
      "name": "触发器 - Google Sheets中的新行",
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "position": [
        1120,
        288
      ],
      "parameters": {
        "event": "rowAdded",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultUrl": "k",
          "cachedResultName": "Plagiarism "
        }
      },
      "credentials": {
        "googleSheetsTriggerOAuth2Api": {
          "id": "FpH9aIBJX3kMRYBZ",
          "name": "Google Sheets Trigger account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "a9057c26-4936-48d4-a8d5-23efe3bb528d",
      "name": "发送内容到抄袭检测API",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1456,
        288
      ],
      "parameters": {
        "url": "https://plagiarism-checker-ai-powered.p.rapidapi.com/plagiarism.php",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "content",
              "value": "={{ $('Trigger - New Row in Google Sheet').item.json.Content }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "x-rapidapi-host",
              "value": "plagiarism-checker-ai-powered.p.rapidapi.com"
            },
            {
              "name": "x-rapidapi-key",
              "value": "Your key"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "0438c692-bd49-455f-a1a9-afb0ef853b0a",
      "name": "检查API响应是否成功",
      "type": "n8n-nodes-base.if",
      "position": [
        1712,
        144
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "0ce9b91f-8d33-4ca9-b7bc-67421d0ab1a9",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.success }}",
              "rightValue": ""
            },
            {
              "id": "5963f077-ab3a-4658-a55f-57ea89db5901",
              "operator": {
                "type": "array",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json.data.results.results }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "ff20ec20-e67d-42bb-a903-7452f0801389",
      "name": "提取抄袭检测结果",
      "type": "n8n-nodes-base.code",
      "position": [
        2000,
        64
      ],
      "parameters": {
        "jsCode": "return $input.first().json.data.results.results;"
      },
      "typeVersion": 2
    },
    {
      "id": "0fb5c95c-1182-4f1c-9bb5-a58218518976",
      "name": "生成HTML抄袭检测报告",
      "type": "n8n-nodes-base.code",
      "position": [
        2288,
        48
      ],
      "parameters": {
        "jsCode": "const results = $input.all();\n\nlet html = `<h2>📝 Plagiarism Report</h2>`;\nhtml += `<p>The following content has been analyzed. Below is the similarity report:</p>`;\n\nfor (const item of results) {\n  const phrase = item.json.phrase;\n  const matches = item.json.results;\n\n  html += `<hr/>`;\n  html += `<p><strong>Original Phrase:</strong><br>\"${phrase}\"</p>`;\n\n  if (!matches || matches.length === 0) {\n    html += `<p style=\"color:green;\">✅ No matches found</p>`;\n    continue;\n  }\n\n  html += `<ul>`;\n  for (const match of matches) {\n    const title = match.title;\n    const link = match.link;\n    const score = match.scores?.[0]?.score?.toFixed(2);\n    const matchedSentence = match.scores?.[0]?.sentence;\n\n    html += `\n      <li>\n        <p><strong>Matched Source:</strong> <a href=\"${link}\" target=\"_blank\">${title}</a></p>\n        <p><strong>Similarity Score:</strong> ${score}</p>\n        <p><em>\"${matchedSentence}\"</em></p>\n      </li>\n    `;\n  }\n  html += `</ul>`;\n}\n\nreturn [\n  {\n    json: {\n      subject: \"📄 Plagiarism Report\",\n      body: html\n    }\n  }\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "ef430ff6-e774-4aff-b66d-0b0000aa0d15",
      "name": "通过邮件向用户发送报告",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        2592,
        112
      ],
      "webhookId": "e4772861-5743-476f-83ef-82e3f15cf5a2",
      "parameters": {
        "html": "={{ $json.body }}",
        "options": {},
        "subject": "={{ $json.subject }}",
        "toEmail": "=user@test.com",
        "fromEmail": "admin@test.com"
      },
      "credentials": {
        "smtp": {
          "id": "nPwKPPgVavimTJX4",
          "name": "SMTP account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "d70d998c-cbb7-4478-bf41-56f027da2a07",
      "name": "在Google Sheets中标记状态:成功",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2992,
        288
      ],
      "parameters": {
        "columns": {
          "value": {
            "Status": "Success ",
            "Content": "={{ $('Trigger - New Row in Google Sheet').item.json.Content }}"
          },
          "schema": [
            {
              "id": "Content",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Content",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Content"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultUrl": "",
          "cachedResultName": "Plagiarism "
        },
        "authentication": "serviceAccount"
      },
      "credentials": {
        "googleApi": {
          "id": "Rt0RWApx8PL9t0RF",
          "name": "Google Docs account"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "61535540-0df7-43d6-afe5-76f2fe0f5b62",
      "name": "向IT发送失败警报",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        2112,
        576
      ],
      "webhookId": "183ad2a4-3ab5-44b3-9cc8-9ac5dff65137",
      "parameters": {
        "html": "=<h2>🚨 Plagiarism Check Failure Alert</h2>\n\n<p><strong>System:</strong> Plagiarism Checker AI</p>\n<p><strong>Status:</strong> <span style=\"color:red;\">❌ Failed to complete the plagiarism check</span></p>\n\n<h3>🔍 Failure Details</h3>\n<ul>\n  <li><strong>Timestamp:</strong> {{ $now }}</li>\n  <li><strong>User Content:</strong></li>\n</ul>\n<blockquote style=\"background-color:#f9f9f9;padding:10px;border-left:3px solid #ccc;\">\n  {{ $json[\"content\"] || \"No content received\" }}\n</blockquote>\n\n<h3>⚠️ Recommended Actions</h3>\n<ul>\n  <li>Check API availability and key validity</li>\n  <li>Inspect server/network logs</li>\n  <li>Ensure correct data formatting from the form submission</li>\n</ul>\n\n<hr>\n<p style=\"color:gray;font-size:12px;\">This message was automatically generated by the n8n workflow: <strong>Plagiarism Checker AI</strong>.</p>\n",
        "options": {},
        "subject": "ALERT: Plagiarism Check Failed – Immediate Attention Required",
        "toEmail": "it@test.com",
        "fromEmail": "admin@test.com"
      },
      "credentials": {
        "smtp": {
          "id": "nPwKPPgVavimTJX4",
          "name": "SMTP account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "7784e381-f704-4981-96bc-005c1ce5064a",
      "name": "在Google Sheets中标记状态:失败",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2448,
        576
      ],
      "parameters": {
        "columns": {
          "value": {
            "Status": "Failed",
            "Content": "={{ $('Trigger - New Row in Google Sheet').item.json.Content }}"
          },
          "schema": [
            {
              "id": "Content",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Content",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Content"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultUrl": "",
          "cachedResultName": "Plagiarism "
        },
        "authentication": "serviceAccount"
      },
      "credentials": {
        "googleApi": {
          "id": "Rt0RWApx8PL9t0RF",
          "name": "Google Docs account"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "182d4104-b1ca-4731-8bdb-76ef606b6060",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1040,
        160
      ],
      "parameters": {
        "height": 272,
        "content": "监视特定Google Sheets中添加的新行。"
      },
      "typeVersion": 1
    },
    {
      "id": "998ab663-310d-44eb-9b24-230fc52042a7",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1376,
        160
      ],
      "parameters": {
        "height": 272,
        "content": "将提交的内容发送到外部抄袭检测API。"
      },
      "typeVersion": 1
    },
    {
      "id": "ba69627c-cfb6-4426-a706-b959c717e033",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1648,
        -16
      ],
      "parameters": {
        "height": 272,
        "content": "检查API是否返回成功响应和有效结果。"
      },
      "typeVersion": 1
    },
    {
      "id": "9e964af6-213d-42c6-9e44-57f47ed61ae0",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1936,
        -32
      ],
      "parameters": {
        "height": 272,
        "content": "从API响应中提取结果数组。"
      },
      "typeVersion": 1
    },
    {
      "id": "61e70bcd-4fa6-42ba-9889-ed7f1d55af53",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2224,
        -80
      ],
      "parameters": {
        "height": 272,
        "content": "将提取的抄袭数据格式化为可读的HTML报告。"
      },
      "typeVersion": 1
    },
    {
      "id": "4586d451-cc69-4105-976d-387a37232133",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2544,
        -32
      ],
      "parameters": {
        "height": 304,
        "content": "通过邮件向用户发送生成的抄袭检测报告。"
      },
      "typeVersion": 1
    },
    {
      "id": "036e05fc-c6c8-4f13-b31d-68573e801af7",
      "name": "### 需要帮助?",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2880,
        176
      ],
      "parameters": {
        "height": 288,
        "content": "将原始行的状态列更新为\"成功\"。"
      },
      "typeVersion": 1
    },
    {
      "id": "94a0a7ce-8568-4694-967c-6ad29597114b",
      "name": "## 试试看!",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2080,
        448
      ],
      "parameters": {
        "height": 272,
        "content": "当API检查失败时向IT发送警报邮件。"
      },
      "typeVersion": 1
    },
    {
      "id": "7a23855d-1487-4da6-8c4a-de1aebef57a1",
      "name": "GET 模型",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2400,
        480
      ],
      "parameters": {
        "height": 240,
        "content": "在Google Sheets中将行标记为\"失败\"状态。"
      },
      "typeVersion": 1
    },
    {
      "id": "3f9b076d-a7cc-4e13-adff-7e57d9dedfd6",
      "name": "## 1. 创建新的自定义 OpenAI 凭据",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        32,
        48
      ],
      "parameters": {
        "width": 672,
        "height": 944,
        "content": ""
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "Send Failure Alert to IT": {
      "main": [
        [
          {
            "node": "Mark Status: Failed in Google Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check API Response Success": {
      "main": [
        [
          {
            "node": "Extract Plagiarism Results",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Failure Alert to IT",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Plagiarism Results": {
      "main": [
        [
          {
            "node": "Generate HTML Plagiarism Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Report to User via Email": {
      "main": [
        [
          {
            "node": "Mark Status: Success in Google Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Content to Plagiarism API": {
      "main": [
        [
          {
            "node": "Check API Response Success",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate HTML Plagiarism Report": {
      "main": [
        [
          {
            "node": "Send Report to User via Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Trigger - New Row in Google Sheet": {
      "main": [
        [
          {
            "node": "Send Content to Plagiarism API",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 内容创作, 多模态 AI

需要付费吗?

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

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

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

外部链接
在 n8n.io 查看

分享此工作流