Log Telegram meal photos and text to Google Sheets with Gemini nutrition analysis
Quick Overview This workflow listens for meal photos sent to a Telegram bot, uses Google Gemini Vision to estimate the dish and nutrition, logs each entry to a Google Sheets food diary, and replies in Telegram with the estimate plus the sender’s running totals for the day.
How it works Triggers when a new Telegram message is received by your bot. Checks whether the message includes a photo and replies asking for a meal photo if none is provided. Downloads the largest available version of the Telegram photo and sends it (plus any caption) to Google Gemini Vision to return structured nutrition estimates. Stops and replies in Telegram if Gemini indicates the image is not food. Appends the meal details (date/time, user info, dish, calories, macros, confidence, notes) to a Meals sheet in Google Sheets and then reads back today’s rows for that date. Totals today’s calories and macros for the same Telegram user and replies with the per-meal estimate and daily totals.
Setup Create a Telegram bot with @BotFather and add its token as a Telegram credential in n8n. Add a Google Gemini (PaLM) API credential with an API key that can access the Gemini vision model. Connect a Google Sheets OAuth2 credential and replace YOUR_SHEET_ID with your spreadsheet ID in both Google Sheets steps. Create a Google Sheet tab named Meals with columns matching the workflow fields (date, time, user_id, user_name, dish, portion, calories_kcal, protein_g, carbs_g, fat_g, confidence, notes). Set the workflow timezone in n8n so the “today” totals match your local day, then activate the workflow.
Related Templates
Use OpenRouter in n8n versions <1.78
What it is: In version 1.78, n8n introduced a dedicated node to use the OpenRouter service, which lets you to use a lot...
AI SEO Readability Audit: Check Website Friendliness for LLMs
Who is this for? This workflow is designed for SEO specialists, content creators, marketers, and website developers who ...
Task Deadline Reminders with Google Sheets, ChatGPT, and Gmail
Intro This template is for project managers, team leads, or anyone who wants to automatically remind teammates of tasks ...
🔒 Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments