{
  "name": "Täglicher Report aus Google Sheets per Gmail",
  "nodes": [
    {
      "parameters": {
        "content": "## Täglicher Report aus Google Sheets per Gmail\n\n**Zweck:** Liest werktags um 7 Uhr die Tabelle „Umsatz“, zählt die Einträge vom Vortag, summiert die Spalte Betrag und schickt das Ergebnis per Gmail.\n\n**Zugangsdaten (Credentials):**\n- Google Sheets: Google OAuth2\n- Gmail: Google OAuth2 (gleiche Google-Verbindung möglich)\n\n**Anpassen:**\n- Tabellen-URL und Blatt „Umsatz“ (Spalten Datum im Format JJJJ-MM-TT, Betrag als Zahl)\n- Empfänger in „Report senden“\n- Uhrzeit und Wochentage im Zeitplan\n\nValidiert am 09.11.2026 gegen das n8n-Node-Schema, nicht in Produktion ausgeführt.\nQuelle: automationskompass.de/n8n-templates/",
        "height": 520,
        "width": 420,
        "color": 7
      },
      "id": "833c3670-a736-4792-a20b-66d0a5829471",
      "name": "Notiz",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -520,
        120
      ]
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "weeks",
              "triggerAtDay": [
                1,
                2,
                3,
                4,
                5
              ],
              "triggerAtHour": 7
            }
          ]
        }
      },
      "id": "45146372-91bc-4938-b6c8-3db4fff9ce3b",
      "name": "Werktags 7 Uhr",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.3,
      "position": [
        0,
        300
      ]
    },
    {
      "parameters": {
        "operation": "read",
        "documentId": {
          "__rl": true,
          "value": "https://docs.google.com/spreadsheets/d/DEINE-TABELLEN-ID/edit",
          "mode": "url"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Umsatz"
        },
        "options": {}
      },
      "id": "bd1c75f1-6642-425c-8930-d3c0223096b4",
      "name": "Umsatz lesen",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        240,
        300
      ]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "loose",
            "version": 2
          },
          "conditions": [
            {
              "id": "6e43a133-0484-451c-951f-9283d0ba6d69",
              "leftValue": "={{ $json.Datum }}",
              "rightValue": "={{ $now.minus({ days: 1 }).toFormat('yyyy-MM-dd') }}",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "bea07ac4-0d49-47ad-9d32-532920d455c5",
      "name": "Nur gestern",
      "type": "n8n-nodes-base.filter",
      "typeVersion": 2.3,
      "position": [
        480,
        300
      ]
    },
    {
      "parameters": {
        "fieldsToSummarize": {
          "values": [
            {
              "aggregation": "count",
              "field": "Datum"
            },
            {
              "aggregation": "sum",
              "field": "Betrag"
            }
          ]
        },
        "options": {}
      },
      "id": "4b22c166-839a-43f4-894d-6dc27a399e86",
      "name": "Zusammenfassen",
      "type": "n8n-nodes-base.summarize",
      "typeVersion": 1.1,
      "position": [
        720,
        300
      ]
    },
    {
      "parameters": {
        "resource": "message",
        "operation": "send",
        "sendTo": "chef@deine-firma.de",
        "subject": "=Report {{ $now.minus({ days: 1 }).toFormat('dd.MM.yyyy') }}",
        "emailType": "text",
        "message": "=Einträge gestern: {{ $json.count_Datum || 0 }}\nSumme Betrag: {{ ($json.sum_Betrag || 0).toFixed(2).replace(\".\", \",\") }} €",
        "options": {
          "appendAttribution": false
        }
      },
      "id": "e248820f-8711-4ac8-9c87-24a564b39746",
      "name": "Report senden",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.2,
      "position": [
        960,
        300
      ]
    }
  ],
  "connections": {
    "Werktags 7 Uhr": {
      "main": [
        [
          {
            "node": "Umsatz lesen",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Umsatz lesen": {
      "main": [
        [
          {
            "node": "Nur gestern",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Nur gestern": {
      "main": [
        [
          {
            "node": "Zusammenfassen",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Zusammenfassen": {
      "main": [
        [
          {
            "node": "Report senden",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1",
    "timezone": "Europe/Berlin"
  },
  "meta": {
    "templateCredsSetupCompleted": false
  }
}
