Food Image Calorie Estimation and Report Generation - n8n Workflow

Automate calorie tracking by analyzing food images uploaded via Telegram, estimating ingredients using Vision AI, and sending a detailed nutritional report via Gmail using this robust n8n workflow.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Health enthusiasts and users wanting automated calorie and meal tracking.

  • Nutritionists or diet coaches looking for a quick way to analyze client photos.

  • Developers seeking comprehensive n8n templates for integrating multimodal AI (Vision).

  • n8n users who need reliable, structured JSON output from complex LLM prompts.

Overview

This advanced n8n workflow template solves the challenge of manually logging food intake by leveraging powerful Vision AI. When a user sends a photo of a meal through the Telegram messaging app, this specific n8n workflow instantly analyzes the image. It uses a vision-capable Large Language Model (LLM) to identify ingredients, estimate portion sizes in grams, calculate individual and total calories, and provide a simple nutritional evaluation. The crucial element of this n8n automation is the use of a Structured Output Parser, which guarantees the AI's complex response is always delivered in a clean JSON format, preventing errors in subsequent steps. The final, user-friendly report is then automatically formatted using a Code n8n node into a polished HTML email and delivered via Gmail, providing a seamless, automated tracking experience. This demonstrates a highly effective use case for serverless AI within an n8n environment.

How it Works

This comprehensive n8n workflow initiates with a dedicated n8n trigger.


  1. Triggering the n8n workflow: The process begins when the Telegram Trigger n8n node detects a new message containing a photo. This n8n trigger downloads the image file and passes its ID forward.

  2. Vision AI Analysis: The AI Agent - 食材分析 n8n node receives the image file ID. It uses a detailed system message and a Japanese-language prompt, instructing the agent (powered by the OpenRouter Chat Model n8n node) to act as a nutrition expert. It specifically asks for the dish name, ingredient list (with amounts and calories), total calories, and a nutrition assessment.

  3. Structured Data Guarantee: The Structured Output Parser n8n node, connected to the AI agent, enforces a strict JSON schema on the LLM's output. This ensures the data—including the dishName, ingredients array, and totalCalories—is perfectly structured for downstream processing.

  4. Report Formatting: The Format for Gmail Code n8n node consumes the clean JSON data. It dynamically generates a professional, styled HTML body for the email, complete with tables for ingredients and dedicated sections for the calorie total and nutritional evaluation.

  5. Delivery: Finally, the Send a message1 Gmail n8n node uses the subject and HTML body created in the previous step to dispatch the complete calorie estimation report to the specified recipient's inbox, concluding the execution of this n8n automation.

Installation Guide

To deploy this powerful n8n workflow, follow these steps:


  1. Import: Copy the provided JSON code and import it directly into your n8n instance as a new workflow.

  2. Telegram Setup: Configure the Telegram Trigger n8n node with your Telegram API credentials. Ensure the webhook is active and listening for messages (specifically image updates).

  3. AI Credentials: Update the OpenRouter Chat Model n8n node with your OpenRouter API credentials (or switch this node to an OpenAI Chat node if using GPT-4o). Ensure the selected model has vision capabilities.

  4. Gmail Configuration: Set up the Send a message1 Gmail n8n node using OAuth2 credentials. Update the 'Send To' field with the desired email recipient for the reports.

  5. Activate: Save the n8n workflow and toggle it to 'Active'. The n8n trigger is now listening for incoming images via Telegram.

Node Details

Telegram Trigger (n8n trigger): Initiates the n8n workflow upon receiving an image message. Key configuration: Set to listen for message updates and includes the download: true option to ensure the file is accessible for the AI.
AI Agent - 食材分析 (Langchain Agent n8n node): The core intelligence node. It combines the image input with a detailed, expert system prompt designed to analyze the food and estimate nutritional values. It relies on the connected Language Model.
OpenRouter Chat Model (LLM n8n node): Provides the large language model and vision processing capability. Configured to use a vision-capable model (like openai/gpt-5-mini) with a low temperature (0.3) for stable, fact-based output.
Structured Output Parser (Langchain n8n node): Enforces a rigid JSON schema, ensuring the AI output always contains dishName, ingredients, totalCalories, and nutritionEvaluation. This is essential for reliability in any advanced n8n automation.
Format for Gmail (Code n8n node): A custom n8n node that transforms the raw, validated JSON data into a beautifully structured HTML email template, ready for sending.
Send a message1 (Gmail n8n node): The final action node. It takes the HTML body and subject generated by the Code n8n node and delivers the final calorie estimation report via email.

Related n8n Workflows

Free

Nodes: 7 Nodes
Updated: December 26 2025
View all
Created by
Toshiya Minami
Toshiya Minami

Featured*