Registro de gastos de Telegram y Google Sheets: Resumen semanal y recordatorio de presupuesto
Este es unPersonal Productivity, Miscellaneous, Multimodal AIflujo de automatización del dominio deautomatización que contiene 15 nodos.Utiliza principalmente nodos como Code, Telegram, GoogleSheets, ScheduleTrigger, TelegramTrigger. Registros de gastos en Telegram y Google Sheets: resumen semanal y recordatorios de presupuesto
- •Bot Token de Telegram
- •Credenciales de API de Google Sheets
Nodos utilizados (15)
{
"meta": {
"instanceId": "19e5bdcaace8da818cec75a5b6c7d27485bb3218a7ba566cbf475ddfd436a339",
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "ce1bf9d0-73d3-44d7-89e6-7a255be132f2",
"name": "Nota Adhesiva - Descripción General",
"type": "n8n-nodes-base.stickyNote",
"position": [
-96,
112
],
"parameters": {
"width": 640,
"height": 308,
"content": "# 💸 Telegram Expense Tracker with Google Sheets\nThis workflow lets you log daily expenses from Telegram into Google Sheets, send a **weekly summary**, and fire **budget alerts** when you cross your limit.\n\n- Log an expense: `/spent 5 coffee`\n- Weekly summary every Sunday at 11:00\n- Budget alert threshold default: €100 (edit in *Check Weekly Budget* code)\n\n👉 Read the setup sticky note for configuration."
},
"typeVersion": 1
},
{
"id": "8a39a922-2230-4d47-896e-722009ffcf61",
"name": "Nota Adhesiva - Registro Diario",
"type": "n8n-nodes-base.stickyNote",
"position": [
576,
400
],
"parameters": {
"color": 4,
"width": 1232,
"height": 304,
"content": "## Daily logged expenses in sheets\n"
},
"typeVersion": 1
},
{
"id": "d25a775e-f537-4e28-851d-ebf02dc67531",
"name": "Nota Adhesiva - Total Semanal",
"type": "n8n-nodes-base.stickyNote",
"position": [
576,
704
],
"parameters": {
"color": 5,
"width": 1056,
"height": 272,
"content": "## Weekly Total \n"
},
"typeVersion": 1
},
{
"id": "e8295340-df45-4f59-a79c-d34284171769",
"name": "Telegram - Obtener Comando de Gasto",
"type": "n8n-nodes-base.telegramTrigger",
"position": [
624,
496
],
"webhookId": "b794fd0e-d6fa-442c-b916-0eb73f65f448",
"parameters": {
"updates": [
"message"
],
"additionalFields": {}
},
"credentials": {
"telegramApi": {
"id": "qFp0dReFa2R5lsei",
"name": "Telegram account"
}
},
"typeVersion": 1.2
},
{
"id": "424fbab2-7a0d-4752-87cf-c678af551858",
"name": "Analizar Mensaje Telegram",
"type": "n8n-nodes-base.code",
"position": [
816,
496
],
"parameters": {
"jsCode": "const msg = $json.message.text; // e.g. \"/spent 4 coffee\"\nconst parts = msg.split(\" \"); // [\"/spent\", \"4\", \"coffee\"]\nreturn [{\n json: {\n amount: parseFloat(parts[1]),\n description: parts.slice(2).join(\" \"),\n date: new Date().toISOString().split(\"T\")[0] // YYYY-MM-DD\n }\n}];\n"
},
"typeVersion": 2
},
{
"id": "fe60d073-a130-40c4-b44c-d9f7047d6432",
"name": "Hojas de Google - Registrar Gasto",
"type": "n8n-nodes-base.googleSheets",
"position": [
1008,
496
],
"parameters": {
"columns": {
"value": {
"Date ": "={{ $json.date }}",
"Amount ": "={{ $json.amount }}",
"Description": "={{ $json.description }}"
},
"schema": [
{
"id": "Date ",
"type": "string",
"display": true,
"required": false,
"displayName": "Date ",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Amount ",
"type": "string",
"display": true,
"required": false,
"displayName": "Amount ",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Description",
"type": "string",
"display": true,
"required": false,
"displayName": "Description",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "append",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "<YOUR_SHEET_ID>"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "ktGp50kJq6nhFH5q",
"name": "Google Sheets account"
}
},
"typeVersion": 4.6
},
{
"id": "89969a35-a406-46a2-80b9-68b91d06eee3",
"name": "Activador de Resumen Semanal",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
640,
800
],
"parameters": {
"rule": {
"interval": [
{
"field": "weeks",
"triggerAtHour": 11
}
]
}
},
"typeVersion": 1.2
},
{
"id": "538c8dec-9443-429f-830f-964af2e09092",
"name": "Calcular Total Semanal",
"type": "n8n-nodes-base.code",
"position": [
1056,
800
],
"parameters": {
"jsCode": "const rows = items.map(item => item.json);\n\nconst now = new Date();\nconst weekAgo = new Date();\nweekAgo.setDate(now.getDate() - 7);\n\nlet total = 0;\nfor (let r of rows) {\n // Handle column name issues (trim spaces in keys)\n const dateStr = r[\"Date\"] || r[\"Date \"] || r[\"date\"];\n const amountStr = r[\"Amount\"] || r[\"Amount \"] || r[\"amount\"];\n\n // Try parsing date safely (Google Sheets often gives YYYY-MM-DD if set to ISO)\n const d = new Date(dateStr);\n\n if (!isNaN(d)) {\n if (d >= weekAgo && d <= now) {\n total += parseFloat(amountStr) || 0;\n }\n }\n}\n\nreturn [{\n json: { summary: `💰 Your total expenses this week: €${total.toFixed(2)}` }\n}];\n"
},
"typeVersion": 2
},
{
"id": "f2fb125e-a966-4e4b-ac87-729eee25771f",
"name": "Telegram - Enviar Resumen Semanal",
"type": "n8n-nodes-base.telegram",
"position": [
1264,
800
],
"webhookId": "cd477ad5-32ee-4d4f-a864-694323cdf656",
"parameters": {
"text": "={{$json[\"summary\"]}}",
"chatId": "<YOUR_CHAT_ID>",
"additionalFields": {
"appendAttribution": false
}
},
"credentials": {
"telegramApi": {
"id": "qFp0dReFa2R5lsei",
"name": "Telegram account"
}
},
"typeVersion": 1.2
},
{
"id": "de30a959-b686-4868-b526-008cfad554e8",
"name": "Nota Adhesiva - Guía de Configuración",
"type": "n8n-nodes-base.stickyNote",
"position": [
16,
416
],
"parameters": {
"color": 6,
"width": 528,
"height": 496,
"content": "# 🛠️ Setup Guide \n**Author:** [Giorgos Tarasidis]\n\n---\n### 1️⃣ Create a telegram bot\n- Go to botfather in telegram and press /newbot.\nFrom there get your API key \n- Visit: https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates\n- Look for the \"chat\" object in the response - the \"id\" field is your chat ID\n\n---\n\n#### 2️⃣ Expense bot sheet (Google Sheets) \n🔗 **[Make a copy of the template](https://docs.google.com/spreadsheets/d/1uyQpX9_ZZUhLtBhyxfjdU80D6Q6cqbMV286MnhF5QBY/edit?usp=sharing)** \n- Set up your Google Sheets credentials \n- Connect your Google credential \n- Customize the sheet as needed (optional)\n---\n"
},
"typeVersion": 1
},
{
"id": "2f11e041-b267-4ee3-b097-13b64250acfc",
"name": "Hojas de Google - Limpieza (Opcional)",
"type": "n8n-nodes-base.googleSheets",
"position": [
1472,
800
],
"parameters": {
"operation": "delete",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "<YOUR_SHEET_ID>"
},
"numberToDelete": 30
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "ktGp50kJq6nhFH5q",
"name": "Google Sheets account"
}
},
"typeVersion": 4.7
},
{
"id": "77d677fc-5c20-4d6a-934f-6c11b03d2b62",
"name": "Hojas de Google - Obtener Gastos Semanales",
"type": "n8n-nodes-base.googleSheets",
"position": [
848,
800
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "<YOUR_SHEET_ID>"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "ktGp50kJq6nhFH5q",
"name": "Google Sheets account"
}
},
"typeVersion": 4.7
},
{
"id": "1a7dd79f-cfe3-4612-9efc-3995ad521e5e",
"name": "Hojas de Google - Obtener Gastos (Tiempo Real)",
"type": "n8n-nodes-base.googleSheets",
"position": [
1232,
496
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "<YOUR_SHEET_ID>"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "ktGp50kJq6nhFH5q",
"name": "Google Sheets account"
}
},
"typeVersion": 4.7
},
{
"id": "d3a25a1b-e05a-4984-8ab3-8c22d90b8a1b",
"name": "Verificar Presupuesto Semanal",
"type": "n8n-nodes-base.code",
"position": [
1440,
496
],
"parameters": {
"jsCode": "const rows = items.map(item => item.json);\n\nlet total = 0;\nfor (let r of rows) {\n const amountStr = r[\"Amount\"] || r[\"Amount \"] || r[\"amount\"];\n total += parseFloat(amountStr) || 0;\n}\n\nif (total > 100) {\n return [{\n json: {\n alert: `⚠️ Warning Giorgos! You have exceeded your weekly budget of 100€ (€${total.toFixed(2)})`\n }\n }];\n} else {\n return [];\n}"
},
"typeVersion": 2
},
{
"id": "6b30f059-d3d0-4117-bb06-0d027f0d95eb",
"name": "Telegram - Enviar Alerta de Presupuesto",
"type": "n8n-nodes-base.telegram",
"position": [
1632,
496
],
"webhookId": "5d273b13-40db-441d-8dc5-f753e7b8256e",
"parameters": {
"text": "={{$json[\"alert\"]}}",
"chatId": "<YOUR_CHAT_ID>",
"additionalFields": {
"appendAttribution": false
}
},
"credentials": {
"telegramApi": {
"id": "qFp0dReFa2R5lsei",
"name": "Telegram account"
}
},
"typeVersion": 1.2
}
],
"pinData": {},
"connections": {
"d3a25a1b-e05a-4984-8ab3-8c22d90b8a1b": {
"main": [
[
{
"node": "6b30f059-d3d0-4117-bb06-0d027f0d95eb",
"type": "main",
"index": 0
}
]
]
},
"538c8dec-9443-429f-830f-964af2e09092": {
"main": [
[
{
"node": "f2fb125e-a966-4e4b-ac87-729eee25771f",
"type": "main",
"index": 0
}
]
]
},
"424fbab2-7a0d-4752-87cf-c678af551858": {
"main": [
[
{
"node": "Google Sheets - Registrar Gasto",
"type": "main",
"index": 0
}
]
]
},
"89969a35-a406-46a2-80b9-68b91d06eee3": {
"main": [
[
{
"node": "Google Sheets - Obtener Gastos Semanales",
"type": "main",
"index": 0
}
]
]
},
"Google Sheets - Registrar Gasto": {
"main": [
[
{
"node": "Google Sheets - Obtener Gastos (Tiempo Real)",
"type": "main",
"index": 0
}
]
]
},
"e8295340-df45-4f59-a79c-d34284171769": {
"main": [
[
{
"node": "424fbab2-7a0d-4752-87cf-c678af551858",
"type": "main",
"index": 0
}
]
]
},
"f2fb125e-a966-4e4b-ac87-729eee25771f": {
"main": [
[
{
"node": "Google Sheets - Limpieza (Opcional)",
"type": "main",
"index": 0
}
]
]
},
"Google Sheets - Obtener Gastos Semanales": {
"main": [
[
{
"node": "538c8dec-9443-429f-830f-964af2e09092",
"type": "main",
"index": 0
}
]
]
},
"Google Sheets - Obtener Gastos (Tiempo Real)": {
"main": [
[
{
"node": "d3a25a1b-e05a-4984-8ab3-8c22d90b8a1b",
"type": "main",
"index": 0
}
]
]
}
}
}¿Cómo usar este flujo de trabajo?
Copie el código de configuración JSON de arriba, cree un nuevo flujo de trabajo en su instancia de n8n y seleccione "Importar desde JSON", pegue la configuración y luego modifique la configuración de credenciales según sea necesario.
¿En qué escenarios es adecuado este flujo de trabajo?
Intermedio - Productividad personal, Varios, IA Multimodal
¿Es de pago?
Este flujo de trabajo es completamente gratuito, puede importarlo y usarlo directamente. Sin embargo, tenga en cuenta que los servicios de terceros utilizados en el flujo de trabajo (como la API de OpenAI) pueden requerir un pago por su cuenta.
Flujos de trabajo relacionados recomendados
Gtaras
@tarasidisCompartir este flujo de trabajo