Gestionnaire de finances personnelles piloté par l'IA - Gemini, Telegram et Google Sheets

Avancé

Ceci est unPersonal Productivity, Multimodal AIworkflow d'automatisation du domainecontenant 21 nœuds.Utilise principalement des nœuds comme Switch, Telegram, Agent, TelegramTrigger, GoogleSheetsTool. Gestionnaire de finances personnelles piloté par l'IA basé sur Gemini, Telegram et Google Sheets

Prérequis
  • Token Bot Telegram
  • Informations d'identification Google Sheets API
  • Clé API Google Gemini
Aperçu du workflow
Visualisation des connexions entre les nœuds, avec support du zoom et du déplacement
Exporter le workflow
Copiez la configuration JSON suivante dans n8n pour importer et utiliser ce workflow
{
  "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": "Obtenir un fichier",
      "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": "Transcrire un enregistrement",
      "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 Chat Model",
      "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": "Calculatrice",
      "type": "@n8n/n8n-nodes-langchain.toolCalculator",
      "position": [
        400,
        592
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "68ed3254-0583-48f3-b3d0-2b329d145acd",
      "name": "mettre_à_jour_registre",
      "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": "obtenir_tous_les_registres",
      "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": "créer_nouveau_registre",
      "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": "supprimer_registre",
      "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": "Mémoire simple",
      "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": "Agent financier",
      "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: `<` → `&lt;`, `>` → `&gt;`, `&` → `&amp;`\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": "Envoyer message de secours",
      "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": "Envoyer réponse",
      "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": "Note adhésive",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -736,
        -256
      ],
      "parameters": {
        "color": 7,
        "width": 320,
        "height": 576,
        "content": "## Setup Telegram Bot Trigger\n\n1. Create a new bot using @BotFather on Telegram.\n\n2. Copy the bot token provided by BotFather.\n\n3. Paste the token into the Telegram Trigger node credentials.\n\n4. Make sure the bot is active and can receive messages.\n\n5. This node starts the workflow whenever a new message is received.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "e0b72d6a-cffa-43e7-9380-858142efbdb1",
      "name": "Telegram Bot Trigger",
      "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": "Note adhésive1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -736,
        -464
      ],
      "parameters": {
        "width": 608,
        "height": 192,
        "content": "## How This Workflow Works\n\n1. Telegram Trigger receives user messages (text or audio).\n2. AI Node interprets message and extracts transaction details.\n3. Google Sheets Node creates/updates/deletes records.\n4. Response Node sends confirmation back to the user in Telegram (HTML format).\n"
      },
      "typeVersion": 1
    },
    {
      "id": "7ea244ca-f65e-4385-98a4-ddfa29e1d37a",
      "name": "Note adhésive2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1168,
        464
      ],
      "parameters": {
        "color": 7,
        "width": 560,
        "height": 256,
        "content": "## Google Sheets Configuration\n\n1. Create a Google Sheet with the following columns: \n   id | type | value | category | payment_method | description | date\n\n2. Leave rows empty for automatic insertion.\n\n3. Set up a Google Service Account and share the sheet with it.\n\n4. Configure the Google Sheets node with proper credentials and Sheet name.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "423fb5ea-41da-46f4-a413-d264df42c7ab",
      "name": "Note adhésive3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        16,
        0
      ],
      "parameters": {
        "color": 7,
        "width": 224,
        "height": 352,
        "content": "## Gemini To Transcription\n\nInsert your Google Gemini Credentials"
      },
      "typeVersion": 1
    },
    {
      "id": "9cbca914-b186-4d75-bc6a-05a8b3aa17b4",
      "name": "Note adhésive4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        16,
        448
      ],
      "parameters": {
        "color": 7,
        "width": 224,
        "height": 288,
        "content": "## Gemini LLM\n\nInsert your Google Gemini Credentials"
      },
      "typeVersion": 1
    },
    {
      "id": "6106d8e5-e606-4f69-a22c-b3026ee51211",
      "name": "Note adhésive5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        528,
        560
      ],
      "parameters": {
        "color": 7,
        "width": 640,
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "64706a93-b397-456a-a2b1-f9045e507f7b",
      "name": "Note adhésive6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        -256
      ],
      "parameters": {
        "width": 192,
        "height": 80,
        "content": "## 📌 Follow me:\n### [LinkedIn](https://www.linkedin.com/in/vikthyr)"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "2f09ea75-18db-4ad8-b007-9bb1f8531a97",
  "connections": {
    "e0e6a600-c67a-4982-a96f-3d5209eedb1a": {
      "main": [
        [
          {
            "node": "61709694-d404-4ff4-a0c8-f1f6bebb2385",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "6aff69e5-f729-4f99-a217-e867c1abc52c",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "9e370cfe-b8a9-4dce-b973-7d39f76af10d",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "87162f3e-ed6b-40c8-bf9b-72595646d423": {
      "ai_tool": [
        [
          {
            "node": "61709694-d404-4ff4-a0c8-f1f6bebb2385",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "6aff69e5-f729-4f99-a217-e867c1abc52c": {
      "main": [
        [
          {
            "node": "360c855d-4af2-4e6e-bd21-49939f7df26d",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "869a5926-5ead-46a8-93d2-78b92e97b42e": {
      "ai_memory": [
        [
          {
            "node": "61709694-d404-4ff4-a0c8-f1f6bebb2385",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "61709694-d404-4ff4-a0c8-f1f6bebb2385": {
      "main": [
        [
          {
            "node": "3a8f67df-e872-4ba7-b8d6-f49f2daf32bf",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "d520850f-38f0-4203-9d5e-1b9d043bc9a6": {
      "ai_tool": [
        [
          {
            "node": "61709694-d404-4ff4-a0c8-f1f6bebb2385",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "68ed3254-0583-48f3-b3d0-2b329d145acd": {
      "ai_tool": [
        [
          {
            "node": "61709694-d404-4ff4-a0c8-f1f6bebb2385",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "e7e87104-60bd-4d4f-b124-cda0f1adf040": {
      "ai_tool": [
        [
          {
            "node": "61709694-d404-4ff4-a0c8-f1f6bebb2385",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "08048f3b-ec34-4f8b-9f8b-741cd3293b49": {
      "ai_tool": [
        [
          {
            "node": "61709694-d404-4ff4-a0c8-f1f6bebb2385",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "e0b72d6a-cffa-43e7-9380-858142efbdb1": {
      "main": [
        [
          {
            "node": "e0e6a600-c67a-4982-a96f-3d5209eedb1a",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "360c855d-4af2-4e6e-bd21-49939f7df26d": {
      "main": [
        [
          {
            "node": "61709694-d404-4ff4-a0c8-f1f6bebb2385",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "8da2430d-ce86-4074-93f6-be6b22143a78": {
      "ai_languageModel": [
        [
          {
            "node": "61709694-d404-4ff4-a0c8-f1f6bebb2385",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}
Foire aux questions

Comment utiliser ce workflow ?

Copiez le code de configuration JSON ci-dessus, créez un nouveau workflow dans votre instance n8n et sélectionnez "Importer depuis le JSON", collez la configuration et modifiez les paramètres d'authentification selon vos besoins.

Dans quelles scénarios ce workflow est-il adapté ?

Avancé - Productivité personnelle, IA Multimodale

Est-ce payant ?

Ce workflow est entièrement gratuit et peut être utilisé directement. Veuillez noter que les services tiers utilisés dans le workflow (comme l'API OpenAI) peuvent nécessiter un paiement de votre part.

Informations sur le workflow
Niveau de difficulté
Avancé
Nombre de nœuds21
Catégorie2
Types de nœuds10
Description de la difficulté

Adapté aux utilisateurs avancés, avec des workflows complexes contenant 16+ nœuds

Auteur
Vitorio Magalhães

Vitorio Magalhães

@vikthyr

Brazilian 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.

Liens externes
Voir sur n8n.io

Partager ce workflow

Catégories

Catégories: 34