8
n8n 中文网amn8n.com

YNAB资产价值子工作流

高级

这是一个Personal Productivity, Multimodal AI领域的自动化工作流,包含 17 个节点。主要使用 If, Set, Crypto, Discord, HttpRequest 等节点。 使用Rentcast.io和Discord提醒在YNAB中自动化房地产价值更新

前置要求
  • Discord Bot Token 或 Webhook
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "d3bI8kfQ6uKjfER3",
  "meta": {
    "instanceId": "ae3a7d69e340d9eec0196c03fd00e81b6e376d3084103c5850dd2cee1ac033f6"
  },
  "name": "YNAB 资产价值子工作流",
  "tags": [],
  "nodes": [
    {
      "id": "d46c4d7e-10ff-498c-a009-9f684bd895f4",
      "name": "无操作,不执行任何操作",
      "type": "n8n-nodes-base.noOp",
      "position": [
        1344,
        144
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "e6ee1747-c27b-4cfc-94fd-4e3aa9daea9d",
      "name": "编辑字段",
      "type": "n8n-nodes-base.set",
      "position": [
        224,
        48
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "288b3077-cf0f-4e97-b8ee-460cbd788e54",
              "name": "rentcast_api",
              "type": "string",
              "value": "={{ $json.rentcast_api }}"
            },
            {
              "id": "18b6218a-822d-4458-9cfd-abd3e9682139",
              "name": "ynab_api",
              "type": "string",
              "value": "={{ $json.ynab_api }}"
            },
            {
              "id": "18f5b320-426b-4d62-97e4-dbfc2b9698be",
              "name": "address",
              "type": "string",
              "value": "={{ $json.address }}"
            },
            {
              "id": "87861b17-9350-4c75-aea1-e802a4801dbe",
              "name": "propertyType",
              "type": "string",
              "value": "={{ $json.propertyType }}"
            },
            {
              "id": "c0e713a4-aad3-4d6f-b757-232ee6e148bd",
              "name": "bedrooms",
              "type": "number",
              "value": "={{ $json.bedrooms }}"
            },
            {
              "id": "96902f6b-ba5a-45af-9ccc-a354e915bf52",
              "name": "bathrooms",
              "type": "number",
              "value": "={{ $json.bathrooms }}"
            },
            {
              "id": "9e0e7ad0-1eac-47cf-a9c4-77d9abb55d88",
              "name": "squareFootage",
              "type": "number",
              "value": "={{ $json.squareFootage }}"
            },
            {
              "id": "6a079c8e-e3f2-455c-8749-d5f0634ea2c5",
              "name": "ynab_budget",
              "type": "string",
              "value": "={{ $json.ynab_budget }}"
            },
            {
              "id": "c4bce4a9-816f-4c72-a1d3-84181a2c1c63",
              "name": "ynab_account",
              "type": "string",
              "value": "={{ $json.ynab_account }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "73000abb-1a23-4f86-a091-d47973c40710",
      "name": "YNAB 资产价值",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        672,
        48
      ],
      "parameters": {
        "url": "=https://api.ynab.com/v1/budgets/{{$('Edit Fields').item.json.ynab_budget}}/accounts/{{$('Edit Fields').item.json.ynab_account}}",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "accept",
              "value": "application/json"
            },
            {
              "name": "Authorization",
              "value": "=Bearer {{ $('Edit Fields').item.json.ynab_api }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "f36fdf71-cc82-4c9f-a3e4-2201a34a40a6",
      "name": "获取价值",
      "type": "n8n-nodes-base.set",
      "position": [
        896,
        48
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "ce68c03d-a486-4fb1-a688-5b4b92b79b14",
              "name": "data.account.balance",
              "type": "number",
              "value": "={{ $json.data.account.balance /1000}}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "8cd50113-3a53-43fa-a0a9-d381d49d7ad0",
      "name": "条件判断",
      "type": "n8n-nodes-base.if",
      "position": [
        1120,
        48
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "1c3b354c-9fc2-4468-8130-1c14bc674645",
              "operator": {
                "type": "number",
                "operation": "notEquals"
              },
              "leftValue": "={{ Math.round(($('Get Property Value').item.json.price * 1000) - $('Get Value').item.json.data.account.balance * 1000) }}",
              "rightValue": 0
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "e81cd156-355e-4add-8f1c-783f2910b87a",
      "name": "获取资产价值",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        448,
        48
      ],
      "parameters": {
        "url": "=https://api.rentcast.io/v1/avm/value?address={{encodeURIComponent($json.address)}}&propertyType={{encodeURIComponent($json.propertyType)}}&bedrooms={{$json.bedrooms}}&bathrooms={{$json.bathrooms}}&squareFootage={{$json.squareFootage}}&compCount=5",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "X-Api-Key",
              "value": "={{ $json.rentcast_api }}"
            },
            {
              "name": "accept",
              "value": "application/json"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "a5d5449c-be98-4f57-81d8-23c625fcf9aa",
      "name": "HTTP 请求",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1568,
        -48
      ],
      "parameters": {
        "url": "=https://api.ynab.com/v1/budgets/{{ $('Edit Fields').item.json.ynab_budget }}/transactions",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"transaction\": {\n    \"account_id\": \"{{ $('Edit Fields').item.json.ynab_account }}\",\n    \"date\": \"{{$today.format('yyyy-MM-dd')}}\",\n    \"amount\": {{ Math.round(($('Get Property Value').item.json.price * 1000) - $('Get Value').item.json.data.account.balance * 1000) }},\n    \"payee_name\": \"n8n\",\n    \"memo\": \"n8n adjustment from rentcast.io\",\n    \"cleared\": \"reconciled\",\n    \"approved\": true,\n    \"flag_color\": \"yellow\",\n    \"subtransactions\": [],\n    \"import_id\": \"{{ $json.data }}\"\n  }\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "accept",
              "value": "application/json"
            },
            {
              "name": "Authorization",
              "value": "=Bearer {{ $('Edit Fields').item.json.ynab_api }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "639257f6-0f8e-4306-bdeb-32f7d1bf4536",
      "name": "加密货币",
      "type": "n8n-nodes-base.crypto",
      "position": [
        1344,
        -48
      ],
      "parameters": {
        "action": "generate"
      },
      "typeVersion": 1
    },
    {
      "id": "d1740d6a-2c15-4bfc-9ccd-37ab0834a707",
      "name": "开始",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        16,
        48
      ],
      "parameters": {
        "workflowInputs": {
          "values": [
            {
              "name": "rentcast_api"
            },
            {
              "name": "ynab_api"
            },
            {
              "name": "address"
            },
            {
              "name": "propertyType"
            },
            {
              "name": "bedrooms",
              "type": "number"
            },
            {
              "name": "squareFootage",
              "type": "number"
            },
            {
              "name": "ynab_budget"
            },
            {
              "name": "ynab_account"
            },
            {
              "name": "bathrooms",
              "type": "number"
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "b12c0b5d-21a5-450c-907e-111d0ed59cfb",
      "name": "Discord 无变化",
      "type": "n8n-nodes-base.discord",
      "position": [
        1568,
        144
      ],
      "webhookId": "2dbc856f-8ac7-46ee-92df-46157dd4ed35",
      "parameters": {
        "content": "=No change in property value\nAddress: {{ $('Edit Fields').item.json.address }}\nValue: {{ '$' + ($('Get Value').item.json.data.account.balance).toLocaleString('en-US') }}",
        "options": {
          "username": "n8n Equity Watcher",
          "avatar_url": "https://www.iconsdb.com/icons/download/navy-blue/house-64.png"
        },
        "authentication": "webhook"
      },
      "credentials": {
        "discordWebhookApi": {
          "id": "jtusjd0AfNR35Ocl",
          "name": "Discord Webhook Budget Items"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "8d434762-5406-45a4-bdab-111f5e63d9c5",
      "name": "Discord 已变更",
      "type": "n8n-nodes-base.discord",
      "position": [
        1824,
        -48
      ],
      "webhookId": "2dbc856f-8ac7-46ee-92df-46157dd4ed35",
      "parameters": {
        "content": "=💵 Property Value Changed \nAddresss: {{ $('Edit Fields').item.json.address }}\nValue: {{ '$' + ($('Get Property Value').item.json.price).toLocaleString('en-US') }}\n\n",
        "options": {
          "username": "n8n Equity Watcher",
          "avatar_url": "https://www.iconsdb.com/icons/download/navy-blue/house-64.png"
        },
        "authentication": "webhook"
      },
      "credentials": {
        "discordWebhookApi": {
          "id": "jtusjd0AfNR35Ocl",
          "name": "Discord Webhook Budget Items"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "9d58ca53-e05e-4cae-ad81-c6198cb15834",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -64,
        -240
      ],
      "parameters": {
        "width": 2064,
        "height": 688,
        "content": "## YNAB 资产价值"
      },
      "typeVersion": 1
    },
    {
      "id": "693b592c-0e99-4851-9d03-15a355821e15",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        384,
        -32
      ],
      "parameters": {
        "color": 4,
        "width": 208,
        "height": 256,
        "content": "### rentago.io API 获取"
      },
      "typeVersion": 1
    },
    {
      "id": "8ddbddb4-009f-4886-bd1d-c1571e25c186",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1056,
        -32
      ],
      "parameters": {
        "color": 4,
        "height": 256,
        "content": "### 如果资产价值变化为 0 美元,则不执行任何操作"
      },
      "typeVersion": 1
    },
    {
      "id": "8e9ef8fb-002a-48ba-94e4-72b58a807ec7",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        624,
        -32
      ],
      "parameters": {
        "color": 4,
        "width": 400,
        "height": 256,
        "content": "### 比较 rentago 资产价值与 YNAB 中的当前资产价值"
      },
      "typeVersion": 1
    },
    {
      "id": "0d4a761c-9789-4af8-b0a1-587434aa311a",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -32,
        -32
      ],
      "parameters": {
        "color": 4,
        "width": 400,
        "height": 256,
        "content": "### 此工作流旨在作为可多次调用的子工作流(每个资产调用一次)"
      },
      "typeVersion": 1
    },
    {
      "id": "88898c45-2502-4cb0-8187-de6d8efc9b5d",
      "name": "便利贴5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1504,
        -128
      ],
      "parameters": {
        "color": 4,
        "height": 256,
        "content": "### 在 YNAB 中创建调整交易"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "dba17b05-6291-482b-8e8c-dcec6454254a",
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Crypto",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Start": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Crypto": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Value": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Get Property Value",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Discord Changed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    " YNAB Asset Value": {
      "main": [
        [
          {
            "node": "Get Value",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Property Value": {
      "main": [
        [
          {
            "node": " YNAB Asset Value",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "No Operation, do nothing": {
      "main": [
        [
          {
            "node": "Discord No Change",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 个人效率, 多模态 AI

需要付费吗?

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

工作流信息
难度等级
高级
节点数量17
分类2
节点类型8
难度说明

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

外部链接
在 n8n.io 查看

分享此工作流