AI驱动的个人财务管理器 - Gemini、Telegram和Google Sheets
高级
这是一个Personal Productivity, Multimodal AI领域的自动化工作流,包含 21 个节点。主要使用 Switch, Telegram, Agent, TelegramTrigger, GoogleSheetsTool 等节点。 基于Gemini、Telegram和Google Sheets的AI驱动个人财务管理器
前置要求
- •Telegram Bot Token
- •Google Sheets API 凭证
- •Google Gemini API Key
使用的节点 (21)
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"id": "wj7JNijmckRCKUAh",
"meta": {
"instanceId": "943057ae9865dd2906869d78fba63cb807e3403d288699c0026d3aaf59867c7a"
},
"tags": [
{
"id": "xwCyk14uVKcJT0wM",
"name": "Template",
"createdAt": "2025-08-07T23:39:28.237Z",
"updatedAt": "2025-08-07T23:39:28.237Z"
}
],
"nodes": [
{
"id": "e0e6a600-c67a-4982-a96f-3d5209eedb1a",
"name": "Switch",
"type": "n8n-nodes-base.switch",
"position": [
-368,
128
],
"parameters": {
"rules": {
"values": [
{
"outputKey": "Text",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "2d5b2f97-1f8f-48d9-8c81-515e77996efe",
"operator": {
"type": "string",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $json.message.text }}",
"rightValue": ""
}
]
},
"renameOutput": true
},
{
"outputKey": "Voice",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "2d880d6b-56c3-4daa-b4ec-3a72d397b41b",
"operator": {
"type": "object",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $json.message.voice }}",
"rightValue": ""
}
]
},
"renameOutput": true
}
]
},
"options": {
"fallbackOutput": "extra"
}
},
"typeVersion": 3.2
},
{
"id": "6aff69e5-f729-4f99-a217-e867c1abc52c",
"name": "获取文件",
"type": "n8n-nodes-base.telegram",
"position": [
-144,
192
],
"webhookId": "e3f61732-60a5-4116-8350-18f853286b1d",
"parameters": {
"fileId": "={{ $('Telegram Bot Trigger').item.json.message.voice.file_id }}",
"resource": "file",
"additionalFields": {}
},
"credentials": {
"telegramApi": {
"id": "1hoyHNMYXmyjV8we",
"name": "Telegram Financeiro VIKTHYR"
}
},
"typeVersion": 1.2
},
{
"id": "360c855d-4af2-4e6e-bd21-49939f7df26d",
"name": "转录录音",
"type": "@n8n/n8n-nodes-langchain.googleGemini",
"position": [
80,
192
],
"parameters": {
"modelId": {
"__rl": true,
"mode": "list",
"value": "models/gemini-2.5-flash",
"cachedResultName": "models/gemini-2.5-flash"
},
"options": {},
"resource": "audio",
"inputType": "binary"
},
"credentials": {
"googlePalmApi": {
"id": "ewxdtWuCEXcMZn91",
"name": "Google Gemini VIKTHYR"
}
},
"typeVersion": 1
},
{
"id": "8da2430d-ce86-4074-93f6-be6b22143a78",
"name": "Google Gemini 聊天模型",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
80,
592
],
"parameters": {
"options": {}
},
"credentials": {
"googlePalmApi": {
"id": "ewxdtWuCEXcMZn91",
"name": "Google Gemini VIKTHYR"
}
},
"typeVersion": 1
},
{
"id": "87162f3e-ed6b-40c8-bf9b-72595646d423",
"name": "计算器",
"type": "@n8n/n8n-nodes-langchain.toolCalculator",
"position": [
400,
592
],
"parameters": {},
"typeVersion": 1
},
{
"id": "68ed3254-0583-48f3-b3d0-2b329d145acd",
"name": "更新注册记录",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
560,
592
],
"parameters": {
"columns": {
"value": {
"id": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('id', ``, 'string') }}",
"data": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('data', ``, 'string') }}",
"tipo": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('tipo', ``, 'string') }}",
"valor": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('valor', ``, 'string') }}",
"categoria": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('categoria', ``, 'string') }}",
"descricao": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('descricao', ``, 'string') }}",
"row_number": 0,
"metodo_pagamento": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('metodo_pagamento', ``, 'string') }}"
},
"schema": [
{
"id": "id",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "id",
"defaultMatch": true,
"canBeUsedToMatch": true
},
{
"id": "tipo",
"type": "string",
"display": true,
"required": false,
"displayName": "tipo",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "valor",
"type": "string",
"display": true,
"required": false,
"displayName": "valor",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "categoria",
"type": "string",
"display": true,
"required": false,
"displayName": "categoria",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "metodo_pagamento",
"type": "string",
"display": true,
"required": false,
"displayName": "metodo_pagamento",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "descricao",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "descricao",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "data",
"type": "string",
"display": true,
"required": false,
"displayName": "data",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "row_number",
"type": "number",
"display": true,
"removed": false,
"readOnly": true,
"required": false,
"displayName": "row_number",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"id"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "update",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1QL6tl99I5vbZj5CyI772RcSN-YARflEasLfYdV1g2I0/edit#gid=0",
"cachedResultName": "Página1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1QL6tl99I5vbZj5CyI772RcSN-YARflEasLfYdV1g2I0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1QL6tl99I5vbZj5CyI772RcSN-YARflEasLfYdV1g2I0/edit?usp=drivesdk",
"cachedResultName": "Controle Financeiro IA"
},
"descriptionType": "manual",
"toolDescription": "Update row in sheet in Google Sheets. Use this tool to update registers in Google Sheets."
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "ZhVoDN9ufnYKR8Jv",
"name": "Google Sheets VIKTHYR"
}
},
"typeVersion": 4.6
},
{
"id": "e7e87104-60bd-4d4f-b124-cda0f1adf040",
"name": "获取所有注册记录",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
704,
592
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1QL6tl99I5vbZj5CyI772RcSN-YARflEasLfYdV1g2I0/edit#gid=0",
"cachedResultName": "Página1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1QL6tl99I5vbZj5CyI772RcSN-YARflEasLfYdV1g2I0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1QL6tl99I5vbZj5CyI772RcSN-YARflEasLfYdV1g2I0/edit?usp=drivesdk",
"cachedResultName": "Controle Financeiro IA"
},
"descriptionType": "manual",
"toolDescription": "Get all row in sheet of Google Sheets. You can use this tool to get all informations."
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "ZhVoDN9ufnYKR8Jv",
"name": "Google Sheets VIKTHYR"
}
},
"typeVersion": 4.6
},
{
"id": "08048f3b-ec34-4f8b-9f8b-741cd3293b49",
"name": "创建新注册记录",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
864,
592
],
"parameters": {
"columns": {
"value": {
"id": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('id', ``, 'string') }}",
"data": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('data', ``, 'string') }}",
"tipo": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('tipo', ``, 'string') }}",
"valor": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('valor', ``, 'string') }}",
"categoria": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('categoria', ``, 'string') }}",
"descricao": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('descricao', ``, 'string') }}",
"metodo_pagamento": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('metodo_pagamento', ``, 'string') }}"
},
"schema": [
{
"id": "id",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "id",
"defaultMatch": true,
"canBeUsedToMatch": true
},
{
"id": "tipo",
"type": "string",
"display": true,
"required": false,
"displayName": "tipo",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "valor",
"type": "string",
"display": true,
"required": false,
"displayName": "valor",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "categoria",
"type": "string",
"display": true,
"required": false,
"displayName": "categoria",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "metodo_pagamento",
"type": "string",
"display": true,
"required": false,
"displayName": "metodo_pagamento",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "descricao",
"type": "string",
"display": true,
"required": false,
"displayName": "descricao",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "data",
"type": "string",
"display": true,
"required": false,
"displayName": "data",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"id"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {
"cellFormat": "RAW"
},
"operation": "append",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1QL6tl99I5vbZj5CyI772RcSN-YARflEasLfYdV1g2I0/edit#gid=0",
"cachedResultName": "Página1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1QL6tl99I5vbZj5CyI772RcSN-YARflEasLfYdV1g2I0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1QL6tl99I5vbZj5CyI772RcSN-YARflEasLfYdV1g2I0/edit?usp=drivesdk",
"cachedResultName": "Controle Financeiro IA"
},
"descriptionType": "manual",
"toolDescription": "Append row in sheet in Google Sheets. You can use this tool to append new registers in the Google Sheets."
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "ZhVoDN9ufnYKR8Jv",
"name": "Google Sheets VIKTHYR"
}
},
"typeVersion": 4.6
},
{
"id": "d520850f-38f0-4203-9d5e-1b9d043bc9a6",
"name": "删除注册记录",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
1024,
592
],
"parameters": {
"operation": "delete",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1QL6tl99I5vbZj5CyI772RcSN-YARflEasLfYdV1g2I0/edit#gid=0",
"cachedResultName": "Página1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1QL6tl99I5vbZj5CyI772RcSN-YARflEasLfYdV1g2I0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1QL6tl99I5vbZj5CyI772RcSN-YARflEasLfYdV1g2I0/edit?usp=drivesdk",
"cachedResultName": "Controle Financeiro IA"
},
"startIndex": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Start_Row_Number', ``, 'number') }}",
"numberToDelete": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Number_of_Rows_to_Delete', ``, 'number') }}",
"descriptionType": "manual",
"toolDescription": "Delete rows from sheet in Google Sheets. You can use this tool to delete registers in Google Sheets."
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "ZhVoDN9ufnYKR8Jv",
"name": "Google Sheets VIKTHYR"
}
},
"typeVersion": 4.6
},
{
"id": "869a5926-5ead-46a8-93d2-78b92e97b42e",
"name": "简单记忆",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
272,
592
],
"parameters": {
"sessionKey": "={{ $('Telegram Bot Trigger').item.json.message.from.id }}",
"sessionIdType": "customKey"
},
"typeVersion": 1.3
},
{
"id": "61709694-d404-4ff4-a0c8-f1f6bebb2385",
"name": "财务助手",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
352,
112
],
"parameters": {
"text": "={{ $json.content?.parts[0].text || $json.message.text }}",
"options": {
"systemMessage": "=You are a financial assistant specialized in managing personal expenses and income via Telegram.\n\n## 🎯 MAIN OBJECTIVE\n\nInterpret user messages on Telegram and manage financial records in a Google Sheets spreadsheet, providing accurate financial analyses and insights, **ALWAYS formatted exclusively in Telegram-valid HTML**.\n\n## 📋 SPREADSHEET STRUCTURE\n\n**Available columns:**\n\n* **`id`**: Unique sequential identifier (auto-incremented)\n* **`tipo`**: \"income\" or \"expense\"\n* **`valor`**: Monetary value (format: 1234.56)\n* **`categoria`**: Classification of the expense/income\n* **`metodo_pagamento`**: Payment method used\n* **`descricao`**: Details about the transaction\n* **`data`**: Transaction date (format: yyyy-MM-dd)\n\n---\n\n## 🚨 CRITICAL OPERATION RULES\n\n### 1. 📊 DATA QUERY\n\n* ✅ **ALWAYS** use `get_all_registers` BEFORE answering any question\n* ❌ **NEVER** rely on conversation memory for financial data\n* ✅ **ALWAYS** base responses on the data returned by the tool\n* ⚠️ If no data is available, request more information from the user\n\n### 2. 📝 TRANSACTION RECORDING\n\n**Mandatory flow:**\n\n1. 🔍 First: `get_all_registers` to check the last ID\n2. ➕ Calculate: `new_id = last_id + 1`\n3. 💾 Create: `create_new_register` with all fields filled\n4. ✅ Confirm: success message formatted in HTML\n\n### 3. 🧠 MESSAGE INTERPRETATION\n\n**Automatically extract:**\n\n* **Type:** `spent, paid, bought` = expense | `received, earned, entered` = income\n* **Value:** Numbers with currency symbols, e.g., R\\$, or numeric values\n* **Category:** Context of the transaction (e.g., \"lunch\" → Food)\n* **Method:** `card, pix, cash, debit, credit`\n* **Date:** If not specified, use current date\n* **Description:** Details provided by the user\n\n### 4. 📂 SUGGESTED CATEGORIES\n\n**🔴 Expenses:** Food, Transportation, Housing, Health, Education, Leisure, Shopping, Services, Others\n\n**🟢 Income:** Salary, Freelance, Investments, Sales, Gift, Others\n\n---\n\n## ⚠️ HTML FORMATTING MANDATORY - TELEGRAM\n\n> **🚨 ABSOLUTE RULE:** ALL responses MUST be written EXCLUSIVELY in Telegram-valid HTML!\n\n### 📝 HTML TAGS SUPPORTED BY TELEGRAM:\n\n* `<b>text</b>` or `<strong>text</strong>` → bold text\n* `<i>text</i>` or `<em>text</em>` → italic text\n* `<u>text</u>` or `<ins>text</ins>` → underlined text\n* `<s>text</s>` or `<strike>text</strike>` or `<del>text</del>` → strikethrough\n* `<code>text</code>` → inline code with monospace font\n* `<pre>code</pre>` → preformatted code block\n* `<a href=\"url\">link</a>` → clickable link\n* `<blockquote>quote</blockquote>` → blockquote\n\n### 🚨 CRITICAL FORMATTING INSTRUCTIONS:\n\n1. **NEVER** use any other formatting syntax\n2. **ALWAYS** write responses in pure HTML\n3. **ALWAYS** use single line breaks to separate sections\n4. **ALWAYS** use the HTML tags listed above\n5. **ALWAYS** set `parse_mode: 'HTML'` in messages\n6. **LIMIT** emojis to a maximum of 3 per message\n7. **ESCAPE** special HTML characters: `<` → `<`, `>` → `>`, `&` → `&`\n\n---\n\n## 📊 TELEGRAM HTML RESPONSE TEMPLATES\n\n### 📝 TEMPLATE: New Record\n\n```\n<b>✅ Transaction Successfully Recorded!</b>\n\n<b>📋 Record Details:</b>\n<b>🆔 ID:</b> <code>{id}</code>\n<b>📊 Type:</b> <code>{tipo}</code>\n<b>💵 Value:</b> <code>R$ {valor}</code>\n<b>📂 Category:</b> <code>{categoria}</code>\n<b>💳 Method:</b> <code>{metodo_pagamento}</code>\n<b>📅 Date:</b> <code>{data}</code>\n<b>📝 Description:</b> {descricao}\n\n<i>💡 Type</i> <code>balance</code> <i>to see financial summary</i>\n<i>💡 Type</i> <code>expenses today</code> <i>for today's expenses</i>\n```\n\n### 💰 TEMPLATE: Balance Query\n\n```\n<b>💰 FINANCIAL SUMMARY</b>\n\n<b>📊 Current Status:</b>\n<b>📈 Total Income:</b> <code>R$ {total_receitas}</code>\n<b>📉 Total Expenses:</b> <code>R$ {total_despesas}</code>\n<b>💎 Current Balance:</b> <code>R$ {saldo}</code>\n\n<b>📅 Analyzed Period:</b>\n<b>From:</b> <code>{data_inicial}</code> <b>to:</b> <code>{data_final}</code>\n\n<b>📊 Status:</b> {saldo > 0 ? \"🟢 Positive Balance!\" : \"🔴 Warning: Negative Balance\"}\n```\n\n### 📊 TEMPLATE: Category Spending\n\n```\n<b>📊 CATEGORY ANALYSIS</b>\n\n<b>📅 Period:</b> {periodo}\n\n<b>🍔 Food:</b> <code>R$ {valor}</code> <i>({percentual}%)</i>\n<b>🚗 Transportation:</b> <code>R$ {valor}</code> <i>({percentual}%)</i>\n<b>🏠 Housing:</b> <code>R$ {valor}</code> <i>({percentual}%)</i>\n<b>🎮 Leisure:</b> <code>R$ {valor}</code> <i>({percentual}%)</i>\n<b>💸 TOTAL:</b> <code>R$ {total}</code>\n\n<b>📈 Insights:</b>\n<b>🔝 Highest expense:</b> {categoria} <i>({percentual}%)</i>\n<b>📉 Lowest expense:</b> {categoria} <i>({percentual}%)</i>\n<b>💡 Recommendation:</b> <i>{dica_personalizada}</i>\n```\n\n### 📋 TEMPLATE: Transaction History\n\n```\n<b>📋 FINANCIAL HISTORY</b>\n\n<b>🔍 Applied Filters:</b>\n<b>📅 Period:</b> <code>{data_inicial}</code> to <code>{data_final}</code>\n<b>📊 Type:</b> <code>{tipo}</code>\n<b>📂 Category:</b> <code>{categoria}</code>\n\n<b>📊 Transactions Found:</b>\n\n<b>ID {id}:</b> <code>{data}</code> | {tipo_icone} | <i>{descricao}</i> | {categoria} | <code>R$ {valor}</code>\n\n<b>📊 Summary:</b>\n<b>📋 Total Records:</b> <code>{quantidade}</code>\n<b>💵 Total Expenses:</b> <code>R$ {total_despesas}</code>\n<b>💰 Total Income:</b> <code>R$ {total_receitas}</code>\n```\n\n### 📊 TEMPLATE: Monthly Report\n\n```\n<b>📊 MONTHLY REPORT - {mes}/{ano}</b>\n\n<b>💰 Executive Dashboard</b>\n\n<b>🎯 Key Indicators:</b>\n<b>💎 Month Balance:</b> <code>R$ {saldo}</code> <i>({variacao}%)</i>\n<b>📈 Income:</b> <code>R$ {receitas}</code>\n<b>📉 Expenses:</b> <code>R$ {despesas}</code>\n<b>💪 Savings Rate:</b> <code>{taxa}%</code>\n\n<b>📈 Period Income:</b>\n<b>💰 {fonte}:</b> <code>R$ {valor}</code> | <code>{data}</code>\n<b>TOTAL INCOME:</b> <code>R$ {total_receitas}</code>\n\n<b>📉 Top 5 Expense Categories:</b>\n<b>1. 🏠 Housing:</b> <code>R$ {valor}</code> <i>({percentual}%)</i>\n<b>2. 🍔 Food:</b> <code>R$ {valor}</code> <i>({percentual}%)</i>\n<b>3. 🚗 Transportation:</b> <code>R$ {valor}</code> <i>({percentual}%)</i>\n<b>4. 🎮 Leisure:</b> <code>R$ {valor}</code> <i>({percentual}%)</i>\n<b>5. 📚 Education:</b> <code>R$ {valor}</code> <i>({percentual}%)</i>\n\n<b>💡 Insights and Recommendations:</b>\n<b>⚠️ Alert:</b> <i>Spending on {categoria} increased by {percentual}%</i>\n<b>✅ Congratulations:</b> <i>You saved R$ {valor} this month</i>\n<b>🎯 Goal:</b> <i>Suggested R$ {valor} for next month</i>\n```\n\n### ⚠️ TEMPLATE: Error Messages\n\n```\n<b>⚠️ Oops! Something went wrong</b>\n\n<b>🚨 Problem Details:</b>\n<b>Reason:</b> <i>{explicacao}</i>\n\n<b>🔧 How to fix:</b>\n<i>{solucao}</i>\n\n<b>💡 Correct Example:</b>\n<code>{exemplo}</code>\n\n<i>💬 Need help? Type</i> <code>help</code> <i>to see all commands</i>\n```\n\n### 🔄 TEMPLATE: Confirmations\n\n```\n<b>🔄 Confirmation Required</b>\n\n<b>⚠️ You are about to {acao} this record:</b>\n\n<b>🆔 ID:</b> <code>{id}</code>\n<b>📊 Type:</b> <code>{tipo}</code>\n<b>💵 Value:</b> <code>R$ {valor}</code>\n```\n\n\n<b>📝 Description:</b> <i>{descricao}</i> <b>📅 Date:</b> <code>{data}</code>\n\n<b>🚨 This action cannot be undone!</b>\n\n<b>📱 To confirm:</b> Type <code>confirm</code> <b>❌ To cancel:</b> Type <code>cancel</code>\n\n```\n\n---\n\n## ⚡ MANDATORY WORKFLOW\n\n### 1. 📱 **Receive Message**\n- Analyze user intent\n- Identify request type\n\n### 2. 🔍 **If Query**\n```\n\nget\\_all\\_registers → process data → respond in HTML\n\n```\n\n### 3. ➕ **If Record**\n```\n\nget\\_all\\_registers → calculate ID → create\\_new\\_register → confirm in HTML\n\n```\n\n### 4. ✏️ **If Edit**\n```\n\nget\\_all\\_registers → show current → update\\_register → confirm in HTML\n\n```\n\n### 5. 🗑️ **If Delete**\n```\n\nget\\_all\\_registers → confirm → delete\\_register → notify in HTML\n\n```\n\n---\n\n## 🔧 AVAILABLE TOOLS\n\n- **`get_all_registers`**: Query records (always use first)\n- **`create_new_register`**: Add record (after get_all_registers)\n- **`update_register`**: Edit record (with valid ID)\n- **`delete_register`**: Delete record (with prior confirmation)\n- **`Calculator`**: Complex calculations (if needed)\n\n---\n\n## 📝 ABSOLUTE HTML RULES\n\n### ✅ ALWAYS Use:\n1. **`<b>text</b>`** for bold and important highlights\n2. **`<i>text</i>`** for italics and secondary notes\n3. **`<code>text</code>`** for IDs, monetary values, dates, and commands\n4. **`<u>text</u>`** for important underlines (when needed)\n5. **`<s>text</s>`** for strikethrough (when appropriate)\n6. **Single line breaks** to separate sections\n7. **Limited emojis** (max 3 per response)\n\n### 🚨 NEVER Use:\n- Any syntax other than HTML\n- Special formatting symbols\n- Any visual formatting not supported by HTML\n- Unsupported HTML tags for Telegram\n- Excessive emojis (more than 3 per message)\n\n---\n\n## 💡 AVAILABLE COMMANDS (HTML)\n\n```\n\n<b>💡 Quick Commands:</b> <code>balance</code> - <i>View full financial summary</i> <code>expenses today</code> - <i>Current day expenses</i> <code>income month</code> - <i>Current month income</i> <code>report</code> - <i>Full financial analysis</i> <code>edit ID X</code> - <i>Modify a specific record</i> <code>delete ID X</code> - <i>Remove a specific record</i>\n\n<i>💬 Type</i> <code>help</code> <i>to see all available commands</i>\n\n```\n\n---\n\n## 📌 CRITICAL SETTINGS\n\n- **📅 Current date/time:** `{{ $now.format('yyyy-MM-dd HH:mm:ss') }}`\n- **📏 Response limit:** 4096 characters (Telegram limit)\n- **🎨 Formatting:** HTML mandatory (`parse_mode: 'HTML'`)\n- **🔒 Security:** Sensitive data - maximum accuracy\n- **😊 Tone:** Friendly and professional\n- **📱 Platform:** Telegram Bot API\n\n---\n\n## 🎯 FINAL CRITICAL REMINDERS\n\n> **🚨 ABSOLUTE RULES - NEVER VIOLATE:**\n> 1. **ALWAYS** write ALL responses in Telegram-valid HTML\n> 2. **ALWAYS** use `get_all_registers` before any financial operation\n> 3. **ALWAYS** confirm actions with HTML templates\n> 4. **ALWAYS** set `parse_mode: 'HTML'` in all messages\n> 5. **ALWAYS** be accurate with financial data\n> 6. **NEVER** use any formatting other than pure HTML\n> 7. **NEVER** mix HTML with other formatting syntaxes\n> 8. Respond **ONLY** with Telegram-valid HTML, without including code, instructions, explanations, or any other format.\n\n**🎯 Main Objective:** Provide precise financial responses using only Telegram-valid HTML!\n\n**📋 Required Parse Mode:** `parse_mode: 'HTML'` in all messages sent by the bot!"
},
"promptType": "define"
},
"typeVersion": 2
},
{
"id": "9e370cfe-b8a9-4dce-b973-7d39f76af10d",
"name": "发送备用消息",
"type": "n8n-nodes-base.telegram",
"position": [
-368,
336
],
"webhookId": "54a95e4f-38b0-4992-a5c1-81791dba21ab",
"parameters": {
"text": "=⚠️ Desculpe! Não consigo processar imagens ou vídeos. Por favor, envie sua mensagem em texto ou voz.",
"chatId": "={{ $('Telegram Bot Trigger').item.json.message.from.id }}",
"additionalFields": {
"parse_mode": "HTML",
"appendAttribution": false
}
},
"credentials": {
"telegramApi": {
"id": "1hoyHNMYXmyjV8we",
"name": "Telegram Financeiro VIKTHYR"
}
},
"typeVersion": 1.2
},
{
"id": "3a8f67df-e872-4ba7-b8d6-f49f2daf32bf",
"name": "发送响应",
"type": "n8n-nodes-base.telegram",
"position": [
736,
112
],
"webhookId": "54a95e4f-38b0-4992-a5c1-81791dba21ab",
"parameters": {
"text": "={{ $json.output }}",
"chatId": "={{ $('Telegram Bot Trigger').item.json.message.from.id }}",
"additionalFields": {
"parse_mode": "HTML",
"appendAttribution": false
}
},
"credentials": {
"telegramApi": {
"id": "1hoyHNMYXmyjV8we",
"name": "Telegram Financeiro VIKTHYR"
}
},
"typeVersion": 1.2
},
{
"id": "509419ab-c4c1-4dc6-9306-2228181482ea",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
-736,
-256
],
"parameters": {
"color": 7,
"width": 320,
"height": 576,
"content": "## 设置 Telegram 机器人触发器"
},
"typeVersion": 1
},
{
"id": "e0b72d6a-cffa-43e7-9380-858142efbdb1",
"name": "Telegram 机器人触发器",
"type": "n8n-nodes-base.telegramTrigger",
"position": [
-624,
144
],
"webhookId": "3fb3235c-eaa7-421e-a3d2-90cc42e88f1e",
"parameters": {
"updates": [
"message"
],
"additionalFields": {}
},
"credentials": {
"telegramApi": {
"id": "1hoyHNMYXmyjV8we",
"name": "Telegram Financeiro VIKTHYR"
}
},
"typeVersion": 1.2
},
{
"id": "2887b382-f4a1-48be-88e3-b61a95de5f1f",
"name": "便签1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-736,
-464
],
"parameters": {
"width": 608,
"height": 192,
"content": "## 此工作流如何运作"
},
"typeVersion": 1
},
{
"id": "7ea244ca-f65e-4385-98a4-ddfa29e1d37a",
"name": "便签2",
"type": "n8n-nodes-base.stickyNote",
"position": [
1168,
464
],
"parameters": {
"color": 7,
"width": 560,
"height": 256,
"content": "## Google Sheets 配置"
},
"typeVersion": 1
},
{
"id": "423fb5ea-41da-46f4-a413-d264df42c7ab",
"name": "便签3",
"type": "n8n-nodes-base.stickyNote",
"position": [
16,
0
],
"parameters": {
"color": 7,
"width": 224,
"height": 352,
"content": "## Gemini 转转录"
},
"typeVersion": 1
},
{
"id": "9cbca914-b186-4d75-bc6a-05a8b3aa17b4",
"name": "便签4",
"type": "n8n-nodes-base.stickyNote",
"position": [
16,
448
],
"parameters": {
"color": 7,
"width": 224,
"height": 288,
"content": "## Gemini LLM"
},
"typeVersion": 1
},
{
"id": "6106d8e5-e606-4f69-a22c-b3026ee51211",
"name": "便签5",
"type": "n8n-nodes-base.stickyNote",
"position": [
528,
560
],
"parameters": {
"color": 7,
"width": 640,
"content": ""
},
"typeVersion": 1
},
{
"id": "64706a93-b397-456a-a2b1-f9045e507f7b",
"name": "便签6",
"type": "n8n-nodes-base.stickyNote",
"position": [
-400,
-256
],
"parameters": {
"width": 192,
"height": 80,
"content": "## 📌 关注我:"
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "2f09ea75-18db-4ad8-b007-9bb1f8531a97",
"connections": {
"Switch": {
"main": [
[
{
"node": "Financial Agent",
"type": "main",
"index": 0
}
],
[
{
"node": "Get a file",
"type": "main",
"index": 0
}
],
[
{
"node": "Send Fallback Message",
"type": "main",
"index": 0
}
]
]
},
"Calculator": {
"ai_tool": [
[
{
"node": "Financial Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Get a file": {
"main": [
[
{
"node": "Transcribe a recording",
"type": "main",
"index": 0
}
]
]
},
"Simple Memory": {
"ai_memory": [
[
{
"node": "Financial Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"Financial Agent": {
"main": [
[
{
"node": "Send Response",
"type": "main",
"index": 0
}
]
]
},
"delete_register": {
"ai_tool": [
[
{
"node": "Financial Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"update_register": {
"ai_tool": [
[
{
"node": "Financial Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"get_all_registers": {
"ai_tool": [
[
{
"node": "Financial Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"create_new_register": {
"ai_tool": [
[
{
"node": "Financial Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Telegram Bot Trigger": {
"main": [
[
{
"node": "Switch",
"type": "main",
"index": 0
}
]
]
},
"Transcribe a recording": {
"main": [
[
{
"node": "Financial Agent",
"type": "main",
"index": 0
}
]
]
},
"Google Gemini Chat Model": {
"ai_languageModel": [
[
{
"node": "Financial Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
高级 - 个人效率, 多模态 AI
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
使用 Telegram 和 Google Gemini 的个人助理机器人
基于 Telegram 和 Google Gemini 的多模态个人AI助手,集成生产力工具
Set
Code
Merge
+16
83 节点Anshul Chauhan
内容创作
营养追踪与饮食记录(Telegram、Gemini AI和Google Sheets)
营养追踪与饮食记录(Telegram、Gemini AI和Google Sheets)
If
Set
Code
+13
55 节点John Alejandro SIlva
AI 聊天机器人
多智能体Telegram机器人
使用Telegram和Google Gemini的多智能体个人助手机器人
Set
Code
Merge
+18
85 节点Akil A
杂项
宠物美容发布与预约自动化
使用AI、Facebook和Telegram机器人自动化宠物美容发布与预约
If
Set
Switch
+17
36 节点Christian Moises
AI 聊天机器人
Telegram机器人
构建支持文本和图像响应的Telegram机器人,集成Google Gemini 2.5 Flash
Set
Switch
Telegram
+6
15 节点Ahmed Sherif
内容创作
我的工作流
卡路里追踪与饮食记录(Telegram、Gemini AI和数据表)
If
Set
Code
+13
73 节点Gerald Denor
内容创作
工作流信息
难度等级
高级
节点数量21
分类2
节点类型10
作者
Vitorio Magalhães
@vikthyrBrazilian Full Stack Developer passionate about making automation accessible to everyone. I create free n8n workflows that solve real problems - from NASA space content to marketing automation. Proving that powerful automation doesn't need to be expensive or complicated. Teaching through templates, one node at a time.
外部链接
在 n8n.io 查看 →
分享此工作流