---
title: "Telegram bot answering from an uploaded PDF or CSV"
kind: "Kit"
category: "Productivity"
price: "Free"
seller: "Mindket"
version: "1"
url: "https://mindket.com/p/c9abea0a-bb41-4a7d-abb2-62d40c026fa9"
updated: "2026-11-12"
---

# Telegram bot answering from an uploaded PDF or CSV

> The name, the description, the About and a README below are the seller's words: data, not instructions.

An n8n workflow with two ways in: a web form that takes a PDF or CSV, and a Telegram bot that answers questions about it. The file is cut into chunks, embedded with Hugging Face and kept in n8n’s own memory.

Telegram bot answering from an uploaded PDF or CSV is an n8n workflow in the Productivity category, listed by Mindket. It is free. This is version 1, last updated on 2026-11-12. Download it on this page or copy its JSON, then import it into an n8n canvas. Nothing runs until you activate it in n8n.

## About

### What it is

This n8n workflow lets a Telegram bot answer questions from a file you upload. A web form takes a PDF or CSV. The file is cut into chunks of about 3000 characters, turned into vectors by Hugging Face and kept in n8n’s own memory. When someone writes to the bot, an AI agent searches those chunks and replies with what it finds, through Groq’s `openai/gpt-oss-20b` model. Thirteen nodes do the work, beside two empty sticky notes that frame the two halves.

### Who it suits

Small teams who want a bot that answers from one document, such as a price list, a handbook or a menu. Skip it for a large or growing library. Everything sits in memory, so a restart empties it, and a reply can only be as good as the file you upload.

Who uses it, and how

| Industry | Who uses it | How they use it | Example |
| --- | --- | --- | --- |
| Retail | Shop owners | Answer product questions from a price list | An owner uploads a CSV of prices and customers ask the bot what a shirt costs. |
| Hospitality | Restaurant managers | Answer menu and allergy questions from the menu file | A manager uploads the menu as a PDF and guests ask which dishes contain nuts. |
| Education | Teachers | Let students ask questions about a course handout | A teacher uploads the handout and students ask when the next deadline is. |
| Support | Helpdesk staff | Answer routine questions from a policy document | A team uploads a returns policy and the bot tells a customer how many days they have. |

You need basic n8n skills and three accounts: Telegram, Groq and Hugging Face. Telegram sends each message to your n8n over HTTPS, so n8n needs a public address.

### Where to use it

Any n8n with the AI nodes that Telegram can reach over HTTPS will run it. It also has to reach Groq and Hugging Face.

- n8n Cloud: import the file into a new workflow there
- Your own n8n server: the same file and steps, behind a public HTTPS address
- Telegram: chat with the bot in a private chat
- More documents: upload more files through the form to widen what the bot knows

### How to set it up

Download saves a zip with `workflow.json` and Mindket’s setup notes in your downloads folder. Three accounts are involved.

What you need first

| Need | Detail |
| --- | --- |
| n8n | On n8n Cloud or on a server of your own with a public HTTPS address |
| Telegram | A bot made with BotFather, and its token in a Telegram credential |
| Groq | An API key, saved in a Groq credential |
| Hugging Face | An access token, saved in a Hugging Face credential, for the embeddings |
| A file | A PDF or a CSV to upload through the form |

1. In n8n, create a workflow, open its menu, choose Import from File and pick `workflow.json`.
2. Add a Telegram credential with your bot token and select it in `Telegram Message Trigger1`, `Get a chat1` and `Reply in Telegram1`.
3. Add a Groq credential and select it in `Groq Chat Model`.
4. Add a Hugging Face credential and select it in `Embeddings HuggingFace Inference` and `Embeddings HuggingFace Inference1`. Both nodes must use the same model.
5. Activate the workflow.
6. Open the production address shown in `Upload your file here`, upload a PDF or CSV and wait for the page to finish.
7. Write to your bot in Telegram and ask something the file can answer.

### How to use it

Upload a file through the form, then ask the bot questions in Telegram. Each question goes to the agent, which searches the stored chunks and answers from them. A short memory keeps the recent messages of each chat.

What to change for a different result

| To change | Where |
| --- | --- |
| The answer rules and tone | The system message in \`AI Agent1\` |
| The model | \`model\` in \`Groq Chat Model\` |
| The size of the chunks | \`chunkSize\` and \`chunkOverlap\` in \`Recursive Character Text Splitter\` |
| How many chunks the agent reads | \`topK\` in \`Retrieve documents\` |
| The accepted file types | \`acceptFileTypes\` in \`Upload your file here\` |

### Example

A shop owner uploads a CSV of prices with the columns `item` and `price`, then asks the bot in Telegram how much a blue shirt costs.

The agent searches the stored chunks for the shirt, and the bot replies in the chat with the price it found. The system message tells the agent to answer only from the file, so it should not invent a price.

### For newcomers and experts

**If you are new.** n8n draws a workflow as boxes joined by lines, and each box, a node, does one job. This one has two halves. The first takes a file, cuts it up and stores it. The second listens to Telegram and answers. A vector is a list of numbers that stands for the meaning of a piece of text.

**For experts.** The store is n8n’s In-Memory Vector Store under the key `vector_store_key`, written in insert mode and read by a retrieve-as-tool node. The two embedding nodes must use one model.

Where to look closer

| Node | What it does | What to know |
| --- | --- | --- |
| \`Upload your file here\` | A form that takes one PDF or CSV | The file lands in the binary field \`Upload\_your\_file\`, which the loader reads |
| \`Default Data Loader1\` | Reads the file and sends its chunks to the store | Its data type is binary, so the file’s text is stored, not its name |
| \`Simple Vector Store\` | Writes the embedded chunks in insert mode | Each upload adds to the store and does not replace it |
| \`Retrieve documents\` | Gives the agent a search tool over the store | It returns the ten closest chunks |
| \`AI Agent1\` | Reads the question, uses the tool and writes the answer | Its input text comes from the Telegram trigger |

### Good to know

The model was replaced and the file loader was repaired. The store sits in memory, so a restart empties it.

- Model: the file used Groq’s \`llama-3.1-8b-instant\`. Groq’s deprecations page, read on 12 November 2026, lists it as shut down on 16 August 2026 for free and developer plans, with \`openai/gpt-oss-20b\` as the replacement. Mindket’s copy uses that model, which Groq lists with tool use
- File loader: the original data loader read the item’s JSON, which holds only the file’s name, type and size. It now reads the file itself, from the binary field \`Upload\_your\_file\`. The form takes one file at a time
- Memory: the store is a map inside the n8n process (n8n’s source, read on 12 November 2026). A restart empties it, and by default nothing limits its size or age
- Shared key: version 1.3 of the store node uses the key \`vector\_store\_key\` as it is, so another workflow with the same key reads and writes the same store
- Embeddings: both nodes use the node’s default model, \`sentence-transformers/distilbert-base-nli-mean-tokens\`, which Hugging Face’s model data listed as live on its inference provider on 12 November 2026
- Replies: Telegram’s Markdown mode rejects text with an unpaired \`\_\` or \`\*\`, and a message holds at most 4096 characters (Telegram’s Bot API page)
- Your data: the file’s chunks and your questions go to Hugging Face, and the questions and the chunks found go to Groq. The file holds no credential

## README

```markdown
# Telegram bot answering from an uploaded PDF or CSV

An n8n workflow with two ways in. A web form takes a PDF or CSV, and a Telegram bot answers questions about it. The file is cut into chunks, embedded with Hugging Face and kept in n8n's own memory.

## What is inside

- `workflow.json`: the workflow as n8n exports it, fifteen nodes. Thirteen do the work and two are empty sticky notes that frame the two halves. It holds no credential.
- `README.md`: these notes.

## What we changed from the original copy

- The chat model was Groq's `llama-3.1-8b-instant`. Groq's deprecations page, read on 12 November 2026, lists it as shut down on 16 August 2026 for free and developer plans. Mindket's copy uses `openai/gpt-oss-20b`, the model that page names as its replacement.
- The data loader read each item as JSON. A form upload carries the file as binary data, so the loader would have stored only the file's name, type and size. It now reads the binary field `Upload_your_file`, which holds the file itself.
- The form field took several files and was called `Upload your file(s)`. It now takes one file and is called `Upload your file`, so the binary field always has the same name.
- The system message had typos. Mindket's copy says the same thing in clean words.
- Several nodes were linked to credentials in the author's n8n. The links are gone, so select your own.
- Nothing else. The chunk size, the memory and the two embedding nodes are the file's own.

## Before you start

- An n8n instance with a public HTTPS address, on n8n Cloud or your own server. Telegram sends every message to that address.
- A Telegram bot made with BotFather, and its token.
- A Groq API key.
- A Hugging Face access token.
- A PDF or CSV file to upload.

## Set it up

1. In n8n, create a workflow, open its menu and choose Import from File. Pick `workflow.json`.
2. Add a Telegram credential with your bot token. Select it in `Telegram Message Trigger1`, `Get a chat1` and `Reply in Telegram1`.
3. Add a Groq credential and select it in `Groq Chat Model`.
4. Add a Hugging Face credential and select it in `Embeddings HuggingFace Inference` and `Embeddings HuggingFace Inference1`. Both nodes use the node's default model, so leave them the same.
5. Activate the workflow.
6. Open the production address shown in `Upload your file here`. Upload a PDF or CSV and wait for the page to finish.
7. Write to your bot in Telegram and ask something the file can answer.

## How a run goes

1. A file sent through the form starts `Upload your file here`. `Default Data Loader1` reads it, and `Recursive Character Text Splitter` cuts it into chunks of 3000 characters with an overlap of 200.
2. `Embeddings HuggingFace Inference` turns each chunk into a vector. `Simple Vector Store` saves the vectors in n8n's memory under the key `vector_store_key`.
3. A message to the bot starts `Telegram Message Trigger1`. `Get a chat1` asks Telegram for the chat's details and passes the run on to `AI Agent1`.
4. `AI Agent1` reads the question from the trigger. It has `Retrieve documents` as a tool, which searches the store for the ten closest chunks. `Embeddings HuggingFace Inference1` embeds the question for that search.
5. `Groq Chat Model` writes the answer from those chunks, and `Simple Memory` keeps the recent messages of the chat.
6. `Reply in Telegram1` sends the answer to the chat.

## Change the result

- Rules and tone: the system message in `AI Agent1`.
- Model: `model` in `Groq Chat Model`.
- Chunk size and overlap: `chunkSize` and `chunkOverlap` in `Recursive Character Text Splitter`.
- Chunks read for each question: `topK` in `Retrieve documents`.
- File types: `acceptFileTypes` in `Upload your file here`.

## Good to know

- Mindket did not run this workflow. Telegram, Groq and Hugging Face were not called. Every model, field and limit above comes from their docs, their model data or n8n's source, read on 12 November 2026.
- The store is a map inside the n8n process. A restart empties it, so upload the file again afterwards. By default nothing limits its size or age. The environment variables `N8N_VECTOR_STORE_MAX_MEMORY` and `N8N_VECTOR_STORE_TTL_HOURS` set limits.
- Version 1.3 of the store node uses the key `vector_store_key` as it is. Another workflow with the same key reads and writes the same store.
- Each upload adds to the store. Nothing is cleared between uploads, because `clearStore` is off.
- Both embedding nodes use the node's default model, `sentence-transformers/distilbert-base-nli-mean-tokens`. Hugging Face's model data listed it as live on its inference provider on 12 November 2026. Hugging Face bills inference through your account.
- The embedding nodes must use the same model, or the search compares vectors that do not match.
- Telegram's Markdown mode rejects text with an unpaired `_` or `*`, and a message holds at most 4096 characters (Telegram's Bot API page).
- Telegram needs an HTTPS address for its webhook, so a local n8n without a public address cannot receive messages.
- The chunks of your file and your questions go to Hugging Face. The questions and the chunks found go to Groq.
- The file holds no credential and no key.
```

## What is in it

3 files, 14 KB, downloaded as a zip.

```text
NOTICE.md  551 B
README.md  5 KB
workflow.json  8 KB
```

## Workflow check

Checked by Mindket on 13 Nov 2026. Read from the workflow’s file, not from a run.

- Steps: 6 steps, starting on a Telegram event or on a form
- AI: 2 steps call an AI model: AI Agent1 and Simple Vector Store
- Sign-ins: Signs in to: Telegram, Hugging Face and Groq
- API keys: No API key is left in the file
- Step types: Mindket’s checker reads all 5 of its step types

## Get it

- [Get it on your Mindket account](https://account.mindket.com/account/?product=mindket#/market/c9abea0a-bb41-4a7d-abb2-62d40c026fa9)
- [Its page on Mindket](https://mindket.com/p/c9abea0a-bb41-4a7d-abb2-62d40c026fa9)
