{
  "name": "Extract order details from LINE messages and photos to Google Sheets with OpenAI",
  "nodes": [
    {
      "id": "a4329c24-ccf8-4bcf-abab-a4a639a43f5f",
      "name": "Workflow Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -64,
        1024
      ],
      "parameters": {
        "width": 420,
        "height": 752,
        "content": "## Extract order details from LINE messages and photos to Google Sheets with OpenAI\n\nAutomatically extract order information from text messages or handwritten memo photos sent via LINE, confirm with t"
      }
    },
    {
      "id": "96f3e14a-a0c6-4b1c-9ba6-dca78f563ee3",
      "name": "Routing Section",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        1280
      ],
      "parameters": {
        "width": 628,
        "height": 328,
        "content": "### Message Routing\nReceives LINE messages and routes them by type: text messages go directly to the AI Agent, image messages are downloaded first."
      }
    },
    {
      "id": "970e06ee-9789-4b66-85a1-e7ae755c03f9",
      "name": "Append Row to Google Sheets",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        1616,
        1696
      ]
    },
    {
      "id": "363db00b-9206-4c4d-a9dd-d30c9e4fec03",
      "name": "Reply via LINE",
      "type": "@aotoki/n8n-nodes-line-messaging.lineMessaging",
      "position": [
        1920,
        1472
      ]
    },
    {
      "id": "01f5bc0d-8fc6-46f8-bba0-81d82db016b3",
      "name": "Download LINE Image",
      "type": "@aotoki/n8n-nodes-line-messaging.lineMessagingData",
      "position": [
        1056,
        1632
      ]
    },
    {
      "id": "e1e2030a-d11d-47a4-a94e-7ee0b015def2",
      "name": "Route by Message Type",
      "type": "n8n-nodes-base.switch",
      "position": [
        768,
        1408
      ]
    },
    {
      "id": "43fec621-283d-4217-aead-96393036959c",
      "name": "AI Processing Section1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1200,
        1312
      ],
      "parameters": {
        "width": 646,
        "height": 524,
        "content": "### AI Processing & Data Entry\nGPT-4o analyzes text or images, extracts order details, confirms with the user via LINE, and appends approved orders to Google Sheets."
      }
    },
    {
      "id": "0a48a493-a3c7-498b-aaef-9b373547869e",
      "name": "AI Agent - Order Extractor1",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1424,
        1472
      ]
    },
    {
      "id": "009cab26-2625-473d-86a5-2d6a595a31ac",
      "name": "OpenAI GPT-4o1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1360,
        1696
      ]
    },
    {
      "id": "e264f81c-352e-4440-8014-714e01e7a011",
      "name": "Simple Memory - Chat History1",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        1488,
        1696
      ]
    },
    {
      "id": "c4c3a990-5d0d-41ee-8b3c-3e01f3003394",
      "name": "Line Messaging Trigger1",
      "type": "@aotoki/n8n-nodes-line-messaging.lineMessagingTrigger",
      "position": [
        544,
        1408
      ]
    }
  ],
  "connections": {
    "OpenAI GPT-4o1": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent - Order Extractor1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Download LINE Image": {
      "main": [
        [
          {
            "node": "AI Agent - Order Extractor1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route by Message Type": {
      "main": [
        [
          {
            "node": "AI Agent - Order Extractor1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Download LINE Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Line Messaging Trigger1": {
      "main": [
        [
          {
            "node": "Route by Message Type",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent - Order Extractor1": {
      "main": [
        [
          {
            "node": "Reply via LINE",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append Row to Google Sheets": {
      "ai_tool": [
        [
          {
            "node": "AI Agent - Order Extractor1",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory - Chat History1": {
      "ai_memory": [
        [
          {
            "node": "AI Agent - Order Extractor1",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    }
  }
}