8
n8n 中文网amn8n.com

智能资金管理器

高级

这是一个Finance, AI领域的自动化工作流,包含 50 个节点。主要使用 If, Set, Code, Wait, Merge 等节点,结合人工智能技术实现智能自动化。 基于Telegram、Google Sheets和OpenAI的AI驱动收据和支出追踪器

前置要求
  • Redis 服务器连接信息
  • Telegram Bot Token
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "l7ydpmB41Tz1baF0",
  "meta": {
    "instanceId": "c2650793f644091dc80fb900fe63448ad1f4b774008de9608064d67294f8307c",
    "templateCredsSetupCompleted": true
  },
  "name": "智能资金管理器",
  "tags": [],
  "nodes": [
    {
      "id": "951302cb-527f-480f-8cb7-3b4f2bb9b7f0",
      "name": "转换为 Base64",
      "type": "n8n-nodes-base.code",
      "position": [
        1660,
        200
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "21049da5-f9a0-4587-9725-5d958c05de8c",
      "name": "Google Vision OCR",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1880,
        200
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "38757c15-e984-4029-b805-679219e02006",
      "name": "检查 OCR 结果",
      "type": "n8n-nodes-base.code",
      "position": [
        2100,
        200
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "49e85c47-29bd-4344-afcb-1ef87d2a9861",
      "name": "提取 OCR 文本",
      "type": "n8n-nodes-base.set",
      "position": [
        2320,
        200
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "e59e2779-03b0-496a-8c98-96c16cf13623",
      "name": "☁️ 上传 PDF 到 LlamaIndex",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1660,
        540
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "5719ea7d-eb4e-47d0-bb4f-ee981a0e416f",
      "name": "⏳ 检查解析状态",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1860,
        540
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "11ab2d2d-eb07-4c56-84b2-e40b66f86a13",
      "name": "🔁 条件:解析是否成功?",
      "type": "n8n-nodes-base.if",
      "position": [
        2080,
        540
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "6094e839-18a5-4a9b-b8ed-d903309fd4c7",
      "name": "⏱ 重新检查前延迟",
      "type": "n8n-nodes-base.wait",
      "position": [
        2300,
        660
      ],
      "webhookId": "4f56d89f-3e7a-4b5c-bb9f-24948839bc69",
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "63b6dba7-bce2-47e8-9370-9dafa9c822e8",
      "name": "📥 获取解析后的 Markdown 结果",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2300,
        420
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "7d80a792-da59-4082-9734-3a59e80a0125",
      "name": "OpenAI",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        2300,
        880
      ],
      "parameters": {},
      "typeVersion": 1.8
    },
    {
      "id": "ec1162d2-7e91-4459-8fe7-d099e4cb1e1e",
      "name": "下载 VN",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2080,
        880
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "84f5364b-acac-48f4-9e8b-88e208589498",
      "name": "AI 分类器",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        260,
        1200
      ],
      "parameters": {},
      "retryOnFail": true,
      "typeVersion": 1.7
    },
    {
      "id": "8da9481f-024a-4c37-a5d1-9f6ff0abdb58",
      "name": "OpenRouter聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        300,
        1420
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "d9c34a6c-2bb6-47df-8f6d-1ea840ac9244",
      "name": "结构化输出解析器",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        420,
        1420
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "87b1ca88-3069-48f7-adaf-74cd5a41fc80",
      "name": "合并",
      "type": "n8n-nodes-base.merge",
      "position": [
        2540,
        860
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "7471d089-459c-4515-b500-b39902121572",
      "name": "价格大于 0?",
      "type": "n8n-nodes-base.if",
      "position": [
        1460,
        1560
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "70caa53d-103c-408f-836a-db9d060acca4",
      "name": "检查开始",
      "type": "n8n-nodes-base.if",
      "position": [
        340,
        160
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "1f5c44fa-ed21-437e-a315-fb381d14b5eb",
      "name": "欢迎菜单",
      "type": "n8n-nodes-base.telegram",
      "position": [
        560,
        160
      ],
      "webhookId": "42fc1a76-cef8-43c3-965b-cd973e1e1cf4",
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "22b87e94-d032-48a8-a28e-5823fae5480f",
      "name": "检查收入",
      "type": "n8n-nodes-base.if",
      "position": [
        340,
        360
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "b3b06944-4165-49d9-a398-69d24c104f33",
      "name": "检查支出",
      "type": "n8n-nodes-base.if",
      "position": [
        340,
        560
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "c6ddeae1-bb24-412c-96fc-5313eda34f26",
      "name": "保存收入到 Redis",
      "type": "n8n-nodes-base.redis",
      "position": [
        560,
        360
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "4d2c3576-94e2-47c9-963e-18bb22f97368",
      "name": "保存支出到 Redis",
      "type": "n8n-nodes-base.redis",
      "position": [
        560,
        560
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "ff8b9d8f-3c53-4873-add9-e09eb59f518b",
      "name": "检查输入",
      "type": "n8n-nodes-base.if",
      "position": [
        340,
        760
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "fb2f2c73-7c9b-42e9-8801-355fb711f2ae",
      "name": "内容类型路由器",
      "type": "n8n-nodes-base.switch",
      "position": [
        1000,
        740
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "cb4b7d9a-deea-412e-affc-a85a5734e12f",
      "name": "Telegram触发器",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        120,
        460
      ],
      "webhookId": "ce5bc5f7-01b4-437b-a8a1-0adcbf606062",
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "a053a6e1-74eb-4adf-a94b-46b4aebe7ba1",
      "name": "请求收入",
      "type": "n8n-nodes-base.telegram",
      "position": [
        780,
        360
      ],
      "webhookId": "49363187-4d3b-4a14-975b-e27c1684c0cc",
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "da9096d1-de27-4227-8141-697ab6946deb",
      "name": "获取交易类型",
      "type": "n8n-nodes-base.redis",
      "position": [
        560,
        760
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "ee825901-0cb1-4716-a40b-b21d42600215",
      "name": "提取交易类型",
      "type": "n8n-nodes-base.set",
      "position": [
        780,
        760
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "632200e9-e6ec-49ad-b321-1d945130c9fa",
      "name": "获取 Vn",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1860,
        880
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "a2c85f3d-5692-4901-8cc5-f99a17af52a7",
      "name": "📥 从 Telegram 下载 PDF",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1460,
        540
      ],
      "webhookId": "83a5bdcb-6461-4f53-82c2-d606bc5f4b9d",
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "7f7c5770-061c-4539-9177-8d924d04feb1",
      "name": "提取文本输入",
      "type": "n8n-nodes-base.set",
      "position": [
        2300,
        1080
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "c1d5be1e-4991-4390-8cd5-1bf2cd90c4b0",
      "name": "检查价格",
      "type": "n8n-nodes-base.set",
      "position": [
        1240,
        1500
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "3fe0b043-e125-47de-ae39-e56acae5b525",
      "name": "发送错误",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1700,
        1680
      ],
      "webhookId": "786f4b9e-8362-4f45-9c60-2635c2339378",
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "fb984f86-ed06-4721-9298-f9e15d070010",
      "name": "延迟",
      "type": "n8n-nodes-base.wait",
      "position": [
        1040,
        1200
      ],
      "webhookId": "80be2e06-a312-4577-85ce-2c4a61a6d177",
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "19dc3e08-be3c-4021-8df3-fcde585344cb",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        80
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "eae0aa84-dfba-4cac-a1bd-ba3a4b0536de",
      "name": "便签 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1200,
        80
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "a9384ce4-00aa-49dc-83ba-cc85aa2e28c0",
      "name": "便签 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -20,
        980
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "ddf6a17b-569e-4415-820d-9a45a0d0cf10",
      "name": "支出?",
      "type": "n8n-nodes-base.if",
      "position": [
        1700,
        1500
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "62a24023-4d2f-41dd-8b14-eec66294120b",
      "name": "发送收入摘要",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1920,
        1600
      ],
      "webhookId": "4210c574-0426-4feb-9ac2-bd035615bfb0",
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "bcc98628-fcab-41a7-b28d-1789b8ea048f",
      "name": "便签 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1200,
        1280
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "11ca6091-c7e5-4cae-a5c8-858080b0ca9a",
      "name": "转换为表格格式",
      "type": "n8n-nodes-base.code",
      "position": [
        820,
        1200
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "c206db06-d52e-4411-807a-74804bb5f69e",
      "name": "发送支出摘要",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1920,
        1400
      ],
      "webhookId": "41be3e71-6ce9-46a9-a0f3-fc1fcd6f7c8c",
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "4acb3a06-886e-4a6f-a8c5-0d3da4444d4d",
      "name": "便签 4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2080,
        1280
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "964f1b9d-f50f-4973-b784-80fc70f5f589",
      "name": "追加支出",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2220,
        1400
      ],
      "parameters": {},
      "typeVersion": 4.6
    },
    {
      "id": "2560f1d0-340c-423a-b2ba-8516ca7f175e",
      "name": "追加收入",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2220,
        1600
      ],
      "parameters": {},
      "typeVersion": 4.6
    },
    {
      "id": "0e4f95b7-3ff4-48fc-8b3f-415478755cfa",
      "name": "请求支出",
      "type": "n8n-nodes-base.telegram",
      "position": [
        780,
        560
      ],
      "webhookId": "0fcc7526-675a-4e57-bcd7-32c51cf381b2",
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "2b181326-5ddb-4c88-a5fa-a109e0b110ca",
      "name": "输入接受",
      "type": "n8n-nodes-base.telegram",
      "position": [
        40,
        1200
      ],
      "webhookId": "993d09a2-8b14-44ac-966c-bfca908480f6",
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "1b9e0241-ec84-4325-9232-7b2acb6154e8",
      "name": "提取 AI 结果",
      "type": "n8n-nodes-base.telegram",
      "position": [
        600,
        1200
      ],
      "webhookId": "2ed6ac4f-036f-4c93-addb-1ccd9ec27d20",
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "3b4db463-29d6-4b93-a7b8-5cef16b42eb9",
      "name": "下载图像",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1260,
        200
      ],
      "webhookId": "0f09a7a3-21c9-4a5b-a5c1-c3a506424f14",
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "e3ee9235-c42a-4ec6-9c97-6a25f35c1c56",
      "name": "通知 PDF",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1240,
        540
      ],
      "webhookId": "a7909325-83cb-4de8-9eb0-8aeddab66ff0",
      "parameters": {},
      "typeVersion": 1.2
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "6636c119-2d2d-40b1-ba59-5fdc9f7b73ea",
  "connections": {
    "Delay": {
      "main": [
        [
          {
            "node": "check price",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "Input Accept",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Ambil Vn": {
      "main": [
        [
          {
            "node": "Download VN",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Expenses?": {
      "main": [
        [
          {
            "node": "Send Expense Summary",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Income Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notify PDf": {
      "main": [
        [
          {
            "node": "📥 Download PDF from Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Input": {
      "main": [
        [
          {
            "node": "Get Transaction Type",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Start": {
      "main": [
        [
          {
            "node": "Welcome Menu",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download VN": {
      "main": [
        [
          {
            "node": "OpenAI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "check price": {
      "main": [
        [
          {
            "node": "price greater than 0?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Income": {
      "main": [
        [
          {
            "node": "Save Income to Redis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Input Accept": {
      "main": [
        [
          {
            "node": "AI Categorizer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Welcome Menu": {
      "main": [
        []
      ]
    },
    "AI Categorizer": {
      "main": [
        [
          {
            "node": "Extract AI Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Expenses": {
      "main": [
        [
          {
            "node": "Save Expenses to Redis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Image": {
      "main": [
        [
          {
            "node": "Convert to Base64",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check OCR Result": {
      "main": [
        [
          {
            "node": "Extract OCR Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract OCR Text": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Check Start",
            "type": "main",
            "index": 0
          },
          {
            "node": "Check Income",
            "type": "main",
            "index": 0
          },
          {
            "node": "Check Expenses",
            "type": "main",
            "index": 0
          },
          {
            "node": "Check Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to Base64": {
      "main": [
        [
          {
            "node": "Google Vision OCR",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract AI Result": {
      "main": [
        [
          {
            "node": "Transform to Sheets Format",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Vision OCR": {
      "main": [
        [
          {
            "node": "Check OCR Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Text Input": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Content Type Router": {
      "main": [
        [
          {
            "node": "Download Image",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Notify PDf",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Ambil Vn",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Extract Text Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Income Summary": {
      "main": [
        [
          {
            "node": "Append Income",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Transaction Type": {
      "main": [
        [
          {
            "node": "Extract Transaction Type",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Income to Redis": {
      "main": [
        [
          {
            "node": "Request Pemasukan",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Expense Summary": {
      "main": [
        [
          {
            "node": "Append Expenses",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Categorizer",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "price greater than 0?": {
      "main": [
        [
          {
            "node": "Expenses?",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Expenses to Redis": {
      "main": [
        [
          {
            "node": "Request expense",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Transaction Type": {
      "main": [
        [
          {
            "node": "Content Type Router",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "AI Categorizer",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "⏳ Check Parsing Status": {
      "main": [
        [
          {
            "node": "🔁 Condition: Was Parsing Successful?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    " ⏱ Delay Before Recheck": {
      "main": [
        [
          {
            "node": "⏳ Check Parsing Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transform to Sheets Format": {
      "main": [
        [
          {
            "node": "Delay",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "☁️ Upload PDF to LlamaIndex": {
      "main": [
        [
          {
            "node": "⏳ Check Parsing Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📥 Download PDF from Telegram": {
      "main": [
        [
          {
            "node": "☁️ Upload PDF to LlamaIndex",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    " 📥 Get Parsed Markdown Result": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "🔁 Condition: Was Parsing Successful?": {
      "main": [
        [
          {
            "node": " 📥 Get Parsed Markdown Result",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": " ⏱ Delay Before Recheck",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 财务, 人工智能

需要付费吗?

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

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

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

外部链接
在 n8n.io 查看

分享此工作流