AutomationFlowsAI & RAG › Strukpintar Workflow

Strukpintar Workflow

Strukpintar-Workflow. Uses httpRequest, telegram, lmChatGoogleGemini, agent. Event-driven trigger; 21 nodes.

Event trigger★★★★☆ complexityAI-powered21 nodesHTTP RequestTelegramGoogle Gemini ChatAgentTelegram TriggerGoogle Sheets ToolGoogle Sheets
AI & RAG Trigger: Event Nodes: 21 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
{
  "nodes": [
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "ad99e257-bcaf-42a2-b068-53e0c96729db",
                    "leftValue": "={{ $json.message.photo[3] }}",
                    "rightValue": "",
                    "operator": {
                      "type": "object",
                      "operation": "exists",
                      "singleValue": true
                    }
                  }
                ],
                "combinator": "and"
              }
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "69cae014-32a5-44e4-abb1-bd8324df9b65",
                    "leftValue": "={{ $json.message.text }}",
                    "rightValue": "=/laporan",
                    "operator": {
                      "type": "string",
                      "operation": "startsWith"
                    }
                  }
                ],
                "combinator": "and"
              }
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "4f8d9425-641e-4044-a54a-d73444ea28e0",
                    "leftValue": "={{ $json.message.text }}",
                    "rightValue": "/help",
                    "operator": {
                      "type": "string",
                      "operation": "startsWith"
                    }
                  }
                ],
                "combinator": "and"
              }
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "41e89fcf-d3a4-4a71-9a0b-5b0d7ea841fc",
                    "leftValue": "={{ $json.message.text }}",
                    "rightValue": "/",
                    "operator": {
                      "type": "string",
                      "operation": "exists",
                      "singleValue": true
                    }
                  }
                ],
                "combinator": "and"
              }
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.2,
      "position": [
        176,
        48
      ],
      "id": "23b1d2b6-f268-452e-b35e-0840e931fe95",
      "name": "Switch"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": false,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "23f4316d-5a77-45ae-81e7-18ee4cacb995",
              "leftValue": "={{ $json.candidates[0].content.parts[0].text }}",
              "rightValue": "ERROR:",
              "operator": {
                "type": "string",
                "operation": "contains"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {
          "ignoreCase": true
        }
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        688,
        352
      ],
      "id": "ffe56c53-1da1-4981-ba1e-361d18df3337",
      "name": "If"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=YOUR_GEMINI_API_KEY",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"contents\": [\n    {\n      \"parts\": [\n        {\n          \"text\": \"Analisa struk belanja pada gambar ini dan berikan informasi dalam format yang PERSIS seperti ini:\\n\\nTOKO: [nama toko dari struk]\\nTOTAL: [total pembayaran dalam format Rupiah dengan titik pemisah ribuan, contoh: Rp 25.500]\\nITEMS: [daftar barang yang dibeli, pisahkan dengan koma]\\nTANGGAL: [tanggal transaksi dalam format dd MMMM yyyy, contoh: 03 Juli 2025]\\n\\nContoh response yang benar:\\nTOKO: Alfamart\\nTOTAL: Rp 25.500\\nITEMS: Susu Ultra 1L, Roti Tawar, Sabun Lifebuoy\\nTANGGAL: 19 Juni 2025\\n\\nJika struk tidak jelas atau tidak bisa dibaca, berikan:\\nERROR: Struk tidak dapat dibaca dengan jelas\\n\\nCatatan penting:\\n- Apapun mata uang yang muncul pada struk (misalnya USD, SGD, MYR, EUR, CHF, dll), konversikan otomatis ke IDR (Rupiah) menggunakan kurs estimasi terkini.\\n- Tampilkan hasil akhir dalam format Rupiah, contoh: Rp 123.456.\\n- Abaikan detail lain seperti nilai pajak asing, cukup tampilkan total akhir setelah dikonversi ke IDR.\\n- Jangan ubah format output lainnya.\"\n        },\n        {\n          \"inlineData\": {\n            \"mimeType\": \"image/jpeg\",\n            \"data\": \"{{ $json.data }}\"\n          }\n        }\n      ]\n    }\n  ]\n}\n",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        848,
        96
      ],
      "id": "e42d6f78-e850-4675-90be-b1e3d9c7b32d",
      "name": "Analisa gambar"
    },
    {
      "parameters": {
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "text": "Struk tidak dapat dibaca dengan jelas.\n\nPastikan:\n- Foto struk jelas dan tidak blur\n- Pencahayaan cukup\n- Semua text terlihat\n\nSilakan coba foto ulang! \ud83d\udcf7",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        672,
        592
      ],
      "id": "ec96ced5-d877-48d0-adf9-e9550015bf11",
      "name": "Respon error",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "options": {
          "temperature": 0.1
        }
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "typeVersion": 1,
      "position": [
        -688,
        336
      ],
      "id": "aa3595f7-943a-4130-9833-c97052213bb2",
      "name": "Google Gemini Chat Model",
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $json.message.text }}",
        "options": {
          "systemMessage": "=TUGAS: Analisa teks belanja dan ubah menjadi format PERSIS seperti ini:\n\nTOKO: [nama toko dari teks, kamu harus pintar mencari kunci misal user nulis dipasar senin maka bisa kamu tulis toko itu pasar senin jika tidak ada tulis 'Manual Input']\n\nTOTAL: [total harga dalam Rp/ribu/rb gunakan titik juga di pemisah rupiahnya, tambahkan juga Rp sebelum nominalnya]\n\nITEMS: [daftar barang yang dibeli beserta kuantitas, pisahkan dengan koma jika lebih dari satu pastikan awalan text huruf kapital atau besar dan tanda , diberi sepasi sekali contoh yang benar \"Ikan, Sepatu, Sepeda\" pastiin awal text harus kapital semua hal]\n\nTANGGAL STRUK: [tanggal dari struk jika disebut, contoh: \"tanggal 2 kemarin\" jadi 02 {{ $now.minus({ days: 1 }).toFormat(\"MMMM yyyy\") }}, jika tidak ada gunakan {{ $now.toFormat(\"dd MMMM yyyy\") }}]\n\nTANGGAL: {{ $now.toFormat(\"dd MMMM yyyy\") }}\n\nContoh jika user menulis: tanggal 2 bulan kemarin, maka parsing menjadi  \nTANGGAL STRUK: {{ $now.minus({ months: 1 }).set({ day: 2 }).toFormat(\"dd MMMM yyyy\") }}\n\nBerikut referensi parsing tanggal lainnya:\n\ntanggal 2 bulan ini  \n{{ $now.set({ day: 2 }).toFormat(\"dd MMMM yyyy\") }}\n\ntanggal 2 bulan kemarin  \n{{ $now.minus({ months: 1 }).set({ day: 2 }).toFormat(\"dd MMMM yyyy\") }}\n\ntanggal 15 bulan depan  \n{{ $now.plus({ months: 1 }).set({ day: 15 }).toFormat(\"dd MMMM yyyy\") }}\n\ntanggal 2 tapi seakan \"kemarin\" (jadi 2 hari lalu dari hari ini)  \n{{ $now.minus({ days: $now.day - 2 }).toFormat(\"dd MMMM yyyy\") }}\n\nCONTOH:\n\nInput: beli Daging Sapi Premium 2kg Rp 150rb di Pasar Segar pagi ini  \nOutput:\n\nTOKO: Pasar Segar  \nTOTAL: Rp 150.000  \nITEMS: Daging Sapi Premium 2kg  \nTANGGAL STRUK: {{ $now.toFormat(\"dd MMMM yyyy\") }}  \nTANGGAL: {{ $now.toFormat(\"dd MMMM yyyy\") }}\n\nInput: beli Beras Organik 5kg Rp 250rb di Gudang Sembako kemarin  \nOutput:\n\nTOKO: Gudang Sembako  \nTOTAL: Rp 250.000  \nITEMS: Beras Organik 5kg  \nTANGGAL STRUK: {{ $now.minus({ days: 1 }).toFormat(\"dd MMMM yyyy\") }}  \nTANGGAL: {{ $now.toFormat(\"dd MMMM yyyy\") }}\n\nInput: beli Minyak Goreng 2 liter Rp 80rb di Alfamart tanggal 2 kemarin  \nOutput:\n\nTOKO: Alfamart  \nTOTAL: Rp 80.000  \nITEMS: Minyak Goreng 2 liter  \nTANGGAL STRUK: 02 {{ $now.minus({ days: 1 }).toFormat(\"MMMM yyyy\") }}  \nTANGGAL: {{ $now.toFormat(\"dd MMMM yyyy\") }}\n\nInput: beli Susu Kambing Etawa 3 kotak sama Madu Hutan Rp 300rb  \nOutput:\n\nTOKO: Manual Input  \nTOTAL: Rp 300.000  \nITEMS: Susu Kambing Etawa 3 kotak, Madu Hutan  \nTANGGAL STRUK: {{ $now.toFormat(\"dd MMMM yyyy\") }}  \nTANGGAL: {{ $now.toFormat(\"dd MMMM yyyy\") }}\n\nJika tidak bisa dipahami, balas dengan:\n\nERROR: Text belanja tidak dapat dipahami\n"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2,
      "position": [
        -560,
        256
      ],
      "id": "2f6ce233-0ab2-410f-bd0d-53fd897b334e",
      "name": "AI Agent"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": false,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "58fafc3a-fff2-4a25-896c-ea90769b0c9a",
              "leftValue": "={{ $json.output }}",
              "rightValue": "ERROR:",
              "operator": {
                "type": "string",
                "operation": "contains"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {
          "ignoreCase": true
        }
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        -512,
        496
      ],
      "id": "df0e052d-9522-4252-a9cf-75cb7a858bef",
      "name": "If1"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $json.message.text }}",
        "options": {
          "systemMessage": "=Kamu adalah asisten pencatatan dan laporan pembelian usaha 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 struk pembelian atau pengeluaran usaha.\n2. Gunakan tool \"catatan_keuangan\" untuk mengambil data catatan pembelian dari Google Sheets.\n3. Filter data sesuai periode yang diminta:\n   - \"hari ini\" \u2192 transaksi dengan tanggal hari ini\n   - \"minggu ini\" \u2192 transaksi dalam 7 hari terakhir\n   - \"bulan ini\" \u2192 transaksi dalam bulan berjalan\n4. Hitung total pengeluaran dan jumlah transaksi.\n5. Sajikan laporan dalam format yang rapi, jelas, dan mudah dipahami oleh pemilik/karyawan usaha.\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 (WAJIB):\n\n\ud83d\udcca Laporan Struk Pembelian [Periode]\n\ud83d\udcc5 Periode: [Rentang Tanggal]\n\n\ud83d\udcb0 Total Pengeluaran: Rp [total pengeluaran]\n\ud83d\uded2 Jumlah Transaksi: [jumlah] kali\n\n\ud83d\udccb Rincian Pembelian:\n--\n\ud83d\udcc5 [Tanggal]\n\ud83d\udcdd Toko: [Nama Toko]\n\ud83d\udce6 Barang: [Items]\n\ud83d\udcb5 Pengeluaran: Rp [amount]\n--\n\nPENTING:\n- Urutkan transaksi berdasarkan tanggal (terbaru ke terlama).\n- Gunakan format mata uang Indonesia (contoh: Rp 43.500).\n- Pisahkan setiap transaksi dengan garis \"--\".\n- Gunakan emoji sesuai format di atas.\n- Gunakan bahasa formal-ringan yang sesuai konteks usaha ritel.\n\nKONDISI KHUSUS:\nJika tidak ada data pada periode tersebut, tampilkan pesan berikut:\n\n\ud83d\udced Belum ada struk pembelian yang tercatat pada periode ini.\n"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2,
      "position": [
        112,
        336
      ],
      "id": "7eb06781-7fba-4fca-a826-7c0bd9fc7bc8",
      "name": "AI Agent1"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "typeVersion": 1,
      "position": [
        0,
        528
      ],
      "id": "2b195e1a-4eaa-4020-97ff-20229a58e401",
      "name": "Google Gemini Chat Model1",
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "text": "={{ $json.output }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        464,
        384
      ],
      "id": "1551c968-21fd-4385-803b-7fe3f9c6d57d",
      "name": "Telegram4",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegramTrigger",
      "typeVersion": 1.2,
      "position": [
        0,
        0
      ],
      "id": "b817b49f-c190-4a3b-9de5-6d5923edb2f5",
      "name": "Telegram Trigger",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "YOUR_GOOGLE_SHEETS_DOCUMENT_ID",
          "mode": "list",
          "cachedResultName": "StrukPintar",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEETS_DOCUMENT_ID/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEETS_DOCUMENT_ID/edit#gid=0"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheetsTool",
      "typeVersion": 4.6,
      "position": [
        320,
        528
      ],
      "id": "5a6dc46a-e3d0-4d5c-9628-c6d08ab75313",
      "name": "Get row(s) in sheet in Google Sheets",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "YOUR_GOOGLE_SHEETS_DOCUMENT_ID",
          "mode": "list",
          "cachedResultName": "StrukPintar",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEETS_DOCUMENT_ID/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEETS_DOCUMENT_ID/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": "={{ DateTime.now().setLocale(\"id\").toFormat(\"dd MMMM yyyy\") }}",
            "Waktu Input": "={{ $now.setZone('Asia/Jakarta').toFormat('HH.mm.ss') + ' ' + ($now.setZone('Asia/Jakarta').hour < 12 ? 'AM' : 'PM') }}"
          },
          "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": [
        944,
        352
      ],
      "id": "314c3bee-15c9-4f9f-9c35-db1d60086b82",
      "name": "Append row in sheet",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "YOUR_GOOGLE_SHEETS_DOCUMENT_ID",
          "mode": "list",
          "cachedResultName": "StrukPintar",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEETS_DOCUMENT_ID/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEETS_DOCUMENT_ID/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 STRUK: (.+)/)[1] }}",
            "Tanggal Input": "={{ $json.output.match(/TANGGAL: (.+)/)[1] }}",
            "Waktu Input": "={{ $now.setZone('Asia/Jakarta').toFormat('HH.mm.ss') + ' ' + ($now.setZone('Asia/Jakarta').hour < 12 ? 'AM' : 'PM') }}\n"
          },
          "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": [
        -512,
        640
      ],
      "id": "7facf9d7-49ce-4082-856f-79ebd16ad8b7",
      "name": "Append row in sheet1",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "chatId": "={{ $json.message.chat.id }}",
        "text": "\ud83e\udd16 Bot Catatan Barang Masuk\n\n\ud83d\udcf8 Kirim foto nota barang \u2192 Otomatis dicatat\n\u270d\ufe0f Ketik data masuk \u2192 \"masuk 2 dus mie sedap dari Gudang Pusat 120rb\"\n\ud83d\udcca Cek laporan stok \u2192 /laporan hari ini\n\n\ud83d\udca1 Perintah yang tersedia:\n\u2022 /laporan hari ini \u2013 Barang masuk hari ini\n\u2022 /laporan minggu ini \u2013 Barang masuk minggu ini\n\u2022 /laporan bulan ini \u2013 Barang masuk bulan ini\n\u2022 /help \u2013 Panduan lengkap penggunaan bot\n\nMulai dengan kirim foto nota atau ketik barang masuk ke gudang Anda! \ud83d\ude9b\ud83d\udce6",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        -160,
        336
      ],
      "id": "bd463018-a229-4010-a1b0-393ee03a0898",
      "name": "Send a text message",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "url": "=https://api.telegram.org/botYOUR_TELEGRAM_BOT_TOKEN/getFile?file_id={{ $json.message.photo[3].file_id }}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        384,
        96
      ],
      "id": "180a4491-7d03-4ddc-8aaf-cb86ab260229",
      "name": "HTTP Request"
    },
    {
      "parameters": {
        "url": "=https://api.telegram.org/file/botYOUR_TELEGRAM_BOT_TOKEN/{{ $json.result.file_path }}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        528,
        96
      ],
      "id": "3f969773-448e-4d1f-94b2-a5d544f122ab",
      "name": "HTTP Request1"
    },
    {
      "parameters": {
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "text": "=\u2705 Pencatatan Barang Masuk Berhasil!\n\nHalo! \ud83d\udc4b\ud83c\udffb\nSistem telah mencatat data barang masuk dengan sukses, Berikut rincian yang berhasil direkam\n\nNama Toko: {{$json[\"Toko\"]}}  \nTotal Pembayaran: {{$json[\"Total\"]}}  \nDaftar Barang: {{$json[\"Items\"]}}  \nTanggal pada Struk: {{$json[\"Tanggal Struk\"]}}  \nTanggal Input: {{$json[\"Tanggal Input\"]}}  \nWaktu Input: {{$json[\"Waktu Input\"]}}  \n\n\ud83d\udcc4 Data telah tersimpan otomatis ke Google Sheets!\n\ud83d\udd17 Cek catatan lengkapnya lewat link di bio bot kami.\n\nTerima kasih telah menggunakan layanan kami! \ud83d\ude80",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        928,
        592
      ],
      "id": "42d7fdd4-f921-44da-a7ca-3058b6ca0c0d",
      "name": "respon sukses",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "text": "=\u2705 Pencatatan Barang Masuk Berhasil!\n\nHalo! \ud83d\udc4b\ud83c\udffb\nSistem telah mencatat data barang masuk dengan sukses, Berikut rincian yang berhasil direkam\n\nNama Toko: {{$json[\"Toko\"]}}  \nTotal Pembayaran: {{$json[\"Total\"]}}  \nDaftar Barang: {{$json[\"Items\"]}}  \nTanggal pada Struk: {{$json[\"Tanggal Struk\"]}}  \nTanggal Input: {{$json[\"Tanggal Input\"]}}  \nWaktu Input: {{$json[\"Waktu Input\"]}}  \n\n\ud83d\udcc4 Data telah tersimpan otomatis ke Google Sheets!\n\ud83d\udd17 Cek catatan lengkapnya lewat link di bio bot kami.\n\nTerima kasih telah menggunakan layanan kami! \ud83d\ude80",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        -512,
        784
      ],
      "id": "449213c0-8a41-42b9-aba1-158dccd021e3",
      "name": "Send a text message1",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "text": "\u274c Maaf, teks barang masuk tidak bisa dipahami.\n\nContoh penulisan yang benar:\n\u2022 barang masuk telur 1kg Rp 25rb di Toko Mbak Ita tanggal 2 kemarin\n\u2022 barang masuk mie indomie 5 bungkus 12.000 dari alfamart tanggal 3\n\u2022 barang masuk bakso 2 porsi 20 ribu kemarin sore\n\u2022 barang masuk kopi kapal api 3 bungkus 25rb tanggal 15 bulan depan\n\n\ud83d\udca1 Tips:\n\u2022 Sebutkan nama dan jumlah barang\n\u2022 Tambahkan harga jika ada\n\u2022 Sertakan nama toko atau waktu seperti \"kemarin\", \"tanggal 2\", \"bulan depan\", dll\n\nSilakan coba lagi, atau ketik /help untuk bantuan! \ud83d\udcdd",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        -272,
        544
      ],
      "id": "0951a629-597d-45e9-b29a-71257b63f5cb",
      "name": "Send a text message2",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "binaryToPropery",
        "options": {}
      },
      "type": "n8n-nodes-base.extractFromFile",
      "typeVersion": 1,
      "position": [
        688,
        96
      ],
      "id": "d41ebfbd-7d86-432a-964f-903f9c3538ff",
      "name": "Extract from File"
    }
  ],
  "connections": {
    "Switch": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "AI Agent1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send a text message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If": {
      "main": [
        [
          {
            "node": "Respon error",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Append row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analisa gambar": {
      "main": [
        [
          {
            "node": "If",
            "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": "Send a text message2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Append row in sheet1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent1": {
      "main": [
        [
          {
            "node": "Telegram4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet in Google Sheets": {
      "ai_tool": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Append row in sheet": {
      "main": [
        [
          {
            "node": "respon sukses",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append row in sheet1": {
      "main": [
        [
          {
            "node": "Send a text message1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "HTTP Request1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request1": {
      "main": [
        [
          {
            "node": "Extract from File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from File": {
      "main": [
        [
          {
            "node": "Analisa gambar",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "meta": {
    "templateCredsSetupCompleted": true
  }
}

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

Strukpintar-Workflow. Uses httpRequest, telegram, lmChatGoogleGemini, agent. Event-driven trigger; 21 nodes.

Source: https://github.com/ts-wahyupratamaa/strukpintarrr/blob/65e4c9b4f066f7cb5ded0c8a6b1cf74563c37de5/strukpintar-workflow.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

Arvifund - Supabase. Uses httpRequest, telegram, googleSheets, telegramTrigger. Event-driven trigger; 90 nodes.

HTTP Request, Telegram, Google Sheets +8
AI & RAG

Arvifund - Supabase (Fixed v2). Uses httpRequest, telegram, googleSheets, telegramTrigger. Event-driven trigger; 90 nodes.

HTTP Request, Telegram, Google Sheets +9
AI & RAG

Arvifund - Supabase (Fixed v4). Uses httpRequest, telegram, googleSheets, telegramTrigger. Event-driven trigger; 90 nodes.

HTTP Request, Telegram, Google Sheets +9