{ "name": "LINE receipt photo → Thai Receipt → Google Sheets", "nodes": [ { "parameters": { "events": ["message"] }, "id": "a1b2c3d4-0001-4000-8000-000000000001", "name": "LINE Webhook", "type": "@aotoki/n8n-nodes-line-messaging.lineMessagingTrigger", "typeVersion": 1, "position": [0, 300], "webhookId": "thai-receipt-line", "credentials": { "lineMessagingApi": { "id": "REPLACE_ME", "name": "LINE OA" } } }, { "parameters": { "conditions": { "options": { "caseSensitive": true, "typeValidation": "strict" }, "conditions": [ { "id": "cond-image", "leftValue": "={{ $json.message.type }}", "rightValue": "image", "operator": { "type": "string", "operation": "equals" } } ], "combinator": "and" }, "options": {} }, "id": "a1b2c3d4-0002-4000-8000-000000000002", "name": "Is image?", "type": "n8n-nodes-base.if", "typeVersion": 2, "position": [220, 300] }, { "parameters": { "operation": "getContent", "messageId": "={{ $json.message.id }}", "binaryPropertyName": "data" }, "id": "a1b2c3d4-0003-4000-8000-000000000003", "name": "Download photo", "type": "@aotoki/n8n-nodes-line-messaging.lineMessagingData", "typeVersion": 1, "position": [440, 200], "credentials": { "lineMessagingApi": { "id": "REPLACE_ME", "name": "LINE OA" } } }, { "parameters": { "operation": "extract", "binaryPropertyName": "data", "outputMode": "receipt", "effort": "medium", "model": "claude-opus-5-5" }, "id": "a1b2c3d4-0004-4000-8000-000000000004", "name": "Extract receipt", "type": "n8n-nodes-thai-receipt.thaiReceipt", "typeVersion": 1, "position": [660, 200], "credentials": { "anthropicReceiptApi": { "id": "REPLACE_ME", "name": "Anthropic" } } }, { "parameters": { "operation": "append", "documentId": { "__rl": true, "mode": "url", "value": "https://docs.google.com/spreadsheets/d/REPLACE_ME" }, "sheetName": { "__rl": true, "mode": "name", "value": "Receipts" }, "columns": { "mappingMode": "defineBelow", "value": { "Date": "={{ $json.date }}", "Seller": "={{ $json.seller_name }}", "Tax ID": "={{ $json.seller_tax_id_normalized }}", "Doc No": "={{ $json.document_number }}", "Subtotal": "={{ $json.subtotal }}", "VAT": "={{ $json.vat_amount }}", "Total": "={{ $json.total }}", "Items": "={{ $json.item_count }}", "Needs review": "={{ $json.needs_review }}", "Review reasons": "={{ $json.review_reasons }}" } }, "options": {} }, "id": "a1b2c3d4-0005-4000-8000-000000000005", "name": "Append to Google Sheets", "type": "n8n-nodes-base.googleSheets", "typeVersion": 4.5, "position": [880, 200], "credentials": { "googleSheetsOAuth2Api": { "id": "REPLACE_ME", "name": "Google Sheets" } } }, { "parameters": { "operation": "reply", "replyToken": "={{ $('LINE Webhook').item.json.replyToken }}", "messages": { "values": [ { "type": "textV2", "text": "={{ $('Extract receipt').item.json.needs_review ? '⚠️ บันทึกแล้ว แต่ควรตรวจสอบ: ' + $('Extract receipt').item.json.review_reasons : '✅ บันทึกใบเสร็จแล้ว' }}\n{{ $('Extract receipt').item.json.seller_name }} · {{ $('Extract receipt').item.json.date }} · ฿{{ $('Extract receipt').item.json.total }}" } ] } }, "id": "a1b2c3d4-0006-4000-8000-000000000006", "name": "Reply on LINE", "type": "@aotoki/n8n-nodes-line-messaging.lineMessaging", "typeVersion": 1, "position": [1100, 200], "credentials": { "lineMessagingApi": { "id": "REPLACE_ME", "name": "LINE OA" } } } ], "connections": { "LINE Webhook": { "main": [[{ "node": "Is image?", "type": "main", "index": 0 }]] }, "Is image?": { "main": [[{ "node": "Download photo", "type": "main", "index": 0 }], []] }, "Download photo": { "main": [[{ "node": "Extract receipt", "type": "main", "index": 0 }]] }, "Extract receipt": { "main": [[{ "node": "Append to Google Sheets", "type": "main", "index": 0 }]] }, "Append to Google Sheets": { "main": [[{ "node": "Reply on LINE", "type": "main", "index": 0 }]] } }, "settings": { "executionOrder": "v1" }, "pinData": {} }