8
n8n 中文网amn8n.com

Porkbun - 域名狙击

中级

这是一个Miscellaneous领域的自动化工作流,包含 12 个节点。主要使用 If, Wait, Gmail, Discord, HttpRequest 等节点。 使用 Porkbun、Google Sheets 和多渠道警报的域名可用性监控器

前置要求
  • Google 账号和 Gmail API 凭证
  • Discord Bot Token 或 Webhook
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证

分类

工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "5tH7j1qgEdAjLj3c",
  "meta": {
    "instanceId": "c2650793f644091dc80fb900fe63448ad1f4b774008de9608064d67294f8307c",
    "templateCredsSetupCompleted": true
  },
  "name": "Porkbun - 域名狙击",
  "tags": [],
  "nodes": [
    {
      "id": "f98a0e2d-6d9c-43a4-af6a-1b8f0810ec93",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -320,
        32
      ],
      "parameters": {
        "color": 5,
        "width": 384,
        "height": 256,
        "content": "## 🔑 获取 Porkbun API 密钥"
      },
      "typeVersion": 1
    },
    {
      "id": "e4cc9476-dcf5-4d93-a412-2ec13e021ba8",
      "name": "验证 API 密钥",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        224,
        128
      ],
      "parameters": {
        "url": "https://api.porkbun.com/api/json/v3/ping",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "form-urlencoded",
        "bodyParameters": {
          "parameters": [
            {
              "name": "secretapikey",
              "value": "YOUR_SECRET_KEY"
            },
            {
              "name": "apikey",
              "value": "YOUR_API_KEY"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "34f0f98d-744d-464e-b6a2-d9c35c6dac13",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        96,
        32
      ],
      "parameters": {
        "color": 5,
        "width": 368,
        "height": 256,
        "content": "## 验证 API 密钥"
      },
      "typeVersion": 1
    },
    {
      "id": "8103735c-87ae-48ca-9ea7-32a582d66f8e",
      "name": "处理每个域名",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -96,
        336
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "f1cfa28a-9d14-4cba-bf8b-2188e8b18d64",
      "name": "检查域名可用性",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        128,
        352
      ],
      "parameters": {
        "url": "=https://api.porkbun.com/api/json/v3/domain/checkDomain/{{ $json.Domain }}",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "secretapikey",
              "value": "YOUR_SECRET_API_KEY"
            },
            {
              "name": "apikey",
              "value": "YOUR_API_KEY"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "0880d223-d615-4cd7-a0b9-2e2af950ccdb",
      "name": "域名可用?",
      "type": "n8n-nodes-base.if",
      "position": [
        352,
        352
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 1,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "ca3aff64-ad43-40df-b210-3ba09050a716",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.response.avail }}",
              "rightValue": "yes"
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "011c8281-7d71-4fa6-991a-9bab1b4fb69c",
      "name": "发送邮件提醒",
      "type": "n8n-nodes-base.gmail",
      "position": [
        576,
        240
      ],
      "webhookId": "a7833e40-e12f-4207-9283-f2cab1aff343",
      "parameters": {
        "sendTo": "YOUR_EMAIL@example.com",
        "message": "=<div style=\"font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; max-width: 600px; margin: 0 auto; background-color: #ffffff; color: #1a1a1a;\">\n  \n  <!-- Header -->\n  <div style=\"background: linear-gradient(135deg, #10b981 0%, #059669 100%); padding: 40px 30px; text-align: center;\">\n    <div style=\"background-color: rgba(255, 255, 255, 0.2); display: inline-block; padding: 6px 16px; border-radius: 20px; margin-bottom: 16px;\">\n      <span style=\"color: #ffffff; font-size: 11px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase;\">Domain Alert</span>\n    </div>\n    <h1 style=\"margin: 0; color: #ffffff; font-size: 32px; font-weight: 700; line-height: 1.3;\">Domain Available</h1>\n    <p style=\"margin: 12px 0 0 0; color: rgba(255, 255, 255, 0.95); font-size: 15px; font-weight: 400;\">Your monitored domain is ready to register</p>\n  </div>\n\n  <!-- Main Content -->\n  <div style=\"padding: 32px 24px;\">\n    \n    <!-- Domain Card -->\n    <div style=\"background-color: #f8fffe; border: 2px solid #10b981; border-radius: 12px; padding: 24px; margin-bottom: 24px;\">\n      <div style=\"margin-bottom: 8px;\">\n        <span style=\"background-color: #10b981; color: #ffffff; font-size: 10px; text-transform: uppercase; letter-spacing: 1.2px; font-weight: 700; padding: 4px 10px; border-radius: 4px;\">AVAILABLE</span>\n      </div>\n      <h2 style=\"margin: 12px 0 0 0; color: #0a0a0a; font-size: 26px; font-weight: 700; word-break: break-all; line-height: 1.4;\">{{ $('Process Each Domain').item.json.Domain }}</h2>\n    </div>\n\n    <!-- Pricing Section -->\n    <div style=\"background-color: #fafafa; border-radius: 12px; padding: 24px; margin-bottom: 24px; border: 1px solid #e5e5e5;\">\n      <h3 style=\"color: #0a0a0a; margin: 0 0 20px 0; font-size: 16px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;\">💰 Pricing Details</h3>\n      \n      <!-- Registration Price -->\n      <div style=\"display: flex; justify-content: space-between; align-items: center; padding: 16px 0; border-bottom: 1px solid #e5e5e5;\">\n        <span style=\"color: #525252; font-size: 15px; font-weight: 500;\">Registration: </span>\n        <span style=\"color: #10b981; font-size: 26px; font-weight: 700;\">${{ $json.response.price }}</span>\n      </div>\n      <!-- Premium Badge -->\n      {{ $json.response.premium === 'yes' ? '<div style=\"background-color: #fef3c7; border-left: 4px solid #f59e0b; padding: 12px 16px; margin: 16px 0; border-radius: 6px;\"><span style=\"color: #92400e; font-size: 13px; font-weight: 600;\">⭐ This is a Premium Domain</span></div>' : '' }}\n      \n      <!-- Renewal Price -->\n      <div style=\"display: flex; justify-content: space-between; align-items: center; padding: 16px 0; border-bottom: 1px solid #e5e5e5;\">\n        <span style=\"color: #525252; font-size: 15px; font-weight: 500;\">Annual Renewal:</span>\n        <span style=\"color: #0a0a0a; font-size: 17px; font-weight: 600;\"> ${{ $json.response.additional.renewal.price }}<span style=\"color: #737373; font-size: 14px; font-weight: 400;\">/year</span></span>\n      </div>\n      \n      <!-- Transfer Fee -->\n      <div style=\"display: flex; justify-content: space-between; align-items: center; padding: 16px 0 0 0;\">\n        <span style=\"color: #525252; font-size: 15px; font-weight: 500;\">Transfer Fee:</span>\n        <span style=\"color: #0a0a0a; font-size: 17px; font-weight: 600;\"> ${{ $json.response.additional.transfer.price }}</span>\n      </div>\n    </div>\n\n    <!-- CTA Button -->\n    <div style=\"text-align: center; margin: 32px 0;\">\n      <a href=\"https://porkbun.com/checkout/search?q={{ $('Process Each Domain').item.json.Domain }}\" \n         style=\"display: inline-block; background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: #ffffff; padding: 16px 48px; text-decoration: none; border-radius: 8px; font-weight: 600; font-size: 16px; box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3); letter-spacing: 0.3px;\">\n        Register Domain Now →\n      </a>\n    </div>\n\n    <!-- Warning Box -->\n    <div style=\"background-color: #fffbeb; border-left: 4px solid #f59e0b; padding: 16px 20px; border-radius: 8px; margin-top: 24px;\">\n      <p style=\"margin: 0; color: #78350f; font-size: 14px; line-height: 1.6; font-weight: 500;\">\n        ⚡ <strong style=\"font-weight: 700;\">Time-Sensitive Alert:</strong> This domain can be registered by anyone at any moment. Secure it now to avoid losing this opportunity.\n      </p>\n    </div>\n\n  </div>\n\n  <!-- Footer -->\n  <div style=\"background-color: #fafafa; padding: 28px 24px; text-align: center; border-top: 1px solid #e5e5e5;\">\n    <p style=\"margin: 0 0 6px 0; color: #737373; font-size: 13px; font-weight: 500;\">Last Checked: {{ $now.format('DD HH:mm:ss') }}</p>\n    <p style=\"margin: 0 0 16px 0; color: #a3a3a3; font-size: 12px;\">Automated by <strong style=\"color: #525252; font-weight: 600;\">Domain Sniper Workflow</strong></p>\n  </div>\n\n</div>\n",
        "options": {
          "appendAttribution": false
        },
        "subject": "=Sniper Report! {{ $('Process Each Domain').item.json.Domain }} is Available "
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "XeLaofMkprEVVUZr",
          "name": "notif-khmuhtadin"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "30b76949-d14a-4aaf-a0cc-2c30d081a860",
      "name": "发送 Discord 通知",
      "type": "n8n-nodes-base.discord",
      "position": [
        800,
        240
      ],
      "webhookId": "25439919-27ce-432e-824c-8764c1ae9985",
      "parameters": {
        "content": "={{ $('Process Each Domain').item.json.Domain }} is available to buy!\n\nPrice: ${{ $('Domain Available?').item.json.response.price }}\nFirst year Promo: {{ $('Domain Available?').item.json.response.firstYearPromo }}\nPremium domain?: {{ $('Domain Available?').item.json.response.premium }}\n\nRenewal Price: ${{ $('Domain Available?').item.json.response.additional.renewal.price }}\nTransfer Price: ${{ $('Domain Available?').item.json.response.additional.transfer.price }}",
        "guildId": {
          "__rl": true,
          "mode": "list",
          "value": "924339263372406844",
          "cachedResultUrl": "https://discord.com/channels/924339263372406844",
          "cachedResultName": "Khaisa Studio"
        },
        "options": {},
        "resource": "message",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_CHANNEL_ID"
        }
      },
      "credentials": {
        "discordBotApi": {
          "id": "dJMKbc7ZDni2mvkT",
          "name": "Khaisa-n8n-bot"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "feabe4fe-c186-4dab-b0c5-cbae8ceb0190",
      "name": "更新表格:标记为可用",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1024,
        240
      ],
      "parameters": {
        "columns": {
          "value": {
            "Domain": "={{ $('Process Each Domain').item.json.Domain }}",
            "isAvailable": "yes"
          },
          "schema": [
            {
              "id": "Domain",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Domain",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "isAvailable",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "isAvailable",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Domain"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_GOOGLE_SHEET_ID"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "gnUSHhCw4cKx3pwo",
          "name": "Project GCP: n8n-khmuhtadin"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "cbec7b90-5b85-4ab9-b965-489714cdb3e1",
      "name": "等待 10 秒",
      "type": "n8n-nodes-base.wait",
      "position": [
        1232,
        368
      ],
      "webhookId": "22fa0299-fc8c-4d64-8775-4369f07bbf89",
      "parameters": {
        "amount": 10
      },
      "typeVersion": 1.1
    },
    {
      "id": "0aed6a8b-a8a7-40c6-9896-be0c0b370e2a",
      "name": "每 30 分钟检查一次",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -544,
        336
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes",
              "minutesInterval": 30
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "9cc90317-799b-4da8-9077-a04d13c6c269",
      "name": "从表格获取域名",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -320,
        336
      ],
      "parameters": {
        "options": {},
        "filtersUI": {
          "values": [
            {
              "lookupValue": "no",
              "lookupColumn": "isAvailable"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_GOOGLE_SHEET_ID"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "gnUSHhCw4cKx3pwo",
          "name": "Project GCP: n8n-khmuhtadin"
        }
      },
      "typeVersion": 4.7
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "9c418b49-8957-4059-9656-e6a474c4e377",
  "connections": {
    "Wait 10 Seconds": {
      "main": [
        [
          {
            "node": "Process Each Domain",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Email Alert": {
      "main": [
        [
          {
            "node": "Send Discord Notification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Domain Available?": {
      "main": [
        [
          {
            "node": "Send Email Alert",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait 10 Seconds",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process Each Domain": {
      "main": [
        [],
        [
          {
            "node": "Check Domain Availability",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check every 30 Minutes": {
      "main": [
        [
          {
            "node": "Get Domains from Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Domains from Sheet": {
      "main": [
        [
          {
            "node": "Process Each Domain",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Domain Availability": {
      "main": [
        [
          {
            "node": "Domain Available?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Discord Notification": {
      "main": [
        [
          {
            "node": "Update Sheet: Mark Available",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Sheet: Mark Available": {
      "main": [
        [
          {
            "node": "Wait 10 Seconds",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 杂项

需要付费吗?

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

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

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

外部链接
在 n8n.io 查看

分享此工作流