{
  "name": "Create AI diary entries from LINE photos with OpenAI Vision and Google Drive",
  "nodes": [
    {
      "id": "2bf0e475-39e6-4780-914e-805f609bd9e6",
      "name": "LINE Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        496,
        560
      ]
    },
    {
      "id": "07fcd5e7-3957-462c-8b8c-6c457a5a139d",
      "name": "Extract LINE Message Data",
      "type": "n8n-nodes-base.code",
      "position": [
        720,
        560
      ]
    },
    {
      "id": "7cf0a1b2-9886-4872-b7da-36a139433e95",
      "name": "Get Image from LINE",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        944,
        560
      ]
    },
    {
      "id": "ae8e9d41-31e7-414a-8be2-c3f1a431706b",
      "name": "OpenAI Vision - Generate Diary",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        1168,
        560
      ]
    },
    {
      "id": "984a70ea-e52f-48ca-9f8f-9677ace45305",
      "name": "Prepare Folder Path",
      "type": "n8n-nodes-base.code",
      "position": [
        1392,
        560
      ]
    },
    {
      "id": "ec8032aa-d22e-4811-8bba-b3d01961b295",
      "name": "Create Folder Structure",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1616,
        496
      ]
    },
    {
      "id": "07336be8-4edc-4cc9-8123-e27b63f59783",
      "name": "Upload Photo to Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        2064,
        464
      ]
    },
    {
      "id": "63606387-0f0b-4730-a419-6471d760a1c2",
      "name": "Reply to LINE",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2512,
        656
      ]
    },
    {
      "id": "14e0396e-fec5-4288-b2c2-1204a5c831a5",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        1840,
        560
      ]
    },
    {
      "id": "e42265f4-da00-48e3-a620-76cdff9568ab",
      "name": "Convert to File",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        2064,
        656
      ]
    },
    {
      "id": "0d1301b6-4a36-41c2-b023-39c3e5abde15",
      "name": "Upload Photo to diary　new",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        2288,
        656
      ]
    },
    {
      "id": "97921c19-4783-42a0-af7a-2e339e2d11ea",
      "name": "Sticky Note - Step 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        768,
        192
      ],
      "parameters": {
        "width": 376,
        "height": 268,
        "content": "## Step 1 – Receive photo\n\nThis group handles the incoming image from LINE:\n\n- **LINE Webhook** receives the photo message from the user.\n- **Extract LINE Message Data** pulls out the `messageId` and "
      }
    },
    {
      "id": "e773de44-7edb-4e6c-b98d-8c050760f23c",
      "name": "Sticky Note - Step 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1152,
        736
      ],
      "parameters": {
        "width": 440,
        "height": 332,
        "content": "## Step 2 – Create diary text & folder path\n\nThese nodes generate the AI diary sentence and prepare where it will be stored:\n\n- **OpenAI Vision – Generate Diary** analyzes the photo and returns a shor"
      }
    },
    {
      "id": "39c6583d-e08f-4993-aba2-cb7ab9e771cd",
      "name": "Sticky Note - Step 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1696,
        112
      ],
      "parameters": {
        "width": 360,
        "height": 348,
        "content": "## Step 3 – Prepare diary file for Google Drive\n\nHere we combine data and create the text file that will sit next to the photo:\n\n- **Merge** joins together the original image metadata and the AI diary"
      }
    },
    {
      "id": "913f4033-3fbf-4dc0-80e5-0ee976ba5f04",
      "name": "Sticky Note - Step 4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2160,
        848
      ],
      "parameters": {
        "width": 440,
        "height": 284,
        "content": "## Step 4 – Save original photo & confirm to user\n\nFinally, the workflow stores the original image and lets the user know everything worked:\n\n- **Upload Photo to Drive** uploads the original photo int"
      }
    },
    {
      "id": "7d34abbd-265f-4e3f-85bf-d684593ab04f",
      "name": "Sticky Note - Overview1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -48,
        -80
      ],
      "parameters": {
        "width": 584,
        "height": 600,
        "content": "## LINE Photo to AI Diary with Google Drive Storage\n\nThis workflow turns every photo sent to your LINE bot into a tiny AI-generated diary entry, plus neatly named image and text files in Google Drive."
      }
    }
  ],
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Convert to File",
            "type": "main",
            "index": 0
          },
          {
            "node": "Upload Photo to Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "LINE Webhook": {
      "main": [
        [
          {
            "node": "Extract LINE Message Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to File": {
      "main": [
        [
          {
            "node": "Upload Photo to diary　new",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Image from LINE": {
      "main": [
        [
          {
            "node": "OpenAI Vision - Generate Diary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Folder Path": {
      "main": [
        [
          {
            "node": "Create Folder Structure",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Create Folder Structure": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract LINE Message Data": {
      "main": [
        [
          {
            "node": "Get Image from LINE",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Photo to diary　new": {
      "main": [
        [
          {
            "node": "Reply to LINE",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Vision - Generate Diary": {
      "main": [
        [
          {
            "node": "Prepare Folder Path",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}