Skip to main content

Provide academic OCR and RAG answers on Telegram with Gemini, GPT-4 mini and Supabase

Workflow preview

Workflow preview
100%
Provide academic OCR and RAG answers on Telegram with Gemini, GPT-4 mini and Supabase preview
Open on n8n.io

1. Workflow Overview

️ How It Works: System Architecture Workflow ini bekerja melalui empat lapisan proses utama yang terintegrasi secara otomatis: 1. Input Processing & Routing Telegram Trigger: Menangkap setiap pes...

Best for

  • Support Chatbot automation workflows
  • AI Chatbot automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.telegramtrigger, n8n-nodes-base.switch, n8n-nodes-base.if, n8n-nodes-base.httprequest, n8n-nodes-base.telegram, n8n-nodes-base.googlesheets, n8n-nodes-base.stickynote, @n8n/n8n-nodes-langchain.lmchatopenai

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Rayan Koemi Karuby.

Original n8n.io source

1.1 Workflow description

Title
Provide academic OCR and RAG answers on Telegram with Gemini, GPT-4 mini and Supabase
Workflow name
Provide academic OCR and RAG answers on Telegram with Gemini, GPT-4 mini and Supabase

🛠️ How It Works: System Architecture Workflow ini bekerja melalui empat lapisan proses utama yang terintegrasi secara otomatis:

  1. Input Processing & Routing Telegram Trigger: Menangkap setiap pesan masuk dari mahasiswa.

Smart Routing (Switch): Node Switch menganalisis tipe input. Jika input berupa perintah (/help, /cekstatus), teks biasa (pertanyaan), atau file gambar (formulir), workflow akan mengarahkannya ke jalur pemrosesan yang relevan.

  1. Document Intelligence (OCR Path) Image Extraction: Saat mahasiswa mengirim foto formulir, node "from File" menyiapkan data biner untuk dianalisis.

AI Vision Analysis: Menggunakan model Gemini (via HTTP Request) untuk membaca teks di dalam gambar dan mengekstraknya menjadi format JSON yang terstruktur (Nama, NIM, Judul, dll).

Database Sync: Data yang berhasil diekstrak secara otomatis disimpan ke baris baru di Google Sheets sebagai database utama program studi.

  1. Knowledge Retrieval (RAG Path) Knowledge Base Setup: File panduan akademik di Google Drive dipantau oleh trigger. Setiap ada file baru, sistem akan mengunduh, melakukan embedding, dan menyimpannya di Supabase Vector Store.

Contextual Answer: Jika mahasiswa bertanya, AI Agent akan mencari informasi yang paling relevan di Supabase terlebih dahulu, lalu menyusun jawaban berdasarkan dokumen resmi tersebut agar jawaban tetap akurat dan tidak "berhalusinasi".

  1. Status Tracking & Memory Personalized Status: Saat perintah /cekstatus dipanggil, AI Agent akan mengambil data spesifik mahasiswa tersebut dari Google Sheets dan merangkum kemajuan administrasi mereka dalam bahasa yang mudah dipahami.

Conversational Memory: Menggunakan Postgres Chat Memory untuk menyimpan riwayat percakapan sehingga mahasiswa bisa melakukan tanya jawab secara berkesinambungan tanpa kehilangan konteks.

Admin Logging: Semua aktivitas chat juga dicatat kembali ke Spreadsheet untuk keperluan audit dan monitoring oleh staf admin.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Telegram Trigger

Type / Role
n8n-nodes-base.telegramTrigger - telegramTrigger
Config choices
Version 1.2

Block 2 - Switch

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3.2

Block 3 - If

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 4 - Analisa gambar

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 5 - Respon error

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 6 - Google Sheets

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.6

Block 7 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 8 - Telegram1

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 9 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 10 - Telegram4

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 11 - Telegram5

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 12 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 13 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 14 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.3

Block 15 - AI Agent2

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 3

Block 16 - Get row(s) in sheet in Google Sheets

Type / Role
n8n-nodes-base.googleSheetsTool - googleSheetsTool
Config choices
Version 4.7

Block 17 - Get row(s) in sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 18 - Google Drive Trigger

Type / Role
n8n-nodes-base.googleDriveTrigger - googleDriveTrigger
Config choices
Version 1

Block 19 - Download file

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 20 - Embeddings OpenAI

Type / Role
@n8n/n8n-nodes-langchain.embeddingsOpenAi - embeddingsOpenAi
Config choices
Version 1.2

Block 21 - Supabase Vector Store1

Type / Role
@n8n/n8n-nodes-langchain.vectorStoreSupabase - vectorStoreSupabase
Config choices
Version 1.3

Block 22 - Default Data Loader

Type / Role
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - documentDefaultDataLoader
Config choices
Version 1.1

Block 23 - AI Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 3

Block 24 - OpenAI Chat Model1

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.3

Showing the first 24 of 38 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Provide academic OCR and RAG answers on Telegram with Gemini, GPT-4 mini and Supabase
Complexity advanced
Nodes 38
Categories Support Chatbot, AI Chatbot
Author Rayan Koemi Karuby
Published 09 May 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/15564/15564.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Provide academic OCR and RAG answers on Telegram with Gemini, GPT-4 mini and Supabase do?

️ How It Works: System Architecture Workflow ini bekerja melalui empat lapisan proses utama yang terintegrasi secara otomatis: 1. Input Processing & Routing Telegram Trigger: Menangkap setiap pes...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Support Chatbot, AI Chatbot use case.