8
n8n 中文网amn8n.com

从 Mortgage News Daily 发送每日抵押贷款利率更新到消息平台

中级

这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 10 个节点。主要使用 Code, Discord, HttpRequest, ScheduleTrigger, GoogleGemini 等节点。 从 Mortgage News Daily 发送每日抵押贷款利率更新到消息平台

前置要求
  • Discord Bot Token 或 Webhook
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "105694f414213a0eca348284005921253960bd1b0223294a4970522d0da53055",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "6fc2bb82-168e-4852-a904-525154d50fd8",
      "name": "由 Github 模型提供支持",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        0,
        0
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "30 7,10,12,16,18 * * *"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "e6664669-a580-4a13-8e50-694a4ab5715f",
      "name": "HTTP请求",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        208,
        0
      ],
      "parameters": {
        "url": "https://www.mortgagenewsdaily.com/",
        "options": {},
        "jsonHeaders": "{\n  \"User-Agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36\",\n  \"Accept\": \"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\",\n  \"Accept-Language\": \"en-US,en;q=0.9\",\n  \"Connection\": \"keep-alive\"\n}\n",
        "sendHeaders": true,
        "specifyHeaders": "json"
      },
      "typeVersion": 4.2
    },
    {
      "id": "a93e75cf-80f0-4df0-b74e-fc3fd34a417c",
      "name": "JavaScript 代码",
      "type": "n8n-nodes-base.code",
      "position": [
        416,
        0
      ],
      "parameters": {
        "jsCode": "const html = items[0].json.data || \"\";\n\n// Grab the last updated date\nconst updatedMatch = html.match(/Last Updated:\\s*([\\d/]+)/i);\nconst lastUpdated = updatedMatch ? updatedMatch[1] : \"Unknown\";\n\n// Match all rows in the mortgage table\nconst rowRegex = /<tr[^>]*>(.*?)<\\/tr>/gs;\nconst rows = [...html.matchAll(rowRegex)];\n\nconst rates = [];\n\nfor (const row of rows) {\n  const cells = [...row[1].matchAll(/<td[^>]*>(.*?)<\\/td>/gs)]\n    .map(m => m[1].replace(/<[^>]+>/g, '').trim());\n  if (cells.length === 4) {\n    rates.push({\n      product: cells[0],\n      rate: cells[1],\n      change: cells[2],\n      points: cells[3]\n    });\n  }\n}\n\n// Format into a Discord message\nlet message = `📊 **Daily Mortgage Rates** (Updated: ${lastUpdated})\\n\\n`;\n\nfor (const r of rates) {\n  message += `🏠 ${r.product}: ${r.rate}  (${r.change}, pts: ${r.points})\\n`;\n}\n\nreturn [\n  {\n    json: {\n      content: message\n    }\n  }\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "03ad32b4-a10b-40bb-8c82-df36afc1ece2",
      "name": "Discord",
      "type": "n8n-nodes-base.discord",
      "position": [
        928,
        0
      ],
      "webhookId": "edc34cef-bff7-4bcf-ace5-0e43959cfdf9",
      "parameters": {
        "content": "={{ $('Code in JavaScript').item.json.content }}\n\nCustom Client Messages:\n{{ $json.content.parts[0].text }}",
        "options": {},
        "authentication": "webhook"
      },
      "credentials": {
        "discordWebhookApi": {
          "id": "6S341y8tVCvOIO8r",
          "name": "All Ops Notis Discord Webhook"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "c01f5aea-976b-4ac3-a17f-e8d51887d80d",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -304,
        -64
      ],
      "parameters": {
        "content": "## 1. 每日利率更新"
      },
      "typeVersion": 1
    },
    {
      "id": "553df342-b1b6-45e4-a988-1b76f4f39600",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        16,
        -336
      ],
      "parameters": {
        "height": 240,
        "content": "## 2. 从 Mortgage News Daily 获取抵押贷款利率"
      },
      "typeVersion": 1
    },
    {
      "id": "67b4c32d-5556-455c-8927-63e35430b534",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        320,
        -336
      ],
      "parameters": {
        "height": 240,
        "content": "## 3. 清理数据用于 Discord 消息"
      },
      "typeVersion": 1
    },
    {
      "id": "d487c064-629a-4a52-ba47-622dffcdbc5b",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        912,
        -528
      ],
      "parameters": {
        "height": 432,
        "content": "## 4. 发送清理后的抵押贷款利率和定制消息,供贷款机构或房地产经纪人发送给客户,通过 Discord Webhook 传递"
      },
      "typeVersion": 1
    },
    {
      "id": "d4350624-6bdf-498a-a9b1-d5aa58330890",
      "name": "向模型发送消息",
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "position": [
        624,
        0
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "models/gemini-2.0-flash-lite",
          "cachedResultName": "models/gemini-2.0-flash-lite"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "=Please look at the following mortgage rate updates and generate the viewer a message that can be sent to clients and what this could mean for them. Never include a name or things like client, just say something like hello or hi if needed. Give one formatted for Text, one formatted for email. Only output the messages.  Rates:  {{ $json.content }}"
            }
          ]
        }
      },
      "credentials": {
        "googlePalmApi": {
          "id": "P9VBO1ba0TRNW64A",
          "name": "Google Gemini(PaLM) Api account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "eb8139a3-7345-45c8-b01c-8cfed5003ff5",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        624,
        -448
      ],
      "parameters": {
        "height": 352,
        "content": "## 3. 使用 AI 魔法创建发送给客户的文本/邮件(在 https://aistudio.google.com/api-keys 获取免费 API 密钥)"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Code in JavaScript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Message a model": {
      "main": [
        [
          {
            "node": "Discord",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript": {
      "main": [
        [
          {
            "node": "Message a model",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

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

需要付费吗?

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

工作流信息
难度等级
中级
节点数量10
分类2
节点类型6
难度说明

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

作者
Kaden Reese

Kaden Reese

@kadenreese

I started automating with Python in 2020 and still use it in workflows when needed, but I’ve recently leaned into n8n for client-facing solutions. Lately I’ve focused on real estate automations, though I also build workflows for email, scraping, and other use cases. Currently Building 👇🏻

外部链接
在 n8n.io 查看

分享此工作流