Back to Catalog

Calory tracker & meal logger with Telegram, Gemini AI and data tables

Gerald DenorGerald Denor
73 views
2/3/2026
Official Page

This can be your Alternative to Cal AI App

Overview:

A comprehensive n8n workflow demonstrating advanced AI agent orchestration, stateful conversation management, and multi-modal input processing for nutrition tracking applications.

Technical Architecture:

This workflow showcases production-ready patterns for building complex conversational AI systems in n8n:

  1. Multi-Agent System Design

Router Agent: Analyzes user intent and routes to specialized sub-agents Registration Agent: Handles new user onboarding with guided data collection Meal Logging Agent: Processes text, image, and voice inputs for nutrition analysis Update Agent: Manages multi-turn conversations for meal corrections Report Agent: Generates daily nutrition summaries Profile Agent: Handles user preference updates

  1. Stateful Conversation Management The workflow implements a state machine using n8n Data Tables:

Tracks conversation context across messages Enables multi-step workflows (e.g., "get meal ID → ask for new description → update") Prevents context loss in long conversations Auto-resets state after task completion

  1. Multi-Modal Input Processing

Text: Direct AI analysis using Google Gemini Images: Gemini Vision API with specialized nutrition analysis prompts Voice: Audio-to-text transcription followed by analysis Unified output format regardless of input type

  1. Advanced Prompt Engineering

Specialized system prompts for each agent role Structured output formatting for reliable data extraction Regional cuisine knowledge (African/West African foods) Error handling and clarification requests built into prompts

  1. Data Persistence Layer Uses n8n Data Tables for:

User profiles (calories, protein targets, preferences) Meal logs (descriptions, macros, timestamps) Conversation state (current step, context variables)

  1. Telegram Integration

MarkdownV2 formatting with auto-chunking for long messages Handles all Telegram message types (text, photo, voice) "Typing" indicators for better UX

Learning Outcomes:

By studying this workflow, you'll understand:

How to build agent hierarchies with specialized roles State management patterns for complex conversations Multi-modal AI input processing techniques Production data persistence strategies in n8n Scalable webhook-based bot architecture

Technical Requirements:

n8n version 1.0+ (uses Data Tables feature) Google Gemini API access Telegram Bot Token Basic understanding of: AI agents, webhook triggers, data tables

Difficulty Level: Intermediate to Advanced

Use Cases Beyond Nutrition: The patterns here apply to any domain requiring:

Multi-step user onboarding Data collection through conversation Record updates via natural language Report generation Profile management

Components:

50+ nodes demonstrating n8n AI features 6 specialized AI agents 3 data tables with structured schemas Custom JavaScript for MIME type handling and markdown formatting Integration with Google Gemini (text + vision + audio models)

What Makes This Workflow Unique:

Most n8n AI examples show simple Q&A bots. This demonstrates enterprise-grade conversation management with real data persistence, making it suitable for actual production deployment.

SETUP GUIDE

Need Help?

Reach me: https://www.linkedin.com/in/gerald-akhidenor-1ab1a45/

Work with me: https://dominixai.com/

My website: https://jobmonkey.dev

My email: denorgerald@gmail.com

Cal AI Nutrition Bot - Complete Setup Guide

Who This Guide Is For: This workflow is designed for beginner to intermediate no-code builders who want to launch a nutrition tracking bot. You should be comfortable:

Creating accounts on platforms (n8n, Google Cloud, Telegram) Following step-by-step instructions Copy-pasting API keys Basic JSON importing

No programming experience required. If you can use Zapier or Make.com, you can set this up.

Prerequisites (30 minutes to gather)

  1. n8n Account

Option A (Easiest): Sign up for n8n Cloud at n8n.io (14-day free trial, then $20/month) Option B (Free): Self-host n8n on DigitalOcean/Railway/your server

  1. Google Gemini API Key

Go to ai.google.dev Click "Get API Key" Create new project (free tier: 15 requests/minute) Copy your API key

  1. Telegram Bot

Open Telegram and search for @BotFather Send /newbot command Follow prompts to create your bot Copy the bot token (looks like: 1234567890:ABCdefGHIjklMNOpqrsTUVwxyz)

Step 1: Import the Workflow (5 minutes)

Log into your n8n instance Click "New Workflow" in top left Click the three-dot menu → Import from File Upload the My_workflow.json file you downloaded The workflow will appear with all nodes connected

Step 2: Create Data Tables (10 minutes) The workflow uses three data tables to store information. Create them exactly as shown: Table 1: Cal AI Profiles

Navigate to n8n Data Tables section Click Create Data Table Name: Cal AI Profiles Add columns:

User_ID (Text) Name (Text) Email (Text) Calories_target (Number) Protein_target (Number) Country (Text)

Table 2: Cal AI Meals

Create new table: Cal AI Meals Add columns:

Meal_ID (Text) User_ID (Text) Date (Text) Meal_description (Text) Calories (Number) Proteins (Number) Carbs (Text) Fats (Text)

Table 3: Cal AI StateManagement

Create new table: Cal AI StateManagement Add columns:

User_ID (Text) State (Text) Last_Interaction (DateTime) Context_MealID (Text)

Step 3: Configure Credentials (15 minutes) A. Add Google Gemini Credential

In any Google Gemini node, click "Create New Credential" Paste your Gemini API key Click Save This credential will auto-apply to all Gemini nodes

B. Add Telegram Credential

Open any Telegram node Click "Create New Credential" Paste your bot token Click Save

C. Link Data Tables

Open the "Is User Registered?" node Click the Data Table dropdown Select "Cal AI Profiles" Repeat for all nodes with data table connections (n8n will show which ones need updating)

Step 4: Activate Telegram Webhook (5 minutes)

Open the "Telegram Trigger" node Click "Execute Node" to register the webhook You'll see "Webhook registered successfully" Click "Listen for Test Event" to verify Send a message to your bot on Telegram You should see the message appear in n8n

Step 5: Test Each Function (20 minutes) Test 1: User Registration

Send any message to your bot Bot should ask for your name Follow the prompts to complete registration Check the "Cal AI Profiles" data table to confirm your data was saved

Test 2: Meal Logging (Text)

Send: "I had 2 eggs and toast" Bot should respond with nutrition breakdown

Test 3: Meal Logging (Image)

Take a photo of food Send it to the bot Bot should analyze and log the meal

Test 4: Meal Logging (Voice)

Record a voice message: "I had chicken and rice" Send it to your bot Bot should transcribe and analyze

Test 5: Update Meal

Send: "update meal" Follow prompts to provide meal ID and new description

Test 6: Get Report

Send: "show my report" Bot should ask for a date and generate summary

Step 6: Customize (Optional) Change Bot Personality

Edit the systemMessage in each Agent node Adjust tone, add emojis, change coaching style

Add Your Branding

Update bot responses to mention your app name Customize welcome messages

Modify Cuisine Focus

Update the nutrition analysis prompts to focus on your target cuisine Current default: African/West African/Nigerian foods

Adjust Nutrition Calculations

Edit the Gemini Vision prompt in "Analyze image" node Modify portion size assumptions or macro ratios

Troubleshooting Bot doesn't respond:

Check webhook is activated in Telegram Trigger node Verify Telegram credential is correct Check execution logs for errors

"Data Table not found" errors:

Ensure all three tables are created with exact names Relink tables in each node

Gemini API errors:

Verify API key is active Check you haven't exceeded free tier limits (15/min) Try regenerating API key

Meals not saving:

Check "Append Meal Data" node is connected Verify User_ID matches between tables

Going Live Once testing is complete:

Click "Active" toggle in top right Share your bot link: t.me/YourBotUsername Monitor the Executions tab for any errors

Target Users & Support This workflow is perfect for:

Fitness coaches wanting client nutrition tracking without monthly SaaS fees Health tech entrepreneurs building MVP before hiring developers No-code builders learning advanced n8n AI patterns Bootcamp graduates needing portfolio projects with real-world complexity Small app studios prototyping before committing to custom development

You'll succeed with this if you:

Can follow detailed instructions Are comfortable with web-based tools Want to learn by doing (the workflow itself is educational) Need a production-ready solution quickly

You might struggle if:

You've never used n8n before (recommend taking their free course first) You're not comfortable with API concepts (keys, webhooks) You need 100% hand-holding (this assumes basic technical literacy)

Support:

Reach me: https://www.linkedin.com/in/gerald-akhidenor-1ab1a45/ Review Google Gemini documentation for AI customization Telegram Bot API docs for advanced features

Next Steps After Setup

Invite Beta Users - Start with friends/clients to gather feedback Monitor Usage - Watch which features get used most Customize Prompts - Refine AI responses based on real conversations Add Features - Use this as foundation for recipe suggestions, meal planning, etc. Scale Infrastructure - Move to dedicated hosting as user base grows

Estimated total setup time: 1-2 hours for complete beginners, 30 minutes for experienced n8n users.

n8n Calorie Tracker & Meal Logger with Telegram, Gemini AI, and Data Tables

This n8n workflow provides a comprehensive solution for tracking daily calorie intake and logging meals using a Telegram bot, powered by Google Gemini AI, and storing data in n8n Data Tables. It simplifies the process of recording what you eat and getting instant feedback on your calorie consumption.

What it does

This workflow automates the following steps:

  1. Listens for Telegram Messages: It acts as a Telegram bot, waiting for incoming messages from users.
  2. Analyzes User Input: When a message is received, it uses a Switch node to differentiate between a simple "Hello" message and a meal logging request.
  3. Processes Meal Logs with AI:
    • If the message is a meal log, it uses a Code node to prepare the text for AI processing.
    • It then leverages a Google Gemini Chat Model within an AI Agent to interpret the meal description and extract relevant information (e.g., food items, quantities, estimated calories).
    • The AI Agent utilizes a Call n8n Workflow Tool to interact with another n8n workflow (presumably to save the meal data, though that part is not explicitly defined in this JSON).
    • A Simple Memory node helps the AI Agent maintain context in the conversation.
  4. Stores Data in n8n Data Tables: The extracted meal and calorie information is intended to be stored in an n8n Data Table for persistent tracking.
  5. Responds to User:
    • For a "Hello" message, it sends a friendly greeting back to the user via Telegram.
    • For a meal log, it provides feedback to the user, likely confirming the logged meal and its estimated calorie count.
  6. Merges Workflow Paths: A Merge node combines the different response paths before sending the final message back to Telegram.

Prerequisites/Requirements

To use this workflow, you will need:

  • n8n Instance: A running instance of n8n.
  • Telegram Bot Token: A Telegram bot created via BotFather, and its API token configured as an n8n credential.
  • Google Gemini API Key: Access to the Google Gemini API, configured as an n8n credential for the Google Gemini Chat Model and Google Gemini nodes.
  • n8n Data Tables: The n8n Data Tables feature enabled and configured (no specific table names are provided in this JSON, but they would be needed for actual data storage).
  • (Optional) Linked Workflow: If the "Call n8n Workflow Tool" is intended to call another workflow, that linked workflow would also need to be configured.

Setup/Usage

  1. Import the workflow: Import this JSON into your n8n instance.
  2. Configure Credentials:
    • Set up your Telegram API credential with your bot token.
    • Set up your Google Gemini API credential with your API key.
  3. Activate the Webhook: The Telegram Trigger node will provide a webhook URL once the workflow is activated. You'll need to configure your Telegram bot to send updates to this URL (usually done via the setWebhook API method or through BotFather).
  4. Configure Data Table: Ensure you have an n8n Data Table set up to receive the meal logging data. You will need to adjust the Data table node's configuration to specify the target table and how data should be written.
  5. (Optional) Configure Linked Workflow: If the "Call n8n Workflow Tool" is used, ensure the referenced workflow is active and correctly configured to handle the data passed to it.
  6. Activate the workflow: Once all credentials and configurations are in place, activate the workflow.

You can now interact with your Telegram bot by sending messages like "Hello" or "I ate a sandwich and an apple for lunch, about 500 calories." The bot will process your input and respond accordingly.

Related Templates

AI-powered code review with linting, red-marked corrections in Google Sheets & Slack

Advanced Code Review Automation (AI + Lint + Slack) Who’s it for For software engineers, QA teams, and tech leads who want to automate intelligent code reviews with both AI-driven suggestions and rule-based linting — all managed in Google Sheets with instant Slack summaries. How it works This workflow performs a two-layer review system: Lint Check: Runs a lightweight static analysis to find common issues (e.g., use of var, console.log, unbalanced braces). AI Review: Sends valid code to Gemini AI, which provides human-like review feedback with severity classification (Critical, Major, Minor) and visual highlights (red/orange tags). Formatter: Combines lint and AI results, calculating an overall score (0–10). Aggregator: Summarizes results for quick comparison. Google Sheets Writer: Appends results to your review log. Slack Notification: Posts a concise summary (e.g., number of issues and average score) to your team’s channel. How to set up Connect Google Sheets and Slack credentials in n8n. Replace placeholders (<YOURSPREADSHEETID>, <YOURSHEETGIDORNAME>, <YOURSLACKCHANNEL_ID>). Adjust the AI review prompt or lint rules as needed. Activate the workflow — reviews will start automatically whenever new code is added to the sheet. Requirements Google Sheets and Slack integrations enabled A configured AI node (Gemini, OpenAI, or compatible) Proper permissions to write to your target Google Sheet How to customize Add more linting rules (naming conventions, spacing, forbidden APIs) Extend the AI prompt for project-specific guidelines Customize the Slack message formatting Export analytics to a dashboard (e.g., Notion or Data Studio) Why it’s valuable This workflow brings realistic, team-oriented AI-assisted code review to n8n — combining the speed of automated linting with the nuance of human-style feedback. It saves time, improves code quality, and keeps your team’s review history transparent and centralized.

higashiyama By higashiyama
90

Generate Weather-Based Date Itineraries with Google Places, OpenRouter AI, and Slack

🧩 What this template does This workflow builds a 120-minute local date course around your starting point by querying Google Places for nearby spots, selecting the top candidates, fetching real-time weather data, letting an AI generate a matching emoji, and drafting a friendly itinerary summary with an LLM in both English and Japanese. It then posts the full bilingual plan with a walking route link and weather emoji to Slack. 👥 Who it’s for Makers and teams who want a plug-and-play bilingual local itinerary generator with weather awareness — no custom code required. ⚙️ How it works Trigger – Manual (or schedule/webhook). Discovery – Google Places nearby search within a configurable radius. Selection – Rank by rating and pick the top 3. Weather – Fetch current weather (via OpenWeatherMap). Emoji – Use an AI model to match the weather with an emoji 🌤️. Planning – An LLM writes the itinerary in Markdown (JP + EN). Route – Compose a Google Maps walking route URL. Share – Post the bilingual itinerary, route link, and weather emoji to Slack. 🧰 Requirements n8n (Cloud or self-hosted) Google Maps Platform (Places API) OpenWeatherMap API key Slack Bot (chat:write) LLM provider (e.g., OpenRouter or DeepL for translation) 🚀 Setup (quick) Open Set → Fields: Config and fill in coords/radius/time limit. Connect Credentials for Google, OpenWeatherMap, Slack, and your LLM. Test the workflow and confirm the bilingual plan + weather emoji appear in Slack. 🛠 Customize Adjust ranking filters (type, min rating). Modify translation settings (target language or tone). Change output layout (side-by-side vs separated). Tune emoji logic or travel mode. Add error handling, retries, or logging for production use.

nodaBy noda
52

Competitor intelligence agent: SERP monitoring + summary with Thordata + OpenAI

Who this is for? This workflow is designed for: Marketing analysts, SEO specialists, and content strategists who want automated intelligence on their online competitors. Growth teams that need quick insights from SERP (Search Engine Results Pages) without manual data scraping. Agencies managing multiple clients’ SEO presence and tracking competitive positioning in real-time. What problem is this workflow solving? Manual competitor research is time-consuming, fragmented, and often lacks actionable insights. This workflow automates the entire process by: Fetching SERP results from multiple search engines (Google, Bing, Yandex, DuckDuckGo) using Thordata’s Scraper API. Using OpenAI GPT-4.1-mini to analyze, summarize, and extract keyword opportunities, topic clusters, and competitor weaknesses. Producing structured, JSON-based insights ready for dashboards or reports. Essentially, it transforms raw SERP data into strategic marketing intelligence — saving hours of research time. What this workflow does Here’s a step-by-step overview of how the workflow operates: Step 1: Manual Trigger Initiates the process on demand when you click “Execute Workflow.” Step 2: Set the Input Query The “Set Input Fields” node defines your search query, such as: > “Top SEO strategies for e-commerce in 2025” Step 3: Multi-Engine SERP Fetching Four HTTP request tools send the query to Thordata Scraper API to retrieve results from: Google Bing Yandex DuckDuckGo Each uses Bearer Authentication configured via “Thordata SERP Bearer Auth Account.” Step 4: AI Agent Processing The LangChain AI Agent orchestrates the data flow, combining inputs and preparing them for structured analysis. Step 5: SEO Analysis The SEO Analyst node (powered by GPT-4.1-mini) parses SERP results into a structured schema, extracting: Competitor domains Page titles & content types Ranking positions Keyword overlaps Traffic share estimations Strengths and weaknesses Step 6: Summarization The Summarize the content node distills complex data into a concise executive summary using GPT-4.1-mini. Step 7: Keyword & Topic Extraction The Keyword and Topic Analysis node extracts: Primary and secondary keywords Topic clusters and content gaps SEO strength scores Competitor insights Step 8: Output Formatting The Structured Output Parser ensures results are clean, validated JSON objects for further integration (e.g., Google Sheets, Notion, or dashboards). Setup Prerequisites n8n Cloud or Self-Hosted instance Thordata Scraper API Key (for SERP data retrieval) OpenAI API Key (for GPT-based reasoning) Setup Steps Add Credentials Go to Credentials → Add New → HTTP Bearer Auth* → Paste your Thordata API token. Add OpenAI API Credentials* for the GPT model. Import the Workflow Copy the provided JSON or upload it into your n8n instance. Set Input In the “Set the Input Fields” node, replace the example query with your desired topic, e.g.: “Google Search for Top SEO strategies for e-commerce in 2025” Execute Click “Execute Workflow” to run the analysis. How to customize this workflow to your needs Modify Search Query Change the search_query variable in the Set Node to any target keyword or topic. Change AI Model In the OpenAI Chat Model nodes, you can switch from gpt-4.1-mini to another model for better quality or lower cost. Extend Analysis Edit the JSON schema in the “Information Extractor” nodes to include: Sentiment analysis of top pages SERP volatility metrics Content freshness indicators Export Results Connect the output to: Google Sheets / Airtable for analytics Notion / Slack for team reporting Webhook / Database for automated storage Summary This workflow creates an AI-powered Competitor Intelligence System inside n8n by blending: Real-time SERP scraping (Thordata) Automated AI reasoning (OpenAI GPT-4.1-mini) Structured data extraction (LangChain Information Extractors)

Ranjan DailataBy Ranjan Dailata
632