Telegram und Google Sheets Kostenabrechnung: Wöchentliche Zusammenfassung und Budget-Erinnerung

Fortgeschritten

Dies ist ein Personal Productivity, Miscellaneous, Multimodal AI-Bereich Automatisierungsworkflow mit 15 Nodes. Hauptsächlich werden Code, Telegram, GoogleSheets, ScheduleTrigger, TelegramTrigger und andere Nodes verwendet. Telegram und Google Sheets Ausgabenprotokoll: Wöchentliche Zusammenfassung und Budgetbenachrichtigung

Voraussetzungen
  • Telegram Bot Token
  • Google Sheets API-Anmeldedaten
Workflow-Vorschau
Visualisierung der Node-Verbindungen, mit Zoom und Pan
Workflow exportieren
Kopieren Sie die folgende JSON-Konfiguration und importieren Sie sie in n8n
{
  "meta": {
    "instanceId": "19e5bdcaace8da818cec75a5b6c7d27485bb3218a7ba566cbf475ddfd436a339",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "ce1bf9d0-73d3-44d7-89e6-7a255be132f2",
      "name": "Haftnotiz - Übersicht",
      "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": "Haftnotiz - Tägliches Protokoll",
      "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": "Haftnotiz - Wöchentliche Gesamtsumme",
      "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 - Ausgabenbefehl abrufen",
      "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": "Telegram-Nachricht parsen",
      "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": "Google Sheets - Ausgabe protokollieren",
      "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": "Wöchentlicher Zusammenfassungs-Trigger",
      "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": "Wöchentliche Gesamtsumme berechnen",
      "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 - Wöchentliche Zusammenfassung senden",
      "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": "Haftnotiz - Einrichtungsanleitung",
      "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": "Google Sheets - Bereinigung (Optional)",
      "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": "Google Sheets - Wöchentliche Ausgaben abrufen",
      "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": "Google Sheets - Ausgaben abrufen (Echtzeit)",
      "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": "Wöchentliches Budget prüfen",
      "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 - Budgetwarnung senden",
      "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": "fe60d073-a130-40c4-b44c-d9f7047d6432",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "89969a35-a406-46a2-80b9-68b91d06eee3": {
      "main": [
        [
          {
            "node": "77d677fc-5c20-4d6a-934f-6c11b03d2b62",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "fe60d073-a130-40c4-b44c-d9f7047d6432": {
      "main": [
        [
          {
            "node": "1a7dd79f-cfe3-4612-9efc-3995ad521e5e",
            "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": "2f11e041-b267-4ee3-b097-13b64250acfc",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "77d677fc-5c20-4d6a-934f-6c11b03d2b62": {
      "main": [
        [
          {
            "node": "538c8dec-9443-429f-830f-964af2e09092",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1a7dd79f-cfe3-4612-9efc-3995ad521e5e": {
      "main": [
        [
          {
            "node": "d3a25a1b-e05a-4984-8ab3-8c22d90b8a1b",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Häufig gestellte Fragen

Wie verwende ich diesen Workflow?

Kopieren Sie den obigen JSON-Code, erstellen Sie einen neuen Workflow in Ihrer n8n-Instanz und wählen Sie "Aus JSON importieren". Fügen Sie die Konfiguration ein und passen Sie die Anmeldedaten nach Bedarf an.

Für welche Szenarien ist dieser Workflow geeignet?

Fortgeschritten - Persönliche Produktivität, Verschiedenes, Multimodales KI

Ist es kostenpflichtig?

Dieser Workflow ist völlig kostenlos. Beachten Sie jedoch, dass Drittanbieterdienste (wie OpenAI API), die im Workflow verwendet werden, möglicherweise kostenpflichtig sind.

Workflow-Informationen
Schwierigkeitsgrad
Fortgeschritten
Anzahl der Nodes15
Kategorie3
Node-Typen6
Schwierigkeitsbeschreibung

Für erfahrene Benutzer, mittelkomplexe Workflows mit 6-15 Nodes

Externe Links
Auf n8n.io ansehen

Diesen Workflow teilen

Kategorien

Kategorien: 34