AutomationFlowsAI & RAG › Telegram Expense Tracking to Google Sheets

Telegram Expense Tracking to Google Sheets

Original n8n title: Pendataan Belanja

Pendataan Belanja. Uses telegramTrigger, telegram, httpRequest, googleSheets. Event-driven trigger; 20 nodes.

Event trigger★★★★☆ complexityAI-powered20 nodesTelegram TriggerTelegramHTTP RequestGoogle SheetsAgentGoogle Gemini ChatGoogle Sheets Tool
AI & RAG Trigger: Event Nodes: 20 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow follows the Agent → Google Sheets recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "name": "Pendataan Belanja",
  "nodes": [
    {
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegramTrigger",
      "typeVersion": 1.2,
      "position": [
        0,
        0
      ],
      "id": "ce826212-9460-4dd6-b603-4704efa46539",
      "name": "Telegram Trigger",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ $json.message.photo[3] }}",
                    "rightValue": "",
                    "operator": {
                      "type": "object",
                      "operation": "exists",
                      "singleValue": true
                    },
                    "id": "707b4960-b9ef-4862-8a7d-9a32a6258bff"
                  }
                ],
                "combinator": "and"
              }
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "c31e48fa-b662-48cb-b555-7f37c6db74d5",
                    "leftValue": "={{ $json.message.text }}",
                    "rightValue": "/laporan",
                    "operator": {
                      "type": "string",
                      "operation": "startsWith"
                    }
                  }
                ],
                "combinator": "and"
              }
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "12e14a46-7d81-4aaa-86e0-f9b240a8986b",
                    "leftValue": "={{ $json.message.text }}",
                    "rightValue": "",
                    "operator": {
                      "type": "string",
                      "operation": "exists",
                      "singleValue": true
                    }
                  }
                ],
                "combinator": "and"
              }
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.2,
      "position": [
        220,
        0
      ],
      "id": "35e49db7-d94a-46d0-ae62-112bffe69446",
      "name": "Switch"
    },
    {
      "parameters": {
        "resource": "file",
        "fileId": "={{ $json.message.photo[3].file_id }}"
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        420,
        -300
      ],
      "id": "c1fa6d68-ebb0-4a0f-8952-73158c15b566",
      "name": "Telegram",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "url": "=https://api.telegram.org/file/bot[YOUR BOT TOKEN]/{{ $json.result.file_path }}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        640,
        -300
      ],
      "id": "39d11fcd-03d7-4289-84c2-f511c5371f27",
      "name": "HTTP Request"
    },
    {
      "parameters": {
        "language": "python",
        "pythonCode": "# Assume `items` is provided by the input (similar to $input.all() in n8n)\nitems = _input.all()   # in n8n Python node, _input.all() gives all items\nitem = items[0]\n\nbinary_data = item[\"binary\"][\"data\"]\nbase64_string = binary_data[\"data\"]\n\ngemini_payload = {\n    \"contents\": [\n        {\n            \"parts\": [\n                {\n                    \"text\": (\n                        \"Analisa struk belanja pada gambar ini dan berikan informasi dalam format yang PERSIS seperti ini:\\n\\n\"\n                        \"TOKO: [nama toko dari struk]\\n\"\n                        \"TOTAL: [total pembayaran dalam angka saja tanpa Rp]\\n\"\n                        \"ITEMS: [daftar barang yang dibeli, pisahkan dengan koma]\\n\"\n                        \"TANGGAL: [tanggal transaksi jika terlihat, atau 2025-06-19]\\n\\n\"\n                        \"Contoh response yang benar:\\n\"\n                        \"TOKO: Alfamart\\n\"\n                        \"TOTAL: 25500\\n\"\n                        \"ITEMS: Susu Ultra 1L, Roti Tawar, Sabun Lifebuoy\\n\"\n                        \"TANGGAL: 2025-06-19\\n\\n\"\n                        \"Jika struk tidak jelas atau tidak bisa dibaca, berikan:\\n\"\n                        \"ERROR: Struk tidak dapat dibaca dengan jelas\\n\\n\"\n                        \"PENTING: Hanya berikan response dalam format di atas!\"\n                    )\n                },\n                {\n                    \"inline_data\": {\n                        \"mime_type\": \"image/jpeg\",\n                        \"data\": base64_string\n                    }\n                }\n            ]\n        }\n    ],\n    \"generationConfig\": {\n        \"responseMimeType\": \"text/plain\"\n    }\n}\n\nprint(\"Base64 length:\", len(base64_string) if base64_string else 0)\nprint(\"Mime type:\", binary_data.get(\"mimeType\"))\n\n# Return in n8n Python node style\nreturn [{\n    \"json\": {\n        \"gemini_payload\": gemini_payload,\n        \"base64_ready\": bool(base64_string),\n        \"data_length\": len(base64_string) if base64_string else 0\n    }\n}]\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        860,
        -300
      ],
      "id": "56984f0c-f571-47c5-8925-3e9a3e35090a",
      "name": "Code"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ $json.gemini_payload }}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1080,
        -300
      ],
      "id": "b4a97b57-c736-428b-88bc-4f02d5956d82",
      "name": "HTTP Request1"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "e9277315-7911-499f-8fac-47dd404a4237",
              "leftValue": "={{ $json.candidates[0].content.parts[0].text }}",
              "rightValue": "ERROR:",
              "operator": {
                "type": "string",
                "operation": "contains"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        1300,
        -300
      ],
      "id": "ee2c6f89-452d-4c7a-aa9e-45ef77c0280a",
      "name": "If"
    },
    {
      "parameters": {
        "chatId": "=  {{ $('Telegram Trigger').item.json.message.chat.id }}",
        "text": "Yang jelas dong",
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        1520,
        -400
      ],
      "id": "4ff06828-0cf1-43f2-b0b0-be24d4a84c9b",
      "name": "Telegram1",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1YKNaO-4-qYdZSwS9XmIFXNgikBjx_iNU7CO1DC6K1uA",
          "mode": "list",
          "cachedResultName": "Catatan Duit",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1YKNaO-4-qYdZSwS9XmIFXNgikBjx_iNU7CO1DC6K1uA/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1YKNaO-4-qYdZSwS9XmIFXNgikBjx_iNU7CO1DC6K1uA/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Toko": "={{ $json.candidates[0].content.parts[0].text.match (/TOKO: (.+)/)[1] }}",
            "Total": "={{ $json.candidates[0].content.parts[0].text.match (/TOTAL: (.+)/)[1] }}",
            "Items": "={{ $json.candidates[0].content.parts[0].text.match (/ITEMS: (.+)/)[1] }}",
            "Tanggal Struk": "={{ $json.candidates[0].content.parts[0].text.match (/TANGGAL: (.+)/)[1] }}",
            "Tanggal Input": "={{ $now.format('yyyy:MM:dd') }}",
            "Waktu Input": "={{ $now.format('HH:mm:ss') }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "Toko",
              "displayName": "Toko",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Total",
              "displayName": "Total",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Items",
              "displayName": "Items",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Tanggal Struk",
              "displayName": "Tanggal Struk",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Tanggal Input",
              "displayName": "Tanggal Input",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Waktu Input",
              "displayName": "Waktu Input",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.6,
      "position": [
        1520,
        -200
      ],
      "id": "8fb96cd0-c6b7-4368-8c84-7c7f4ea2177d",
      "name": "Google Sheets",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "text": "={{ $json['Tanggal Struk'] }}\n{{ $json.Toko }}\n{{ $json.Items }}\n{{ $json.Total }}\n{{ $json['Tanggal Input'] }} {{ $json['Waktu Input'] }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        1740,
        -200
      ],
      "id": "d483b625-6d44-47c0-bdae-3346071c5cd5",
      "name": "Telegram2",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $json.message.text }}",
        "options": {
          "systemMessage": "Kamu adalah parser text belanja yang mengubah input text fleksibel menjadi format terstruktur.\n\nTUGAS: Analisa text belanja dan ubah menjadi format PERSIS seperti ini:\n\nTOKO: [nama toko dari text, jika tidak ada tulis 'Manual Input']\nTOTAL: [total harga dalam angka saja tanpa Rp/ribu/rb]\nITEMS: [daftar barang yang dibeli dengan kuantitas]\nTANGGAL: {{ $now.format('yyyy-MM-dd') }}\n\nCONTOH:\nInput: \"beli Telur 1kg Rp 20rb di Toko Mbak Ita\"\nOutput:\nTOKO: Toko Mbak Ita\nTOTAL: 20000\nITEMS: Telur 1kg\nTANGGAL: 2025-06-19\n\nInput: \"beli susu ultra 2 botol sama roti tawar 15 ribu\"\nOutput:\nTOKO: Manual Input\nTOTAL: 15000\nITEMS: Susu Ultra 2 botol, Roti Tawar\nTANGGAL: 2025-06-19\n\nJika tidak bisa dipahami, berikan:\nERROR: Text belanja tidak dapat dipahami\n\nPENTING: Hanya berikan response dalam format di atas!\nPrompt Lihat Laporan\n\nKamu adalah asisten laporan keuangan untuk user bangtutorial.\n\nINFORMASI WAKTU:\n- Waktu sekarang: {{ $now }}\n- Tanggal hari ini: {{ $today.format('yyyy-MM-dd') }}\n\nTUGAS:\n1. Analisa permintaan user untuk laporan pengeluaran\n2. Gunakan tool \"catatan_keuangan\" untuk ambil data catatan pengeluaran\n3. Filter data sesuai periode yang diminta:\n   - \"hari ini\" \u2192 data tanggal hari ini\n   - \"minggu ini\" \u2192 data tanggal 1 minggu terakhir\n   - \"bulan ini\" \u2192 data dalam bulan ini\n4. Hitung total pengeluaran dan jumlah transaksi\n5. Format laporan yang rapi dalam bahasa Indonesia\n\nSTRUKTUR DATA SHEETS:\n- Kolom A: Toko\n- Kolom B: Total (dalam rupiah)\n- Kolom C: Items \n- Kolom D: Tanggal Struk\n- Kolom E: Tanggal Input\n- Kolom F: Waktu Input\n\nFORMAT LAPORAN:\n\ud83d\udcca *Laporan Pengeluaran [Periode]*\n\ud83d\udcc5 [Rentang Tanggal]\n\n\ud83d\udcb0 *Total Pengeluaran:* Rp [total pengeluaran]\n\ud83d\uded2 *Jumlah Transaksi:* [jumlah] kali\n\n\ud83d\udccb *Detail Transaksi:*\n--\n\ud83d\udcc5 *[Tanggal]*\n\ud83d\udcdd *[Toko]:* [Items]\n\ud83d\udcb5 *Pengeluaran:* Rp [amount]\n--\n\nPENTING: \n- Urutkan transaksi berdasarkan tanggal (terbaru ke terlama)\n- Gunakan format mata uang Indonesia (Rp 43.500)\n- Setiap detail transaksi dipisah dengan garis \"--\"\n- Gunakan emoji sesuai format di atas\n\nJika tidak ada data untuk periode tersebut, beri pesan ramah bahwa belum ada transaksi.\n"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 1.9,
      "position": [
        320,
        380
      ],
      "id": "04c7973d-47a4-4daf-b303-40e132e18c6a",
      "name": "AI Agent"
    },
    {
      "parameters": {
        "modelName": "models/gemini-2.5-flash",
        "options": {
          "temperature": 0.1
        }
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "typeVersion": 1,
      "position": [
        300,
        560
      ],
      "id": "31e035f8-4650-4e44-b2fb-3eeb95b7436e",
      "name": "Google Gemini Chat Model",
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "37689d09-2765-4bea-8660-d512b6f374d5",
              "leftValue": "={{ $json.output }}",
              "rightValue": "ERROR:",
              "operator": {
                "type": "string",
                "operation": "contains"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        660,
        380
      ],
      "id": "6ec22b92-d28e-443b-8266-00e64be35903",
      "name": "If1"
    },
    {
      "parameters": {
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "text": "salah woy",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        920,
        340
      ],
      "id": "cd2212f9-7d4e-444a-9342-678b0c75d0ff",
      "name": "Telegram3",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1YKNaO-4-qYdZSwS9XmIFXNgikBjx_iNU7CO1DC6K1uA",
          "mode": "list",
          "cachedResultName": "Catatan Duit",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1YKNaO-4-qYdZSwS9XmIFXNgikBjx_iNU7CO1DC6K1uA/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1YKNaO-4-qYdZSwS9XmIFXNgikBjx_iNU7CO1DC6K1uA/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Toko": "={{ $json.output.match (/TOKO: (.+)/)[1] }}",
            "Total": "={{ $json.output.match (/TOTAL: (.+)/)[1] }}",
            "Items": "={{ $json.output.match (/ITEMS: (.+)/)[1] }}",
            "Tanggal Struk": "={{ $json.output.match (/TANGGAL: (.+)/)[1] }}",
            "Tanggal Input": "={{ $now.format('yyyy:MM:dd') }}",
            "Waktu Input": "={{ $now.format('HH:mm:ss') }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "Toko",
              "displayName": "Toko",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Total",
              "displayName": "Total",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Items",
              "displayName": "Items",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Tanggal Struk",
              "displayName": "Tanggal Struk",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Tanggal Input",
              "displayName": "Tanggal Input",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Waktu Input",
              "displayName": "Waktu Input",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.6,
      "position": [
        880,
        500
      ],
      "id": "1e961a28-6e8b-442c-9af1-94addbe62d50",
      "name": "Google Sheets1",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "text": "=lah {{ $json['Tanggal Struk'] }}\n{{ $json.Toko }}\n{{ $json.Items }}\n{{ $json.Total }}\n{{ $json['Tanggal Input'] }} {{ $json['Waktu Input'] }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        1100,
        500
      ],
      "id": "32e8afab-732b-40ad-82a3-455e658723a9",
      "name": "Telegram4",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $json.message.text }}",
        "options": {
          "systemMessage": "=Kamu adalah asisten laporan keuangan untuk user bangtutorial.\n\nINFORMASI WAKTU:\n- Waktu sekarang: {{ $now }}\n- Tanggal hari ini: {{ $today.format('yyyy-MM-dd') }}\n\nTUGAS:\n1. Analisa permintaan user untuk laporan pengeluaran\n2. Gunakan tool \"catatan_keuangan\" untuk ambil data catatan pengeluaran\n3. Filter data sesuai periode yang diminta:\n   - \"hari ini\" \u2192 data tanggal hari ini\n   - \"minggu ini\" \u2192 data tanggal 1 minggu terakhir\n   - \"bulan ini\" \u2192 data dalam bulan ini\n4. Hitung total pengeluaran dan jumlah transaksi\n5. Format laporan yang rapi dalam bahasa Indonesia\n\nSTRUKTUR DATA SHEETS:\n- Kolom A: Toko\n- Kolom B: Total (dalam rupiah)\n- Kolom C: Items \n- Kolom D: Tanggal Struk\n- Kolom E: Tanggal Input\n- Kolom F: Waktu Input\n\nFORMAT LAPORAN:\n\ud83d\udcca *Laporan Pengeluaran [Periode]*\n\ud83d\udcc5 [Rentang Tanggal]\n\n\ud83d\udcb0 *Total Pengeluaran:* Rp [total pengeluaran]\n\ud83d\uded2 *Jumlah Transaksi:* [jumlah] kali\n\n\ud83d\udccb *Detail Transaksi:*\n--\n\ud83d\udcc5 *[Tanggal]*\n\ud83d\udcdd *[Toko]:* [Items]\n\ud83d\udcb5 *Pengeluaran:* Rp [amount]\n--\n\nPENTING: \n- Urutkan transaksi berdasarkan tanggal (terbaru ke terlama)\n- Gunakan format mata uang Indonesia (Rp 43.500)\n- Setiap detail transaksi dipisah dengan garis \"--\"\n- Gunakan emoji sesuai format di atas\n\nJika tidak ada data untuk periode tersebut, beri pesan ramah bahwa belum ada transaksi.\n"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 1.9,
      "position": [
        440,
        0
      ],
      "id": "6a26d087-3152-48d6-952b-fd58be44eaca",
      "name": "AI Agent1"
    },
    {
      "parameters": {
        "modelName": "models/gemini-2.5-flash",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "typeVersion": 1,
      "position": [
        420,
        180
      ],
      "id": "b609c9c2-8d66-454e-bc11-e67998a715de",
      "name": "Google Gemini Chat Model1",
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1YKNaO-4-qYdZSwS9XmIFXNgikBjx_iNU7CO1DC6K1uA",
          "mode": "list",
          "cachedResultName": "Catatan Duit",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1YKNaO-4-qYdZSwS9XmIFXNgikBjx_iNU7CO1DC6K1uA/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1YKNaO-4-qYdZSwS9XmIFXNgikBjx_iNU7CO1DC6K1uA/edit#gid=0"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheetsTool",
      "typeVersion": 4.6,
      "position": [
        600,
        220
      ],
      "id": "b43e48e5-498a-4f7c-8106-cca8fab3e69b",
      "name": "Google Sheets2",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "text": "={{ $json.output }}",
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        800,
        0
      ],
      "id": "713fdcc4-86eb-4a2e-a868-bf26a64e4c2e",
      "name": "Telegram5",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "Telegram",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "AI Agent1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code": {
      "main": [
        [
          {
            "node": "HTTP Request1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request1": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If": {
      "main": [
        [
          {
            "node": "Telegram1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets": {
      "main": [
        [
          {
            "node": "Telegram2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "If1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If1": {
      "main": [
        [
          {
            "node": "Telegram3",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Google Sheets1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram3": {
      "main": [
        []
      ]
    },
    "Google Sheets1": {
      "main": [
        [
          {
            "node": "Telegram4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets2": {
      "ai_tool": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent1": {
      "main": [
        [
          {
            "node": "Telegram5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1",
    "timezone": "Asia/Jakarta",
    "callerPolicy": "workflowsFromSameOwner",
    "executionTimeout": -1
  },
  "versionId": "07f03aaf-22bc-4dbe-8f41-dc79301eb4ce",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "kXbePKaf56Zh89cv",
  "tags": []
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Pendataan Belanja. Uses telegramTrigger, telegram, httpRequest, googleSheets. Event-driven trigger; 20 nodes.

Source: https://github.com/ridwaanhall/n8n-pendataan-shopping/blob/main/pendataan_shopping.json — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

This workflow creates a multi-talented AI assistant named Simran that interacts with users via Telegram. It can handle text and voice messages, understand the user's intent, and perform various tasks.

MongoDB, Chain Llm, Google Gemini Chat +11
AI & RAG

This project is a template for building a complete academic virtual assistant using n8n. It connects to Telegram, answers frequently asked questions by querying MongoDB, keeps the community informed a

Telegram, MongoDB, Telegram Trigger +6
AI & RAG

&gt; AI-powered nutrition assistant for Telegram — log meals, set goals, and get personalized daily reports with Google Sheets integration.

Telegram, Google Gemini, Google Gemini Chat +7
AI & RAG

This automation is designed to help you generate AI-powered music tracks, cover art, and fully rendered music videos — all triggered from a simple Telegram chat and managed via Google Sheets.

OpenAI Chat, Memory Buffer Window, Output Parser Structured +11
AI & RAG

LinkedIn URL → Scrape → Match → Screen → Decide, all automated

Google Drive, Agent, Google Drive Tool +6