{
  "name": "Track meal nutrition from meal photos with LINE, Google Gemini and Google Sheets",
  "nodes": [
    {
      "id": "7bfd63f9-80bf-44a9-8e6c-957343f7cd65",
      "name": "Workflow Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -448,
        -64
      ],
      "parameters": {
        "width": 540,
        "height": 576,
        "content": "## 🍽️ AI Meal Nutrition Tracker\n\nThis workflow creates an AI-powered meal tracking assistant that analyzes food photos and provides nutritional insights.\n\n## How it works\n1. Receive meal photo via LIN"
      }
    },
    {
      "id": "1c2d946f-cbac-4a67-a810-2db757d50050",
      "name": "Step 1 - Trigger & Config",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        112,
        -64
      ],
      "parameters": {
        "width": 588,
        "height": 380,
        "content": "## Trigger & Configuration\nReceives LINE webhook events and loads API credentials and configuration settings.\n\n**LINE Webhook**: Listens for incoming messages from LINE\n**Config**: Stores all necessar"
      }
    },
    {
      "id": "f282d8f4-493e-4857-8b9d-272242d4a126",
      "name": "Step 2 - Image Processing",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        720,
        -64
      ],
      "parameters": {
        "width": 420,
        "height": 760,
        "content": "## AI Food Analysis\nDownloads meal image from LINE and uses Google Gemini to:\n- Identify food items\n- Estimate nutritional content\n- Calculate health score\n- Generate personalized advice"
      }
    },
    {
      "id": "09bcc428-df71-49fc-8981-7069cb629297",
      "name": "Step 3 - Data Storage",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1168,
        -64
      ],
      "parameters": {
        "width": 1140,
        "height": 760,
        "content": "## Data Processing & Storage\nParses AI response, structures nutritional data, uploads meal photo to Google Drive, and logs everything to Google Sheets for tracking history."
      }
    },
    {
      "id": "01c11aba-87cb-4480-ae7e-849d3cd58d0d",
      "name": "Step 4 - Response",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2320,
        -64
      ],
      "parameters": {
        "width": 440,
        "height": 760,
        "content": "## LINE Response\nSends formatted nutritional analysis and health advice back to the user via LINE message."
      }
    },
    {
      "id": "507db298-802f-41de-b74b-0d4a31836a55",
      "name": "LINE Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        128,
        144
      ]
    },
    {
      "id": "bd86d3fe-6c3e-4439-9215-9d4d6e2af3bc",
      "name": "Config",
      "type": "n8n-nodes-base.set",
      "position": [
        352,
        144
      ]
    },
    {
      "id": "9bbd4988-61dc-462e-acb3-78d00177bfc9",
      "name": "Check If Image",
      "type": "n8n-nodes-base.switch",
      "position": [
        592,
        144
      ]
    },
    {
      "id": "330d67a0-d949-4b1a-9560-478a5128bf5c",
      "name": "Download Image from LINE",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        864,
        144
      ]
    },
    {
      "id": "660c9c78-9daf-47c0-9dd0-6f9a14f0b032",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        784,
        560
      ]
    },
    {
      "id": "aff67f4f-8d62-4c63-ac26-2b8ce6270414",
      "name": "Analyze Meal with AI",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        784,
        384
      ]
    },
    {
      "id": "9ed1be62-cd91-4130-ab13-3726de92d1f4",
      "name": "Check Analysis Result",
      "type": "n8n-nodes-base.if",
      "position": [
        1216,
        384
      ]
    },
    {
      "id": "c423df6f-e10f-4c0c-9d75-eaacb77d9158",
      "name": "Parse Nutrition Data",
      "type": "n8n-nodes-base.code",
      "position": [
        1440,
        192
      ]
    },
    {
      "id": "fdaa95dd-91af-4d8c-8226-1e5347fc9a46",
      "name": "Notify Not Food Image",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1440,
        480
      ]
    },
    {
      "id": "51d7e19c-72c8-479a-b014-611cb4c3f59b",
      "name": "Merge Data",
      "type": "n8n-nodes-base.merge",
      "position": [
        1680,
        96
      ]
    },
    {
      "id": "c1a3d420-6eb5-4c64-89bb-9a8466e23247",
      "name": "Upload to Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1904,
        96
      ]
    },
    {
      "id": "3ddf8488-c0f3-4636-ab42-8d9f510ef972",
      "name": "Save to Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2128,
        96
      ]
    },
    {
      "id": "fd97ad04-0b00-4912-8a2e-10abd844ee98",
      "name": "Reply to LINE",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2496,
        96
      ]
    }
  ],
  "connections": {
    "Config": {
      "main": [
        [
          {
            "node": "Check If Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Data": {
      "main": [
        [
          {
            "node": "Upload to Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "LINE Webhook": {
      "main": [
        [
          {
            "node": "Config",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check If Image": {
      "main": [
        [
          {
            "node": "Download Image from LINE",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze Meal with AI": {
      "main": [
        [
          {
            "node": "Check Analysis Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Nutrition Data": {
      "main": [
        [
          {
            "node": "Merge Data",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Check Analysis Result": {
      "main": [
        [
          {
            "node": "Parse Nutrition Data",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Notify Not Food Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save to Google Sheets": {
      "main": [
        [
          {
            "node": "Reply to LINE",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload to Google Drive": {
      "main": [
        [
          {
            "node": "Save to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Image from LINE": {
      "main": [
        [
          {
            "node": "Merge Data",
            "type": "main",
            "index": 0
          },
          {
            "node": "Analyze Meal with AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Analyze Meal with AI",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}