8
n8n 中文网amn8n.com

自动化测试运行和状态更新

高级

这是一个自动化工作流,包含 27 个节点。主要使用 If, Set, Code, ClickUp, GoogleDrive 等节点。 自动化工作流测试运行器,集成 Google Drive、Sheets 和 ClickUp 结果记录

前置要求
  • Google Drive API 凭证
  • Google Sheets API 凭证

分类

-
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "ZI6iraWt5DF3ohnS",
  "meta": {
    "instanceId": "8443f10082278c46aa5cf3acf8ff0f70061a2c58bce76efac814b16290845177",
    "templateCredsSetupCompleted": true
  },
  "name": "自动化测试运行和状态更新",
  "tags": [],
  "nodes": [
    {
      "id": "ebbca67b-a5e8-47a6-b0f0-0e01a2cf0c90",
      "name": "当点击\"执行工作流\"时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -576,
        0
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "f90f0568-e7ab-451c-bfe9-7151835fec62",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -384,
        208
      ],
      "parameters": {
        "width": 304,
        "height": 368,
        "content": "## 🔄 执行目标测试工作流"
      },
      "typeVersion": 1
    },
    {
      "id": "f5de02c6-f686-402f-90df-80bc60151c1c",
      "name": "便签 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -96,
        -480
      ],
      "parameters": {
        "height": 448,
        "content": "## ✅ 测试结果评估(通过/失败检查)"
      },
      "typeVersion": 1
    },
    {
      "id": "3af7b28f-f3a6-45af-a3c0-49d0d867290d",
      "name": "测试结果评估",
      "type": "n8n-nodes-base.if",
      "position": [
        -16,
        0
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "c9f7e963-a035-4c64-82ef-f870f1d6587c",
              "operator": {
                "type": "string",
                "operation": "notExists",
                "singleValue": true
              },
              "leftValue": "={{$json[\"error\"]}}",
              "rightValue": ""
            }
          ]
        },
        "looseTypeValidation": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "c9ded697-7e80-4c9d-ae63-b34dd83a4b4b",
      "name": "格式化成功测试结果",
      "type": "n8n-nodes-base.set",
      "position": [
        384,
        -208
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "e70c3468-0767-470a-b780-7e17188788c2",
              "name": "status",
              "type": "string",
              "value": "✅ Passed"
            },
            {
              "id": "6b01dbe6-137a-46d0-b909-0c863d25e3a1",
              "name": "tested_workflow",
              "type": "string",
              "value": "Retention Tracking Post-Hire"
            },
            {
              "id": "5ca7a3ff-f30a-4ab4-9a54-b33188458d7a",
              "name": "",
              "type": "string",
              "value": ""
            },
            {
              "id": "f6f5dd9b-379c-4e96-b74f-d394f0e9d83f",
              "name": "timestamp",
              "type": "string",
              "value": "=={{$now}}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "0df832de-9809-4c05-944b-1ab8e62fb6ff",
      "name": "便签 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1232,
        -704
      ],
      "parameters": {
        "height": 448,
        "content": "## ☁️ 将成功测试报告归档到Google Drive"
      },
      "typeVersion": 1
    },
    {
      "id": "18671bfd-775b-42e6-a64e-3921ffee5961",
      "name": "便签 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        960,
        -640
      ],
      "parameters": {
        "height": 384,
        "content": "## 📦 将成功报告转换为文本文件"
      },
      "typeVersion": 1
    },
    {
      "id": "90db750f-6254-40d3-8755-4b22c377f3c3",
      "name": "便签 4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        640,
        -640
      ],
      "parameters": {
        "height": 400,
        "content": "## 📄 生成成功报告文本"
      },
      "typeVersion": 1
    },
    {
      "id": "fcce2d0a-4f68-49c5-a1e6-87be0cadb94b",
      "name": "便签 5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        288,
        -672
      ],
      "parameters": {
        "height": 448,
        "content": "## 🎯 格式化成功测试结果"
      },
      "typeVersion": 1
    },
    {
      "id": "48482dbc-5fa7-47d6-8f4e-94f4f7cecf3c",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        320,
        384
      ],
      "parameters": {
        "height": 448,
        "content": "## ❌ 格式化失败测试结果"
      },
      "typeVersion": 1
    },
    {
      "id": "163d4cae-b9b2-4317-867e-d5b3ad1d4173",
      "name": "格式化失败测试结果",
      "type": "n8n-nodes-base.set",
      "position": [
        368,
        224
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "e70c3468-0767-470a-b780-7e17188788c2",
              "name": "status",
              "type": "string",
              "value": "❌ Failed"
            },
            {
              "id": "6b01dbe6-137a-46d0-b909-0c863d25e3a1",
              "name": "tested_workflow",
              "type": "string",
              "value": "Retention Tracking Post-Hire"
            },
            {
              "id": "f6f5dd9b-379c-4e96-b74f-d394f0e9d83f",
              "name": "timestamp",
              "type": "string",
              "value": "=={{$now}}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "5040deb0-6db6-40c8-9cad-f8637dd2f9fa",
      "name": "生成成功报告文本",
      "type": "n8n-nodes-base.code",
      "position": [
        736,
        -208
      ],
      "parameters": {
        "jsCode": "return [\n  {\n    json: {\n      text: `Workflow: ${$json.tested_workflow}\nStatus: ${$json.status}\nTimestamp: ${$json.timestamp}`\n    }\n  }\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "2b1741e8-7258-4f28-b050-57dc4545692b",
      "name": "便签7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1232,
        416
      ],
      "parameters": {
        "height": 400,
        "content": "## ☁️ 将失败测试报告归档到Google Drive"
      },
      "typeVersion": 1
    },
    {
      "id": "8e5de5e8-71a1-4a74-b1a9-df712153c9db",
      "name": "便签8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        944,
        416
      ],
      "parameters": {
        "height": 352,
        "content": "## 📦 将失败报告转换为文本文件"
      },
      "typeVersion": 1
    },
    {
      "id": "54f6ba7c-b99c-40c3-a0ec-14bfd933ca2c",
      "name": "便签9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        672,
        400
      ],
      "parameters": {
        "height": 368,
        "content": "## 📄 生成失败报告文本"
      },
      "typeVersion": 1
    },
    {
      "id": "6637cf99-13de-4668-bb63-ea921dccc182",
      "name": "生成失败报告文本",
      "type": "n8n-nodes-base.code",
      "position": [
        736,
        224
      ],
      "parameters": {
        "jsCode": "return [\n  {\n    json: {\n      text: `Workflow: ${$json.tested_workflow}\nStatus: ${$json.status}\nTimestamp: ${$json.timestamp}`\n    }\n  }\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "1140f35d-1fc6-4dab-b7a5-4ac118ea4a6d",
      "name": "将成功报告转换为文本文件",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        1024,
        -208
      ],
      "parameters": {
        "options": {},
        "operation": "toText",
        "sourceProperty": "=text"
      },
      "typeVersion": 1.1
    },
    {
      "id": "57b36b45-ebfb-4e36-8b3d-79641f1831a9",
      "name": "将失败报告转换为文本文件",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        1008,
        224
      ],
      "parameters": {
        "options": {},
        "operation": "toText",
        "sourceProperty": "=text"
      },
      "typeVersion": 1.1
    },
    {
      "id": "4b572d2b-e233-410b-aa83-abae2b023184",
      "name": "将成功测试报告归档到Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1296,
        -208
      ],
      "parameters": {
        "name": "={{ $json.tested_workflow }}_{{ $json.status }}_{{ $json.timestamp.replace(/[:.]/g, \"-\") }}.txt\n",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "16lOVXsq0xkvJ8sCM7hCFAghQvDOXann7",
          "cachedResultUrl": "https://drive.google.com/drive/folders/16lOVXsq0xkvJ8sCM7hCFAghQvDOXann7",
          "cachedResultName": "resume store"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "E7nEqUL27GUx1xHa",
          "name": "Techdome Account"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "0c3a0ce7-61bd-4ab4-9e3b-a0f6a97c75bb",
      "name": "将失败测试报告归档到Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1312,
        224
      ],
      "parameters": {
        "name": "={{ $json.tested_workflow }}_{{ $json.status }}_{{ $json.timestamp.replace(/[:.]/g, \"-\") }}.txt\n",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "16lOVXsq0xkvJ8sCM7hCFAghQvDOXann7",
          "cachedResultUrl": "https://drive.google.com/drive/folders/16lOVXsq0xkvJ8sCM7hCFAghQvDOXann7",
          "cachedResultName": "resume store"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "E7nEqUL27GUx1xHa",
          "name": "Techdome Account"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "dcde5325-c1a3-4e33-acf9-661587287d9f",
      "name": "便签 10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1552,
        400
      ],
      "parameters": {
        "height": 400,
        "content": "## ✏️ 使用失败状态更新ClickUp任务"
      },
      "typeVersion": 1
    },
    {
      "id": "5622acb4-1563-498d-9ac8-cb0d2fdadebf",
      "name": "便签11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1520,
        -656
      ],
      "parameters": {
        "height": 400,
        "content": "## ✏️ 使用成功状态更新ClickUp任务"
      },
      "typeVersion": 1
    },
    {
      "id": "7c80063a-3bfe-4677-9dfc-9f24616bb84a",
      "name": "使用成功状态更新ClickUp任务",
      "type": "n8n-nodes-base.clickUp",
      "position": [
        1552,
        -208
      ],
      "parameters": {
        "id": "86b700vbb",
        "operation": "update",
        "updateFields": {
          "content": "={{ $('Generate Success Report Text').item.json.text }}"
        }
      },
      "credentials": {
        "clickUpApi": {
          "id": "kahuAqa6VKsSxhn1",
          "name": "ClickUp account 3"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "b26d1493-d58a-4395-b4d3-d2bdfa4080cb",
      "name": "使用失败状态更新ClickUp任务",
      "type": "n8n-nodes-base.clickUp",
      "position": [
        1584,
        224
      ],
      "parameters": {
        "id": "86b700vbb",
        "operation": "update",
        "updateFields": {
          "content": "={{ $('Generate Failure Report Text').item.json.text }}"
        }
      },
      "credentials": {
        "clickUpApi": {
          "id": "kahuAqa6VKsSxhn1",
          "name": "ClickUp account 3"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "5dff41d1-8ca3-49e2-a6cd-f181bb402cb0",
      "name": "便签 12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -144,
        784
      ],
      "parameters": {
        "height": 448,
        "content": "## 📊 将错误详情记录到错误跟踪表"
      },
      "typeVersion": 1
    },
    {
      "id": "4a18b563-f4ef-4ad8-8b19-74d45ac01736",
      "name": "将错误详情记录到错误跟踪表",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        144,
        752
      ],
      "parameters": {
        "columns": {
          "value": {
            "error": "={{ $json.error }}"
          },
          "schema": [
            {
              "id": "error_id",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "error_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "error",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "error",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1338537721,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Uldk_4BxWbdZTDZxFUeohIfeBmGHHqVEl9Ogb0l6R8Y/edit#gid=1338537721",
          "cachedResultName": "error log sheet"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1Uldk_4BxWbdZTDZxFUeohIfeBmGHHqVEl9Ogb0l6R8Y",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Uldk_4BxWbdZTDZxFUeohIfeBmGHHqVEl9Ogb0l6R8Y/edit?usp=drivesdk",
          "cachedResultName": "Interviewer Brief Pack "
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "kpPEOLCGn963qpoh",
          "name": "automations@techdome.ai"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "4158484c-a8ed-4c33-8ea2-f0fb7cf2194d",
      "name": "执行目标测试工作流",
      "type": "n8n-nodes-base.executeWorkflow",
      "onError": "continueRegularOutput",
      "position": [
        -288,
        0
      ],
      "parameters": {
        "options": {
          "waitForSubWorkflow": true
        },
        "workflowId": {
          "__rl": true,
          "mode": "list",
          "value": "gr2rafzxOw1ks4Bd",
          "cachedResultUrl": "/workflow/gr2rafzxOw1ks4Bd",
          "cachedResultName": "Archive Payment Receipts with Stripe, Google Drive, and Google Sheets"
        },
        "workflowInputs": {
          "value": {},
          "mappingMode": "defineBelow"
        }
      },
      "retryOnFail": false,
      "typeVersion": 1.3,
      "alwaysOutputData": true
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "034f6efb-c4fc-498e-95fa-b58bedd10782",
  "connections": {
    "Test Result Evaluation ": {
      "main": [
        [
          {
            "node": "Format Success Test Result",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Format Failed Test Result",
            "type": "main",
            "index": 0
          },
          {
            "node": " Log Error Details to Error Tracking Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Failed Test Result": {
      "main": [
        [
          {
            "node": "Generate Failure Report Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Success Test Result": {
      "main": [
        [
          {
            "node": "Generate Success Report Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Failure Report Text": {
      "main": [
        [
          {
            "node": "Convert Failure Report to Text File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Success Report Text": {
      "main": [
        [
          {
            "node": "Convert Success Report to Text File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Execute Target Workflow Under Test": {
      "main": [
        [
          {
            "node": "Test Result Evaluation ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert Failure Report to Text File": {
      "main": [
        [
          {
            "node": "Archive Failure Report to Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert Success Report to Text File": {
      "main": [
        [
          {
            "node": "Archive Success Report to Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Execute Target Workflow Under Test",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Archive Failure Report to Google Drive": {
      "main": [
        [
          {
            "node": "Update ClickUp Task with Failure Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Archive Success Report to Google Drive": {
      "main": [
        [
          {
            "node": "Update ClickUp Task with Success Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级

需要付费吗?

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

工作流信息
难度等级
高级
节点数量27
分类-
节点类型10
难度说明

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

作者
Rahul Joshi

Rahul Joshi

@rahul08

Rahul Joshi is a seasoned technology leader specializing in the n8n automation tool and AI-driven workflow automation. With deep expertise in building open-source workflow automation and self-hosted automation platforms, he helps organizations eliminate manual processes through intelligent n8n ai agent automation solutions.

外部链接
在 n8n.io 查看

分享此工作流