N
n8n Store
Workflow Market
Telegram Food Calorie Tracker

Telegram Food Calorie Tracker

by shivp14130 views

描述

分类

📊 Productivity🤖 AI & Machine Learning

使用的节点

n8n-nodes-base.openain8n-nodes-base.functionn8n-nodes-base.telegramn8n-nodes-base.telegramn8n-nodes-base.telegramn8n-nodes-base.googleSheetsn8n-nodes-base.telegramTrigger
价格免费
浏览量0
最后更新11/28/2025
workflow.json
{
  "name": "Telegram Food Calorie Tracker",
  "nodes": [
    {
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        200,
        300
      ],
      "parameters": {
        "updates": [
          "message"
        ]
      },
      "credentials": {
        "telegramApi": {
          "id": "{{TELEGRAM_API_CREDENTIAL_ID}}",
          "name": "Telegram Account"
        }
      },
      "typeVersion": 1
    },
    {
      "name": "Sticky Note: Acknowledge",
      "type": "n8n-nodes-base.telegram",
      "position": [
        400,
        300
      ],
      "parameters": {
        "text": "🧠 Thanks! I’m analyzing your food image now...",
        "chatId": "={{$json[\"message\"][\"chat\"][\"id\"]}}",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "{{TELEGRAM_API_CREDENTIAL_ID}}",
          "name": "Telegram Account"
        }
      },
      "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": {
          "id": "{{TELEGRAM_API_CREDENTIAL_ID}}",
          "name": "Telegram Account"
        }
      },
      "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": {
          "id": "{{OPENAI_API_CREDENTIAL_ID}}",
          "name": "OpenAI Account"
        }
      },
      "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": {
          "id": "{{GOOGLE_API_CREDENTIAL_ID}}",
          "name": "Google Sheets Account"
        }
      },
      "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": {
          "id": "{{TELEGRAM_API_CREDENTIAL_ID}}",
          "name": "Telegram Account"
        }
      },
      "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
          }
        ]
      ]
    }
  }
}

相关工作流