8
n8n 中文网amn8n.com

n8n调试

中级

这是一个Engineering领域的自动化工作流,包含 9 个节点。主要使用 If, Slack, DebugHelper, ManualTrigger, SplitInBatches 等节点。 使用Slack交互式消息创建调试断点和日志

前置要求
  • Slack Bot Token 或 Webhook URL

分类

工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "hLfk0dRqKZU6LPUA",
  "meta": {
    "instanceId": "87021cc08fe86f3c88c615ac7015b93e398b6bf953b85302471896e86cc798ef",
    "templateCredsSetupCompleted": true
  },
  "name": "n8n 调试",
  "tags": [],
  "nodes": [
    {
      "id": "eee9f55d-ab30-43b8-978b-865cc119f36e",
      "name": "当点击\"执行工作流\"时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1180,
        -380
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "ab85c1d8-19d2-4b27-8de7-98cf44b2515f",
      "name": "断点",
      "type": "n8n-nodes-base.slack",
      "position": [
        -260,
        -300
      ],
      "webhookId": "b2cedf16-3a75-454a-9730-4cbd4a50d2cd",
      "parameters": {
        "select": "channel",
        "message": "Execution halted.. Continue?",
        "options": {
          "limitWaitTime": {
            "values": {
              "resumeUnit": "minutes",
              "resumeAmount": 3
            }
          }
        },
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "C08ALJ7JM1S",
          "cachedResultName": "n8n_errors"
        },
        "operation": "sendAndWait",
        "authentication": "oAuth2",
        "approvalOptions": {
          "values": {
            "approveLabel": "Continue?"
          }
        }
      },
      "credentials": {
        "slackOAuth2Api": {
          "id": "NnMpMgQY1wArhZjI",
          "name": "WyethSlack"
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "669dbd64-bb46-4c14-a32d-98addb8e855b",
      "name": "无操作,不执行任何操作",
      "type": "n8n-nodes-base.noOp",
      "position": [
        0,
        -80
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "a612f161-5c67-4472-beca-c28656be5253",
      "name": "无操作,不执行任何操作1",
      "type": "n8n-nodes-base.noOp",
      "position": [
        60,
        -400
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "f20ab72a-1514-42e9-9433-128f199a62fe",
      "name": "遍历项目",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -700,
        -380
      ],
      "parameters": {
        "options": {
          "reset": false
        }
      },
      "typeVersion": 3
    },
    {
      "id": "ed5ad713-1e17-4ca3-a52d-da090b12fbc4",
      "name": "10 个随机数据项",
      "type": "n8n-nodes-base.debugHelper",
      "position": [
        -920,
        -380
      ],
      "parameters": {
        "category": "randomData",
        "randomDataType": "email"
      },
      "typeVersion": 1
    },
    {
      "id": "fb5bcccd-4c88-45e4-9b8f-72418ef2f3f6",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1220,
        -660
      ],
      "parameters": {
        "color": 5,
        "width": 1480,
        "content": "## 使用 Slack 进行调试断点!"
      },
      "typeVersion": 1
    },
    {
      "id": "9a428e72-6132-4da0-9195-7951e8c7caa1",
      "name": "便签 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -360,
        -460
      ],
      "parameters": {
        "color": 7,
        "width": 340,
        "height": 320,
        "content": "这将向用户或频道发送消息并等待继续。对于团队,建议您为每个用户设置变量并使用您自己的个人频道。"
      },
      "typeVersion": 1
    },
    {
      "id": "38e36175-f9d9-47a6-8e94-47cba3abfd28",
      "name": "如果循环为 4",
      "type": "n8n-nodes-base.if",
      "position": [
        -520,
        -280
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "5db6bf4f-1c31-45de-bab6-63367027889c",
              "operator": {
                "type": "number",
                "operation": "equals"
              },
              "leftValue": "={{ $runIndex }}",
              "rightValue": 4
            }
          ]
        }
      },
      "typeVersion": 2.2
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "0ce2012e-6988-4b17-903a-c9be291d2358",
  "connections": {
    "Breakpoint": {
      "main": [
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Loop is 4": {
      "main": [
        [
          {
            "node": "Breakpoint",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [
          {
            "node": "No Operation, do nothing1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "If Loop is 4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "10 Random Data Items": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "No Operation, do nothing": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "10 Random Data Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 工程

需要付费吗?

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

工作流信息
难度等级
中级
节点数量9
分类1
节点类型7
难度说明

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

外部链接
在 n8n.io 查看

分享此工作流