# Calory tracker & meal logger with Telegram and Gemini: n8n workflow

> Started by an incoming Telegram message, and works across Telegram and n8n data table. It puts Gemini behind a retrieval step, so answers are drawn from...

Source: https://millionrounds.com/workflow/calory-tracker-and-meal-logger-with-telegram-and-gemini (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Data collection](https://millionrounds.com/workflows?category=Data+collection#library)

# Calory tracker & meal logger with Telegram and Gemini

Started by an incoming Telegram message, and works across Telegram and n8n data table. It puts Gemini behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 65 steps, 4 branches: large, and worth reading before you trust it with anything live.

Large Calls a model: Gemini Retrieval

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fcalory-tracker-and-meal-logger-with-telegram-and-gemini)

**65 steps** Large: read it before trusting it with anything live

**4** Branches: places the flow splits

**0** Loops or waits

**2** Services it connects to

## The flow

Starts it 2 Model 21 Logic 16 Service 21

The steps in the order they run, from what starts it. The first 60 of 65.

- 1 **Simple Memory** Memory Buffer Window *Model*
- 2 **Google Gemini Chat Model1** Lm Chat Google Gemini *Model*
- 3 **Simple Memory1** Memory Buffer Window *Model*
- 4 **Telegram Trigger** Telegram trigger *Starts it*
- 5 **Google Gemini Chat Model2** Lm Chat Google Gemini *Model*
- 6 **Google Gemini Chat Model3** Lm Chat Google Gemini *Model*
- 7 **Google Gemini Chat Model4** Lm Chat Google Gemini *Model*
- 8 **Simple Memory2** Memory Buffer Window *Model*
- 9 **Simple Memory3** Memory Buffer Window *Model*
- 10 **Simple Memory4** Memory Buffer Window *Model*
- 11 **logMealAnalysis(tool)** Tool Workflow *Model*
- 12 **Register User** Data Table Tool *Service*
- 13 **Append Meal Data** Data Table Tool *Service*
- 14 **fetchmealdetails** Data Table Tool *Service*
- 15 **updateMeal** Data Table Tool *Service*
- 16 **getUserData** Data Table Tool *Service*
- 17 **getDailyMealReport** Data Table Tool *Service*
- 18 **Update Profile Data** Data Table Tool *Service*
- 19 **Google Gemini Chat Model** Lm Chat Google Gemini *Model*
- 20 **Set Update Profile State** Data Table Tool *Service*
- 21 **Webhook** Webhook *Starts it*
- 22 **The Log Meal Agent** Agent *Model*
- 23 **Register Agent** Agent *Model*
- 24 **Typing…** Telegram *Service*
- 25 **Standardize Input** Set *Logic*
- 26 **Cal AI Router Agent** Agent *Model*
- 27 **Report Agent** Agent *Model*
- 28 **Profile Agent** Agent *Model*
- 29 **Update Meal Agent (Step 3 - Final Output)** Agent *Model*
- 30 **Update Meal Agent (Step 1 - Ask for ID)** Agent *Model*
- 31 **Update Meal Agent (Step 2 - Ask for Desc)** Agent *Model*
- 32 **MarkdownV2** Code *Logic*
- 33 **MarkdownV** Code *Logic*
- 34 **Is User Registered?** Data Table *Service*
- 35 **Sequential Routing** Switch *Logic*
- 36 **Re-Analyze Meal** Google Gemini *Model*
- 37 **MarkdownV3** Code *Logic*
- 38 **MarkdownV4** Code *Logic*
- 39 **Send a text message** Telegram *Service*
- 40 **Send a text message1** Telegram *Service*
- 41 **If** If *Logic*
- 42 **Input Message Router** Switch *Logic*
- 43 **Parse AI Output** Code *Logic*
- 44 **State-Setting Node #1** Data Table *Service*
- 45 **New Description State-Setting Node #2** Data Table *Service*
- 46 **Get Conversation State** Data Table *Service*
- 47 **get_message (register)** Set *Logic*
- 48 **Analyze Text Message** Google Gemini *Model*
- 49 **Download Voice Message** Telegram *Service*
- 50 **Download IMAGE** Telegram *Service*
- 51 **get_error_message** Set *Logic*
- 52 **Save Updated Meal** Data Table *Service*
- 53 **Send a text message2** Telegram *Service*
- 54 **Send a text message3** Telegram *Service*
- 55 **Conversation State Router** Switch *Logic*
- 56 **Format Text Analysis** Set *Logic*
- 57 **Fix mime** Code *Logic*
- 58 **Fix mime5** Code *Logic*
- 59 **Clear the State** Data Table *Service*
- 60 **Merge2** Merge *Logic*

## How it's built

- **Starts on:** An incoming Telegram message
- **Steps:** 65, with 4 branches
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Telegram, n8n data table
- **Model:** Gemini
- **Retrieval:** Answers are drawn from documents you supply, not from the model alone

## Questions

What does it need to run?

An n8n account, plus your own Telegram account, and a key for Gemini. You connect your own accounts after importing it; none are included.

What starts it?

It starts on an incoming Telegram message.

Does it use AI?

Yes. It calls Gemini. Its answers draw on documents you give it, not on the model alone. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 65 steps it is large: read it before trusting it with anything live.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

**Before you run it**

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 65 steps before you point it at anything that matters.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fcalory-tracker-and-meal-logger-with-telegram-and-gemini)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Connects to

Each opens the other workflows that use it.

[Telegram](https://millionrounds.com/workflows?service=Telegram#library)[n8n data table](https://millionrounds.com/workflows?service=n8n+data+table#library)

## Workflows like it

Also data collection, with the same services where possible, closest in size first.

- [**AI-Powered news (stock, economy...) collector with Gemini** 41 steps · calls a model · Gmail, RSS](https://millionrounds.com/workflow/ai-powered-news-stock-economy-collector-with-gemini)
- [**AI-Powered WhatsApp Device Inventory System with Excel** 39 steps · Excel, n8n data table](https://millionrounds.com/workflow/ai-powered-whatsapp-device-inventory-system-with-excel)
- [**Macro tracker with Groq and OpenAI** 32 steps · calls a model · Google Sheets, Qdrant](https://millionrounds.com/workflow/macro-tracker-with-groq-and-openai)
- [**Telegram crypto assistant - trade, send & track wallets** 32 steps · calls a model · Telegram](https://millionrounds.com/workflow/telegram-crypto-assistant-trade-send-and-track-wallets)
- [**Create a virtual outfit try-on Telegram bot with Google Sheets** 30 steps · Google Sheets, Telegram](https://millionrounds.com/workflow/create-a-virtual-outfit-try-on-telegram-bot-with-google-shee)
- [**Personal finance tracker with Telegram Bot and Gemini** 27 steps · calls a model · Google Drive, Google Sheets](https://millionrounds.com/workflow/personal-finance-tracker-with-telegram-bot-and-gemini)
