Automate Nutrition Analysis with AI and Telegram
detail.loadingPreview
Effortlessly analyze nutritional content from text or voice messages using AI. This workflow integrates Telegram, OpenAI's powerful language models, and Google Sheets to provide detailed nutritional breakdowns.
About This Workflow
This n8n workflow automates the complex task of nutritional analysis, making it accessible and convenient. It begins by receiving messages or voice notes via Telegram, then leverages OpenAI's gpt-4o-mini model to process the input. For voice messages, it first transcribes the audio to text. The core of the analysis involves an AI agent that estimates calories, macronutrients (protein, carbohydrates, lipids), and key electrolytes (sodium, potassium, magnesium, zinc, iron) based on provided dietary statements. The results are then structured into a JSON format, including detailed reasoning, and finally stored in a Google Sheet for easy tracking and review. This integration streamlines nutritional data collection and analysis for individuals and businesses alike.
Key Features
- Voice and Text Input: Accepts both typed messages and voice notes through Telegram.
- AI-Powered Analysis: Utilizes OpenAI's advanced language models for accurate nutritional estimations.
- Structured Data Output: Generates detailed nutritional breakdowns in a clear JSON format.
- Automated Storage: Seamlessly saves analyzed data into Google Sheets.
- Flexible Configuration: Easily adaptable for various dietary analysis needs.
How To Use
- Set up Telegram Bot: Create a Telegram bot using the BotFather and obtain an API token. Configure the
Mes repas botcredential in n8n. - Configure Telegram Triggers: Set up the
Receive Telegram messagenode with your bot's credentials and specify desired update types (e.g.,message,channel_post). - Handle Voice Messages: Implement the
If it's a voice messagenode to differentiate between text and voice inputs. For voice messages, use theGet Audio Filenode to retrieve the audio and then theTranscribe Recordingnode to convert it to text. - Process Text Input: Use
Set chatInput from messageorSet chatInput from voicenodes to consolidate the transcribed text or direct message into achatInputvariable. - AI Nutritional Analysis: Configure the
List of Ingredients and nutrientsnode (Langchain Agent). Define the prompt to guide the AI in extracting nutritional information. Ensure thejsonSchemaExamplein theStructured Output Parsernode matches the expected AI output format. - Structure and Store Data: Use the
Explode the listnode to separate the JSON output into individual items. TheAdd datenode will append a timestamp, and theStore in sheetnode will write the processed data to your specified Google Sheet using the providedMes repas botcredential. Ensure your Google Sheet has columns corresponding to the expected output (e.g.,name,quantity,unit,reasoning).
Apps Used
Workflow JSON
{
"id": "71fb2cbe-09fd-4599-aec5-abd9ab6509f7",
"name": "Automate Nutrition Analysis with AI and Telegram",
"nodes": 29,
"category": "Operations",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: 71fb2cbe-09fd...
About the Author
Free n8n Workflows Official
System Admin
The official repository for verified enterprise-grade workflows.
Statistics
Related Workflows
Discover more workflows you might like
Google Sheets to Icypeas: Automated Bulk Domain Scanning
This workflow streamlines the process of performing bulk domain scans by integrating your Google Sheets data directly with the Icypeas platform. Automate the submission of company names from your spreadsheet to Icypeas for comprehensive domain information, saving valuable time and effort.
Instant WooCommerce Order Notifications via Telegram
When a new order is placed on your WooCommerce store, instantly receive detailed notifications directly to your Telegram chat. Stay on top of your e-commerce operations with real-time alerts, including order specifics and a direct link to view the order.
On-Demand Microsoft SQL Query Execution
This workflow allows you to manually trigger and execute any SQL query against your Microsoft SQL Server database. Perfect for ad-hoc data lookups, administrative tasks, or quick tests, giving you direct control over your database operations.