npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

n8n-nodes-wps-data-delete

v2.0.0

Published

WPS data delete node for n8n - Fixed webhook 30s timeout with auto-loop support

Readme

n8n-nodes-wps-data-delete

WPS数据删除节点 - N8N工作流自动化插件,支持多个Webhook URL配置。

功能特点

  • ✅ 支持配置多个WPS Webhook URL
  • ✅ 支持两种执行模式:
    • 执行所有: 依次执行所有配置的Webhook
    • 首次成功: 执行到第一个成功的Webhook即停止
  • ✅ 自动解析删除记录数
  • ✅ 详细的执行结果报告
  • ✅ 请求超时配置
  • ✅ 调试模式支持

安装

npm install n8n-nodes-wps-data-delete

配置说明

Webhook配置

每个Webhook配置包含以下字段:

  • Configuration Name: 配置名称(可选),用于标识此Webhook
  • Webhook URL: WPS Webhook地址
    • 格式: https://www.kdocs.cn/api/v3/ide/file/{fileId}/script/{scriptId}/sync_task
  • WPS API Token: AirScript-Token认证令牌

执行选项

  • Request Timeout: 请求超时时间(毫秒),默认60000ms(60秒)
    • 范围: 10000-300000ms
  • Execute Mode: 执行模式
    • Execute All: 执行所有Webhook,即使某个失败也继续
    • Execute First Success: 执行到第一个成功即停止
  • Enable Debug: 启用调试输出
  • Parse Deleted Count: 从响应日志中解析删除记录数(默认启用)

使用示例

1. 单个Webhook删除

配置单个Webhook URL执行删除操作。

输入配置:

{
  "webhookConfigurations": {
    "webhookConfig": [
      {
        "configName": "主Webhook",
        "webhookUrl": "https://www.kdocs.cn/api/v3/ide/file/xxx/script/xxx/sync_task",
        "wpsToken": "your-token-here"
      }
    ]
  }
}

输出结果:

{
  "success": true,
  "totalWebhooks": 1,
  "successfulWebhooks": 1,
  "failedWebhooks": 0,
  "message": "All 1 webhook(s) executed successfully in 2340ms, total deleted: 1490 records",
  "deletedCount": 1490,
  "details": [
    {
      "webhookName": "主Webhook",
      "webhookUrl": "https://www.kdocs.cn/api/v3/ide/file/xxx/script/xxx/sync_task",
      "success": true,
      "message": "Delete operation completed successfully",
      "deletedCount": 1490,
      "responseTime": 2340
    }
  ]
}

2. 多个Webhook - 执行所有模式

配置多个Webhook,全部执行。

输入配置:

{
  "webhookConfigurations": {
    "webhookConfig": [
      {
        "configName": "淘宝月报删除",
        "webhookUrl": "https://www.kdocs.cn/api/v3/ide/file/aaa/script/bbb/sync_task",
        "wpsToken": "token1"
      },
      {
        "configName": "快手月报删除",
        "webhookUrl": "https://www.kdocs.cn/api/v3/ide/file/ccc/script/ddd/sync_task",
        "wpsToken": "token2"
      }
    ]
  },
  "options": {
    "executeMode": "all"
  }
}

3. 多个Webhook - 首次成功模式

配置多个Webhook作为备份,执行到第一个成功即停止。

输入配置:

{
  "webhookConfigurations": {
    "webhookConfig": [
      {
        "configName": "主Webhook",
        "webhookUrl": "https://www.kdocs.cn/api/v3/ide/file/xxx1/script/yyy1/sync_task",
        "wpsToken": "token1"
      },
      {
        "configName": "备用Webhook",
        "webhookUrl": "https://www.kdocs.cn/api/v3/ide/file/xxx2/script/yyy2/sync_task",
        "wpsToken": "token2"
      }
    ]
  },
  "options": {
    "executeMode": "firstSuccess"
  }
}

输出结果(第一个成功):

{
  "success": true,
  "totalWebhooks": 2,
  "successfulWebhooks": 1,
  "failedWebhooks": 0,
  "message": "All 1 webhook(s) executed successfully in 1850ms, total deleted: 320 records",
  "deletedCount": 320,
  "details": [
    {
      "webhookName": "主Webhook",
      "webhookUrl": "https://www.kdocs.cn/api/v3/ide/file/xxx1/script/yyy1/sync_task",
      "success": true,
      "message": "Delete operation completed successfully",
      "deletedCount": 320,
      "responseTime": 1850
    }
  ]
}

删除记录数解析

插件会自动从WPS返回的日志中解析删除记录数,支持以下格式:

  1. JS脚本返回的JSON结果 (最可靠):

    {"success": true, "deletedCount": 1490}
  2. 删除完成消息:

    🎉 删除完成!成功删除 1490 条记录
  3. 批次删除累加:

    ✅ 第 1 批删除成功,已删除 1000 条记录
    ✅ 第 2 批删除成功,已删除 490 条记录

错误处理

当Webhook执行失败时,节点会返回详细的错误信息:

{
  "success": false,
  "totalWebhooks": 1,
  "successfulWebhooks": 0,
  "failedWebhooks": 1,
  "message": "All 1 webhook(s) failed",
  "details": [
    {
      "webhookName": "主Webhook",
      "webhookUrl": "https://www.kdocs.cn/api/v3/ide/file/xxx/script/xxx/sync_task",
      "success": false,
      "message": "Delete operation failed",
      "responseTime": 356,
      "error": "Request failed with status code 401 - Authentication failed, check WPS Token"
    }
  ]
}

常见错误:

  • 401/403: 认证失败,检查WPS Token是否正确
  • Timeout: 请求超时,可以增加timeout配置
  • Connection error: 网络连接失败,检查URL是否可访问

与Python版本的对应关系

此N8N插件实现了Python脚本 删除_多维表_淘宝月报.py 的核心功能:

| Python功能 | N8N插件功能 | |-----------|-----------| | WPSDeleteExecutor 类 | WpsDataDelete 节点 | | execute_delete() 方法 | performDelete() 函数 | | _parse_deleted_count() | parseDeletedCountFromLogs() 函数 | | 错误重试机制 | 多Webhook配置 + 执行模式 | | 请求ID追踪 | 自动生成Request ID | | 详细日志记录 | N8N Logger集成 |

开发

构建插件

npm run build

发布到NPM

npm publish

许可证

MIT

作者

hebing