Library / Monitoring, Ops & Incidents
Monitoring, Ops & Incidents
Log Telegram meal photos and text to Google Sheets with Gemini nutrition analysis
When something happens in a connected app, it monitors systems with Google Gemini using Google Sheets, Telegram.
What it does
## Track calories from Telegram meal photos and text with Gemini, daily targets and Google Sheets A Telegram food diary that does the maths for you. Send a meal photo or type what you ate, and Gemini estimates calories and macros. Everything is logged to Google Sheets, compared with your own daily targets, and you get a summary every evening. ### How it works 1. Parse the message turns each Telegram message into one of: photo, text meal, or a command (/goal, /today, /week, /fix, /undo, /help). 2. Photos go to Gemini Vision, text meals ("2 eggs on toast") to Gemini text. Both return the same structured JSON. Non-food is rejected and nothing is logged. 3. Meals are appended to the Meals tab. /fix half portion re-estimates your last meal and updates its row; /undo marks it as undone. 4. After every action the bot reads your meals and targets and replies with what is left for today. /week shows a 7-day table, average and trend. 5. At 9pm everyone with targets gets a day summary and one practical tip. ### Setup 1. Add Telegram (from @BotFather), Google Gemini (PaLM) API (free key at aistudio.google.com) and Google Sheets credentials. 2. Create a sheet with a Meals tab: meal_id, date, time, user_id, user_name, dish, portion, calories_kcal, protein_g, carbs_g, fat_g, confidence, source, status, notes and a Targets tab: user_id, chat_id, user_name, kcal, protein_g, carbs_g, fat_g, evening_summary. 3. Put the Sheet ID in Config and Config (Every evening at 9pm). 4. Set the workflow timezone, activate, then send /goal 2000 150 200 70 to your bot. ### Customization - Change the summary time in Every evening at 9pm. - Set evening_summary to no in Targets to mute a user.
The steps
- Receive Telegram message
- Parse message
- Route by message type
- Download photo from Telegram
- Estimate meal from photo
- Gemini 3.8 Flash (vision)
- Photo nutrition JSON
- Estimate meal from text
- Gemini 3.5 Flash-Lite
- Text nutrition JSON
- Is it food?
- Read my meals for lookup
- Find my last meal
- Undo, fix or nothing to change?
40 steps in total.
Similar automations
AI Agents & AssistantsEstimate Meal Calories from Photos with OpenAI7 stepsAI Agents & AssistantsLog Meal Nutrients from Telegram to Google Sheets with OpenAI15 stepsCalendar & SchedulingCreate a Weekly Random Meal Plan from Recipes25 stepsEmail AutomationTrack menu cost ratios from delivery-note photos with Gemini, Google Sheets and Gmail23 steps