8
n8n 中文网amn8n.com

通过Telegram在Google表格中自动化收支跟踪

高级

这是一个Personal Productivity领域的自动化工作流,包含 31 个节点。主要使用 Code, Switch, Telegram, GoogleSheets, TelegramTrigger 等节点。 通过Telegram在Google表格中自动化收支跟踪

前置要求
  • Telegram Bot Token
  • Google Sheets API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "ba73835d772fb31a8c93dbcda773c1ef34e21227b9c152c1ee6fdf0eab995f28",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "326fd72f-6856-47f8-a033-7adbb2eea738",
      "name": "Telegram - 传入 Webhook",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -100,
        200
      ],
      "webhookId": "d38ec46a-5c4e-48af-a415-400392021f4c",
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "f8d79eab-fbcd-46e2-822d-b64f6cdf2343",
      "name": "检测消息类型",
      "type": "n8n-nodes-base.code",
      "position": [
        80,
        200
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "cd68fd6e-653a-4cd1-92a4-ebcc7821c36e",
      "name": "按输入类型路由",
      "type": "n8n-nodes-base.switch",
      "position": [
        260,
        200
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "4e054ecd-82dc-4e39-97f1-5bc2eb3e2e40",
      "name": "处理 /start 或消息输入",
      "type": "n8n-nodes-base.switch",
      "position": [
        480,
        0
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "35faafd8-42c9-44cb-8612-deaa5270f186",
      "name": "显示收入/支出选项",
      "type": "n8n-nodes-base.telegram",
      "position": [
        700,
        -160
      ],
      "webhookId": "34ce0d27-2e04-4402-beef-cbfc0b0c2c7f",
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "83d3e6b4-c30c-418b-bc09-53876fd047a3",
      "name": "验证输入格式",
      "type": "n8n-nodes-base.code",
      "position": [
        700,
        20
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "8bfb1fac-30ce-4c3a-b7af-2c8ffe6fb259",
      "name": "提取数据类型",
      "type": "n8n-nodes-base.code",
      "position": [
        940,
        20
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "50185b94-d3ce-4c5b-b88a-eb48712abc1b",
      "name": "基于数据类型路由",
      "type": "n8n-nodes-base.switch",
      "position": [
        1140,
        20
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "dfa8ee96-8dee-4cf6-b14d-58aad6fb2c66",
      "name": "解析收入数据",
      "type": "n8n-nodes-base.code",
      "position": [
        1340,
        -100
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "ba76cb99-365d-4b49-8935-ca44a17662b6",
      "name": "保存收入到表格",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1540,
        -100
      ],
      "parameters": {},
      "typeVersion": 4.5
    },
    {
      "id": "ea50a3b1-40ff-48d3-940c-badc9c474526",
      "name": "通知用户收入已记录",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1740,
        -100
      ],
      "webhookId": "39b21e24-7b4f-4c83-b410-e0824d8f1089",
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "9d8399a5-f689-4589-b5ab-2b5735613a12",
      "name": "解析支出数据",
      "type": "n8n-nodes-base.code",
      "position": [
        1340,
        40
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "73831130-fb6a-4040-8857-b256203b8502",
      "name": "保存支出到表格",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1540,
        40
      ],
      "parameters": {},
      "typeVersion": 4.5
    },
    {
      "id": "fa0c19ae-f044-4533-b885-9ddc26522344",
      "name": "通知用户支出待处理",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1740,
        40
      ],
      "webhookId": "baf321e6-3b8f-4451-aaa3-a2c768635d55",
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "f06a85ad-5f76-485c-94cf-8465aae0ea50",
      "name": "发送审批请求",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1920,
        40
      ],
      "webhookId": "3745c927-de23-40f5-9149-9085fd62c886",
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "4e3b3a12-3b18-4bd2-ac24-25e39e1c171b",
      "name": "解析回调响应",
      "type": "n8n-nodes-base.code",
      "position": [
        480,
        360
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "775e82a0-083b-4d1d-b31c-ce6069572e36",
      "name": "基于回调类型路由",
      "type": "n8n-nodes-base.switch",
      "position": [
        700,
        320
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "45561880-459f-4b5b-97b4-0f0d8185be2d",
      "name": "更新审批状态",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        940,
        220
      ],
      "parameters": {},
      "typeVersion": 4.5
    },
    {
      "id": "a5990c44-03a0-4fe5-b822-be593b352559",
      "name": "获取已批准行",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1140,
        220
      ],
      "parameters": {},
      "typeVersion": 4.5
    },
    {
      "id": "ca1d1ff9-9d0c-44eb-8e64-4c2785692c35",
      "name": "通知用户审批结果",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1340,
        220
      ],
      "webhookId": "8a346a95-d9a8-43e7-9b7e-46efcdfa53c9",
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "e5142ba0-50d8-450a-bbd1-45488cf6c386",
      "name": "获取行以查看详情",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        940,
        420
      ],
      "parameters": {},
      "typeVersion": 4.5
    },
    {
      "id": "fe629ffa-ded8-4e94-bda9-a4206a928e06",
      "name": "格式化支出详情消息",
      "type": "n8n-nodes-base.code",
      "position": [
        1140,
        420
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "fd3f93a9-6664-4821-9a37-8e63bcafdd8d",
      "name": "发送支出详情给主管",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1340,
        420
      ],
      "webhookId": "0c007b17-b53c-4c0d-92e5-f9a7f5a270e5",
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "461f7a4e-035b-4ed9-baa1-cd79586d2e3e",
      "name": "显示收入输入格式",
      "type": "n8n-nodes-base.code",
      "position": [
        940,
        580
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "afbeeb5b-21a3-4a89-b85d-cc85ff6fe19a",
      "name": "显示支出输入格式",
      "type": "n8n-nodes-base.code",
      "position": [
        940,
        740
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "a7efd0d0-363f-4d27-9744-81e3eb9587a5",
      "name": "发送收入格式消息",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1140,
        580
      ],
      "webhookId": "ad996647-1e41-4a81-9e31-001dc890cead",
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "710ecddd-d353-41e7-8749-9a11e5816607",
      "name": "发送支出格式消息",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1140,
        740
      ],
      "webhookId": "6307cfda-748c-47a6-8e6d-1428c69ee157",
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "936e41c7-727c-47db-a093-c0ad14b86f0e",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1460,
        -1000
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "aca473db-b4b3-4b48-8bb8-9f213af8fd0f",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1700,
        100
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "8065e1bb-a036-43dd-8427-1e98d9335339",
      "name": "便签 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1000,
        100
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "75124148-3558-4cba-84fd-eb2dafba86a6",
      "name": "便签 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1460,
        840
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "Get Approved Row": {
      "main": [
        [
          {
            "node": "Notify User of Approval Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Data Type": {
      "main": [
        [
          {
            "node": "Route Based on Data Type",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Income Data": {
      "main": [
        [
          {
            "node": "Save Income to Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Expense Data": {
      "main": [
        [
          {
            "node": "Save Expense to Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Detect Message Type": {
      "main": [
        [
          {
            "node": "Route by Input Type",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route by Input Type": {
      "main": [
        [
          {
            "node": "Handle /start or Message Input",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Parse Callback Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Income to Sheet": {
      "main": [
        [
          {
            "node": "Notify User Income Recorded",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Expense to Sheet": {
      "main": [
        [
          {
            "node": "Notify User Expense Pending",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Approval Request": {
      "main": [
        []
      ]
    },
    "Validate Input Format": {
      "main": [
        [
          {
            "node": "Extract Data Type",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Approval Status": {
      "main": [
        [
          {
            "node": "Get Approved Row",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Row for Detail View": {
      "main": [
        [
          {
            "node": "Format Expense Detail Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Callback Response": {
      "main": [
        [
          {
            "node": "Route Based on Callback Type",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route Based on Data Type": {
      "main": [
        [
          {
            "node": "Parse Income Data",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Parse Expense Data",
            "type": "main",
            "index": 0
          }
        ],
        []
      ]
    },
    "Show Income Input Format": {
      "main": [
        [
          {
            "node": "Send Income Format Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Show Expense Input Format": {
      "main": [
        [
          {
            "node": "Send Expense Format Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notify User Expense Pending": {
      "main": [
        [
          {
            "node": "Send Approval Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram - Incoming Webhook": {
      "main": [
        [
          {
            "node": "Detect Message Type",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route Based on Callback Type": {
      "main": [
        [
          {
            "node": "Update Approval Status",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update Approval Status",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get Row for Detail View",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Show Income Input Format",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Show Expense Input Format",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Expense Detail Message": {
      "main": [
        [
          {
            "node": "Send Expense Detail to Supervisor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Handle /start or Message Input": {
      "main": [
        [
          {
            "node": "Show Income/Expense Options",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Validate Input Format",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 个人效率

需要付费吗?

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

工作流信息
难度等级
高级
节点数量31
分类1
节点类型6
难度说明

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

作者
Fahmi Oktafian

Fahmi Oktafian

@fahmi3322

Hi! I’m Fahmi Oktafian, a developer and automation enthusiast with expertise in n8n, Node.js, and API integrations. I specialize in building smart, scalable workflows — from auto-publishing content to WordPress, sending automated Telegram notifications, to processing AI-based summaries and paraphrase. I’m passionate about helping businesses save time, increase efficiency, and automate their digital processes with clean and user-friendly solutions.

外部链接
在 n8n.io 查看

分享此工作流