AutomationFlowsAI & RAG › Track Food Calories via Telegram with Gpt-4 Vision and Google Sheets

Track Food Calories via Telegram with Gpt-4 Vision and Google Sheets

ByShiva @shivp1413 on n8n.io

This workflow enables users to submit food images to a Telegram bot, which uses OpenAI’s GPT-4 Vision to identify the item and estimate its caloric value. The results are stored in Google Sheets and sent back to the user. Triggers on a photo sent via Telegram. Acknowledges the…

Event trigger★★★★☆ complexityAI-powered7 nodesTelegram TriggerTelegramOpenAIGoogle Sheets
AI & RAG Trigger: Event Nodes: 7 Complexity: ★★★★☆ AI nodes: yes Added:

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

This workflow follows the Google Sheets → OpenAI 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": "Telegram Food Calorie Tracker",
  "nodes": [
    {
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        200,
        300
      ],
      "parameters": {
        "updates": [
          "message"
        ]
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "name": "Sticky Note: Acknowledge",
      "type": "n8n-nodes-base.telegram",
      "position": [
        400,
        300
      ],
      "parameters": {
        "text": "\ud83e\udde0 Thanks! I\u2019m analyzing your food image now...",
        "chatId": "={{$json[\"message\"][\"chat\"][\"id\"]}}",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "name": "Download Telegram Image",
      "type": "n8n-nodes-base.telegram",
      "position": [
        600,
        300
      ],
      "parameters": {
        "fileId": "={{$json[\"message\"][\"photo\"][ $json[\"message\"][\"photo\"].length - 1 ][\"file_id\"]}}",
        "resource": "file",
        "operation": "download"
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "name": "Prepare Binary Image",
      "type": "n8n-nodes-base.function",
      "position": [
        800,
        300
      ],
      "parameters": {
        "functionCode": "return [{ binary: { image: items[0].binary.data } }];"
      },
      "typeVersion": 1
    },
    {
      "name": "GPT-4 Vision Analyze",
      "type": "n8n-nodes-base.openai",
      "position": [
        1000,
        300
      ],
      "parameters": {
        "model": "gpt-4-vision-preview",
        "messages": [
          {
            "role": "user",
            "content": [
              {
                "text": "Describe this food and estimate its calories.",
                "type": "text"
              },
              {
                "type": "image_url",
                "image_url": "={{$binary.image.data}}"
              }
            ]
          }
        ]
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "name": "Log to Google Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1200,
        300
      ],
      "parameters": {
        "range": "Sheet1!A:C",
        "values": "={{ [[new Date().toISOString(), $json[\"text\"]]] }}",
        "options": {},
        "sheetId": "{{GOOGLE_SHEET_ID}}",
        "authentication": "oAuth2"
      },
      "credentials": {
        "googleApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "name": "Send GPT Result",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1400,
        300
      ],
      "parameters": {
        "text": "={{$json[\"text\"]}}",
        "chatId": "={{$json[\"message\"][\"chat\"][\"id\"]}}",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "connections": {
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Sticky Note: Acknowledge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GPT-4 Vision Analyze": {
      "main": [
        [
          {
            "node": "Log to Google Sheet",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send GPT Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Binary Image": {
      "main": [
        [
          {
            "node": "GPT-4 Vision Analyze",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Telegram Image": {
      "main": [
        [
          {
            "node": "Prepare Binary Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sticky Note: Acknowledge": {
      "main": [
        [
          {
            "node": "Download Telegram Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

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

About this workflow

This workflow enables users to submit food images to a Telegram bot, which uses OpenAI’s GPT-4 Vision to identify the item and estimate its caloric value. The results are stored in Google Sheets and sent back to the user. Triggers on a photo sent via Telegram. Acknowledges the…

Source: https://n8n.io/workflows/7006/ — 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

Ask questions like “How much did I spend on food last month?” and get instant answers from your financial data — directly in Telegram.

Telegram Trigger, OpenAI, Google Sheets +2
AI & RAG

Most expense tracker apps (like Money Lover, Spendee, or Wallet) have a common friction point: Data Entry. You have to unlock your phone, find the app, wait for it to load, navigate menus, and manuall

Google Sheets, Google Gemini, Telegram +2
AI & RAG

&gt; ⚠️ Disclaimer: This workflow uses Community Nodes and must be run on a self-hosted instance of n8n.

HTTP Request, Telegram Trigger, Telegram +2
AI & RAG

Viral Tik Tok Clone Finder. Uses httpRequest, telegramTrigger, openAi, googleSheets. Event-driven trigger; 41 nodes.

HTTP Request, Telegram Trigger, OpenAI +2
AI & RAG

Sales Lead Qualifier. Uses telegramTrigger, googleSheets, telegram, googleGemini. Event-driven trigger; 41 nodes.

Telegram Trigger, Google Sheets, Telegram +3