AutomationFlowsAI & RAG › Calory Tracker & Meal Logger with Telegram, Gemini AI and Data Tables

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

ByGerald Denor @dominixai on n8n.io

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

Event trigger★★★★★ complexityAI-powered73 nodesTelegramMemory Buffer WindowGoogle Gemini ChatAgentTelegram TriggerTool WorkflowData TableData Table Tool
AI & RAG Trigger: Event Nodes: 73 Complexity: ★★★★★ AI nodes: yes Added:

This workflow corresponds to n8n.io template #9294 — we link there as the canonical source.

This workflow follows the Agent → Datatable recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "name": "My workflow",
  "tags": [],
  "nodes": [
    {
      "id": "c4a14c16-615e-4984-abca-8950f51fc0d5",
      "name": "Typing\u2026",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -2592,
        1344
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "b6fbed49-0eca-43e4-84eb-98b5b5ab2566",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        1104,
        992
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "8d6fa59e-bfd9-416d-93d6-61b5311fb4bc",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        -2128,
        1104
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "7793f573-3215-4865-a5f2-ddff2ed1845a",
      "name": "Send a text message1",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -1040,
        1632
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "2502b3b3-7de8-4460-a032-62f0095d1348",
      "name": "Google Gemini Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -1632,
        1824
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "d9eba406-22d5-46d9-9028-66d961569f06",
      "name": "Simple Memory1",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -1440,
        1824
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "47fd6871-9bc5-4e1d-8df1-80faadfffc7d",
      "name": "MarkdownV",
      "type": "n8n-nodes-base.code",
      "position": [
        -1216,
        1632
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "3e80ff26-fa16-48d3-b472-1ffa98a74204",
      "name": "get_message (register)",
      "type": "n8n-nodes-base.set",
      "position": [
        -1712,
        1632
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "4eac791a-5c02-475e-bee5-9a9e9cdc71ef",
      "name": "Register Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1520,
        1632
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "5d6d74d5-3a17-43e7-a6e6-cfb35f885849",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1792,
        1520
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "ab9d84ea-ff56-47c0-8291-2b0db03bd1f9",
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -2816,
        1296
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "28e78669-1537-4eb8-8998-bb95260e5e40",
      "name": "Cal AI Router Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1408,
        1264
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "0a357c18-1e14-4bd8-9877-1c31437eb066",
      "name": "Google Gemini Chat Model2",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -1664,
        1328
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "c3a64847-e428-48b2-8435-9d099e998529",
      "name": "The Log Meal Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1024,
        832
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "53b2782e-6935-4d6f-9692-2aad57319852",
      "name": "Report Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1056,
        1264
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "25a26fdc-f3c1-4bcb-ad9c-a2aa3050c8fe",
      "name": "Profile Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1072,
        1776
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "1b82e00a-5dbe-4e42-9264-ada9a02c7827",
      "name": "MarkdownV2",
      "type": "n8n-nodes-base.code",
      "position": [
        2288,
        1312
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "2c134d28-47ab-4966-a20a-1f1557b318ac",
      "name": "Send a text message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        2560,
        1312
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "9b688054-66de-49f4-ae44-864d0223acef",
      "name": "Google Gemini Chat Model3",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        992,
        1024
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "eae8dee6-4049-4b71-b255-92ceef715157",
      "name": "Google Gemini Chat Model4",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1024,
        1504
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "eb931e12-64e8-4d53-8b32-4a1adee2728a",
      "name": "Simple Memory2",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -592,
        1936
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "716c662b-1478-46ea-a134-b5309d5770ad",
      "name": "Simple Memory3",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        1184,
        1504
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "57601b08-4bda-48a2-b1a0-3e33c2527a07",
      "name": "Simple Memory4",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        1072,
        1968
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "6cc2d486-c3f9-4c9c-9c09-bf28414aeb09",
      "name": "Sequential Routing",
      "type": "n8n-nodes-base.switch",
      "position": [
        -1008,
        1200
      ],
      "parameters": {},
      "typeVersion": 3.2,
      "alwaysOutputData": false
    },
    {
      "id": "ab4de25c-d61e-4c6a-8f2a-09afbcfb4d39",
      "name": "logMealAnalysis(tool)",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "disabled": true,
      "position": [
        1360,
        1072
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "46690d43-2e23-4d90-a70b-d7e222927df7",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -304,
        -160
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "f7034ed0-c898-407c-a1f7-8b015aac5d83",
      "name": "Is User Registered?",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        -2368,
        1104
      ],
      "parameters": {},
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "b268f3db-7027-4b04-ba1c-8e08b3a81711",
      "name": "Register User",
      "type": "n8n-nodes-base.dataTableTool",
      "position": [
        -1280,
        1824
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "9e907188-7e3f-4fd3-abce-aa9b724baed9",
      "name": "Get Conversation State",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        -1936,
        1088
      ],
      "parameters": {},
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "d9c40f33-d2e1-407e-abed-696364c7e2d7",
      "name": "Append Meal Data",
      "type": "n8n-nodes-base.dataTableTool",
      "position": [
        1232,
        1024
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "fb2b64b7-d072-42cc-8660-d8196615433c",
      "name": "fetchmealdetails",
      "type": "n8n-nodes-base.dataTableTool",
      "position": [
        -432,
        1936
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "ad9b0430-36af-459a-9af8-a134c571dfaf",
      "name": "updateMeal",
      "type": "n8n-nodes-base.dataTableTool",
      "position": [
        -320,
        1968
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "0853bd61-8d75-4e15-b238-f3be7bc793bc",
      "name": "getUserData",
      "type": "n8n-nodes-base.dataTableTool",
      "position": [
        1296,
        1520
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "483105d7-1e36-45b4-94fa-4a5b1804e2c2",
      "name": "getDailyMealReport",
      "type": "n8n-nodes-base.dataTableTool",
      "position": [
        1408,
        1552
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "fcbf38c8-a218-4b20-be28-96728ebbf3fc",
      "name": "Update Profile Data",
      "type": "n8n-nodes-base.dataTableTool",
      "position": [
        1264,
        1968
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "dba52128-57cd-48c8-8804-882d8060f45e",
      "name": "Standardize Input",
      "type": "n8n-nodes-base.set",
      "position": [
        -2592,
        1104
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "02871c77-5f01-4a8c-ba4b-ac09f8f37a17",
      "name": "Conversation State Router",
      "type": "n8n-nodes-base.switch",
      "position": [
        -1728,
        1056
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "5962d05a-9ef7-4798-bc26-42becdd90dc9",
      "name": "Download Voice Message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -240,
        816
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "389797f4-3b57-43e6-8868-56f15cdc56d5",
      "name": "Download IMAGE",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -240,
        992
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "4eb2fdc8-9ee7-426e-aadd-05a4395670df",
      "name": "Analyze image",
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "position": [
        176,
        992
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "47cff34d-b07d-4cb3-82d4-e0058109a2e4",
      "name": "Analyze voice message",
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "position": [
        160,
        816
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "0e2a68a2-5cbc-431b-8691-8e49df3adee6",
      "name": "get_message (Audio/Video message)",
      "type": "n8n-nodes-base.set",
      "position": [
        352,
        816
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "b6fd18a8-79e8-446c-ae97-69bbeae90885",
      "name": "get_message (Media  message)",
      "type": "n8n-nodes-base.set",
      "position": [
        352,
        992
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "e77d3bfc-01ca-45f9-a791-0269126348b5",
      "name": "Fix mime",
      "type": "n8n-nodes-base.code",
      "position": [
        -16,
        816
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "89d77d38-e905-4c03-a486-382689cdcd85",
      "name": "Fix mime5",
      "type": "n8n-nodes-base.code",
      "position": [
        0,
        992
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "880ab6f1-0483-40cb-beff-11efcfb47f5a",
      "name": "Analyze Text Message",
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "position": [
        -112,
        608
      ],
      "parameters": {},
      "retryOnFail": true,
      "typeVersion": 1,
      "waitBetweenTries": 5000
    },
    {
      "id": "7b4b6848-2fa3-434d-ad2c-abf552979280",
      "name": "Input Message Router",
      "type": "n8n-nodes-base.switch",
      "position": [
        -624,
        816
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "ab8f72bd-904e-41c3-b1ca-e96c95fa2850",
      "name": "get_error_message",
      "type": "n8n-nodes-base.set",
      "position": [
        -224,
        1200
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "8481bf5c-83c4-471a-b19e-c7579bc74fd3",
      "name": "Merge2",
      "type": "n8n-nodes-base.merge",
      "position": [
        640,
        800
      ],
      "parameters": {},
      "typeVersion": 3.2,
      "alwaysOutputData": true
    },
    {
      "id": "13426161-5cb6-4e01-859f-4ffc257c3244",
      "name": "Re-Analyze Meal",
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "position": [
        -224,
        1744
      ],
      "parameters": {},
      "retryOnFail": true,
      "typeVersion": 1,
      "waitBetweenTries": 5000
    },
    {
      "id": "da46e92a-0eb0-47b2-80ad-a3380f29928c",
      "name": "Parse AI Output",
      "type": "n8n-nodes-base.code",
      "position": [
        128,
        1744
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "f1934137-6106-4bd6-87c7-d483ccac5d28",
      "name": "Save Updated Meal",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        320,
        1744
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "9ac4fd7e-6616-409c-92a6-6e362cf13e2d",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2880,
        960
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "b24fa5c1-d2a6-46a0-9f80-7d25e7e3ddb2",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1776,
        928
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "d51f50a5-5c61-4b6e-8bd6-f9ab67c30a0d",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -800,
        560
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "78c35204-06b2-4e63-9ce0-054fc6833443",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -816,
        1488
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "13f0ea32-be43-4d47-8454-396c416bc69e",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -752,
        1856
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "99981767-186d-4610-ab06-68356553100e",
      "name": "Format Text Analysis",
      "type": "n8n-nodes-base.set",
      "position": [
        336,
        608
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "fc3abee7-cc95-42d3-a8c9-dec0294d11e2",
      "name": "State-Setting Node #1",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        320,
        1568
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "ec41c0ac-888d-4386-9033-b28f4cffd3f6",
      "name": "Clear the State",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        496,
        1744
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "73a28a1d-a1e1-4899-be64-bd864bcf110b",
      "name": "Update Meal Agent (Step 1 - Ask for ID)",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -592,
        1568
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "06a50082-f130-4994-9776-b5bf57375ccf",
      "name": "Update Meal Agent (Step 2 - Ask for Desc)",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -592,
        2096
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "aacc589f-74a9-4ee3-b01f-71ca9128a9f1",
      "name": "Update Meal Agent (Step 3 - Final Output)",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -592,
        1744
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "2b8862b3-19b0-4793-b7ab-c36d5a5b6840",
      "name": "Send a text message2",
      "type": "n8n-nodes-base.telegram",
      "position": [
        560,
        1568
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "019998c1-0187-40f4-9c7e-ead0bf37cea2",
      "name": "Send a text message3",
      "type": "n8n-nodes-base.telegram",
      "position": [
        544,
        1952
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "2ba18310-e47a-4078-bb2b-d3e715bfc59e",
      "name": "MarkdownV3",
      "type": "n8n-nodes-base.code",
      "position": [
        128,
        1568
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "7bc2ed76-597e-40bc-a78e-652b978e2df1",
      "name": "MarkdownV4",
      "type": "n8n-nodes-base.code",
      "position": [
        128,
        1952
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "48ae86e3-527d-4504-843e-d31cc7b225e6",
      "name": "New Description State-Setting Node #2",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        320,
        1952
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "7a5573e0-88a6-4954-abf3-a14a967ba217",
      "name": "Create Success Message",
      "type": "n8n-nodes-base.set",
      "position": [
        704,
        1744
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "8ef9fc14-da8f-4baa-8848-4ffdf019110a",
      "name": "Set Update Profile State",
      "type": "n8n-nodes-base.dataTableTool",
      "position": [
        1456,
        1984
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "58120cf4-216f-4911-8122-1918f7cec6ce",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -2816,
        1056
      ],
      "parameters": {},
      "typeVersion": 2.1
    },
    {
      "id": "5e5cdbef-d9fb-47ca-a235-c17ebeb80ebb",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2176,
        1104
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "6653d3fe-9073-4c14-bc94-e79708687f7a",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        976,
        560
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "",
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Get Conversation State",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "get_message (register)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge2": {
      "main": [
        [
          {
            "node": "The Log Meal Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook": {
      "main": [
        [
          {
            "node": "Standardize Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fix mime": {
      "main": [
        [
          {
            "node": "Analyze voice message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fix mime5": {
      "main": [
        [
          {
            "node": "Analyze image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "MarkdownV": {
      "main": [
        [
          {
            "node": "Send a text message1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "MarkdownV2": {
      "main": [
        [
          {
            "node": "Send a text message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "MarkdownV3": {
      "main": [
        [
          {
            "node": "State-Setting Node #1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "MarkdownV4": {
      "main": [
        [
          {
            "node": "New Description State-Setting Node #2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "updateMeal": {
      "ai_tool": [
        [
          {
            "node": "Update Meal Agent (Step 3 - Final Output)",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "getUserData": {
      "ai_tool": [
        [
          {
            "node": "Report Agent",
            "type": "ai_tool",
            "index": 0
          },
          {
            "node": "Profile Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Report Agent": {
      "main": [
        [
          {
            "node": "MarkdownV2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze image": {
      "main": [
        [
          {
            "node": "get_message (Media  message)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Profile Agent": {
      "main": [
        [
          {
            "node": "MarkdownV2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Register User": {
      "ai_tool": [
        [
          {
            "node": "Register Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "The Log Meal Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Download IMAGE": {
      "main": [
        [
          {
            "node": "Fix mime5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Register Agent": {
      "main": [
        [
          {
            "node": "MarkdownV",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory1": {
      "ai_memory": [
        [
          {
            "node": "Register Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory2": {
      "ai_memory": [
        [
          {
            "node": "Update Meal Agent (Step 3 - Final Output)",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory3": {
      "ai_memory": [
        [
          {
            "node": "Report Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory4": {
      "ai_memory": [
        [
          {
            "node": "Profile Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Clear the State": {
      "main": [
        [
          {
            "node": "Create Success Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse AI Output": {
      "main": [
        [
          {
            "node": "Save Updated Meal",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Re-Analyze Meal": {
      "main": [
        [
          {
            "node": "Parse AI Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append Meal Data": {
      "ai_tool": [
        [
          {
            "node": "The Log Meal Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Typing\u2026",
            "type": "main",
            "index": 0
          },
          {
            "node": "Standardize Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "fetchmealdetails": {
      "ai_tool": [
        [
          {
            "node": "Update Meal Agent (Step 3 - Final Output)",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Save Updated Meal": {
      "main": [
        [
          {
            "node": "Clear the State",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Standardize Input": {
      "main": [
        [
          {
            "node": "Is User Registered?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sequential Routing": {
      "main": [
        [
          {
            "node": "Input Message Router",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update Meal Agent (Step 1 - Ask for ID)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Report Agent",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Profile Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "The Log Meal Agent": {
      "main": [
        [
          {
            "node": "MarkdownV2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "getDailyMealReport": {
      "ai_tool": [
        [
          {
            "node": "Report Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Cal AI Router Agent": {
      "main": [
        [
          {
            "node": "Sequential Routing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is User Registered?": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Profile Data": {
      "ai_tool": [
        [
          {
            "node": "Profile Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Analyze Text Message": {
      "main": [
        [
          {
            "node": "Format Text Analysis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Text Analysis": {
      "main": [
        [
          {
            "node": "Merge2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Input Message Router": {
      "main": [
        [
          {
            "node": "Analyze Text Message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Download Voice Message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Download IMAGE",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "get_error_message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze voice message": {
      "main": [
        [
          {
            "node": "get_message (Audio/Video message)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "State-Setting Node #1": {
      "main": [
        [
          {
            "node": "Send a text message2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "logMealAnalysis(tool)": {
      "ai_tool": [
        [
          {
            "node": "The Log Meal Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Create Success Message": {
      "main": [
        [
          {
            "node": "MarkdownV2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Voice Message": {
      "main": [
        [
          {
            "node": "Fix mime",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Conversation State": {
      "main": [
        [
          {
            "node": "Conversation State Router",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get_message (register)": {
      "main": [
        [
          {
            "node": "Register Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Update Meal Agent (Step 3 - Final Output)",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Update Meal Agent (Step 1 - Ask for ID)",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Update Meal Agent (Step 2 - Ask for Desc)",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Set Update Profile State": {
      "ai_tool": [
        [
          {
            "node": "Profile Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Conversation State Router": {
      "main": [
        [
          {
            "node": "Update Meal Agent (Step 2 - Ask for Desc)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update Meal Agent (Step 3 - Final Output)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Profile Agent",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Cal AI Router Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Register Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model2": {
      "ai_languageModel": [
        [
          {
            "node": "Cal AI Router Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model3": {
      "ai_languageModel": [
        [
          {
            "node": "The Log Meal Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model4": {
      "ai_languageModel": [
        [
          {
            "node": "Report Agent",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Profile Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "get_message (Media  message)": {
      "main": [
        [
          {
            "node": "Merge2",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "get_message (Audio/Video message)": {
      "main": [
        [
          {
            "node": "Merge2",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "New Description State-Setting Node #2": {
      "main": [
        [
          {
            "node": "Send a text message3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Meal Agent (Step 1 - Ask for ID)": {
      "main": [
        [
          {
            "node": "MarkdownV3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Meal Agent (Step 2 - Ask for Desc)": {
      "main": [
        [
          {
            "node": "MarkdownV4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Meal Agent (Step 3 - Final Output)": {
      "main": [
        [
          {
            "node": "Re-Analyze Meal",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

How this works

Users who want to track calories and log meals without opening an app can send photos or text descriptions directly through Telegram, where the workflow analyses the content with Gemini AI, calculates nutritional values, and stores the results in a data table for later review. The key step is the AI agent that interprets the input, decides whether to ask clarifying questions or record the entry, and maintains conversation context across messages. This approach suits anyone who prefers quick voice or photo logging over manual entry in spreadsheets or dedicated fitness apps.

Use it for daily personal tracking or small-scale coaching setups where flexibility matters more than strict data validation. Avoid it for clinical nutrition programmes or large teams needing audit trails and export controls. A common variation replaces the memory buffer with a database lookup to pull previous entries before the AI decides on the next action.

About this workflow

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

Source: https://n8n.io/workflows/9294/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

Telegram Trigger receives incoming messages (text, voice, photo, document). Switch routes by message type to appropriate processors: Text → forwarded as-is. Voice → downloaded and sent to Transcribe a

Memory Buffer Window, Telegram Trigger, Telegram +12
AI & RAG

Transform your Telegram messenger into a powerful, multi-modal personal or team assistant. This n8n workflow creates an intelligent agent that can understand text, voice, images, and documents, and ta

Memory Buffer Window, Telegram Trigger, Telegram +10
AI & RAG

> AI-powered nutrition assistant for Telegram — log meals, set goals, and get personalized daily reports with Google Sheets integration.

Telegram, Google Gemini, Google Gemini Chat +7
AI & RAG

Overview

Google Gemini Chat, Agent, Telegram Trigger +6
AI & RAG

Multi Agent System Benefits. Uses gmailTool, lmChatOpenAi, agent, googleCalendarTool. Event-driven trigger; 46 nodes.

Gmail Tool, OpenAI Chat, Agent +12