Automate Nutrition Tracking & Analyze Dietary Intake with AI
Automatically log daily meals and calculate nutritional content in seconds, reducing manual food journaling effort by over 90% and enabling real-time dietary analysis.
Manually logging meals and estimating nutritional content is time-consuming and prone to errors. This workflow automates nutritional intake tracking by processing your meal descriptions via text or voice and storing detailed nutrient breakdowns in a Google Sheet.
Documentation
AI-Powered Daily Nutrition Logger
This powerful n8n workflow transforms how you track your daily nutritional intake. By simply describing your meals via Telegram, either by text or voice, this solution leverages advanced AI to break down your meal's macronutrients and electrolytes, then automatically stores this vital data in a Google Sheet for easy analysis. Perfect for health enthusiasts, dietitians, or anyone looking to maintain a precise dietary log without manual effort.
Key Features
- Effortless Meal Logging: Input your meals using natural language, either by typing a message or sending a voice note via Telegram.
- Intelligent Nutrient Estimation: AI powered by OpenAI and LangChain accurately approximates key nutritional components like protein, carbs, fats, calories, and essential electrolytes.
- Automated Data Storage: All your nutritional data is neatly organized and saved into a Google Sheet, creating a comprehensive dietary history.
- Customizable AI Prompt: Easily adjust the AI prompt to refine how nutrient analysis is performed or to include additional nutritional data points.
How It Works
This workflow seamlessly integrates Telegram, OpenAI's advanced AI, and Google Sheets to provide a hands-free nutritional tracking experience:
- Receive Meal Input: The workflow starts by listening for new messages in your designated Telegram bot. You can either type out your meal description (e.g., "I had steak, salad with vinaigrette, and a glass of water") or send a voice recording of your meal.
- Transcribe Voice Messages: If a voice message is received, the workflow automatically sends the audio file to OpenAI for transcription, converting your spoken description into text.
- AI Nutritional Analysis: The transcribed text (or your direct text message) is then fed to a LangChain agent. Configured as a "nutrition expert" and powered by an OpenAI chat model, this agent analyzes your meal description. It approximates calories, macronutrients (protein, lipids, carbohydrates), and key electrolytes (sodium, potassium, magnesium, zinc, iron) for each food item and provides a total, structured as a JSON output.
- Structure and Timestamp Data: The AI's response is parsed into a consistent JSON array, and a timestamp is automatically added to each nutrient entry.
- Automated Storage: The processed and enriched nutritional data is then appended as new rows in your designated Google Sheet, building a continuous record of your dietary intake.
- Confirmation: Finally, a confirmation message, "Your meal has been saved," is sent back to you via Telegram, acknowledging the successful logging of your intake.