Log LINE receipt photos to Google Sheets using OpenAI
Quick overview This workflow receives receipt photos from LINE via webhook, uses OpenAI to extract structured expense details, and appends or updates a Google Sheets expense log using the LINE message ID to prevent duplicates, then replies in LINE with a success or error message.
How it works Receives a webhook request from the LINE Messaging API and checks that the event contains an image message. If the message is not an image, replies to the user in LINE asking for a receipt photo. Downloads the receipt image from the LINE content API and converts it to Base64. Sends the image to OpenAI Chat Completions with a strict JSON schema to extract date, store, category, amount, currency, and memo. Validates and sanitizes the extracted fields (date and currency formats, allowed categories, non-negative amount, and formula-safe text) and uses the LINE message ID as a receipt identifier. Appends or updates the expense row in Google Sheets using “Receipt ID” as the matching key, then replies in LINE with the logged details or a processing error if any step fails.
Setup Create or configure a LINE Official Account and Messaging API channel, then register the n8n production webhook URL in LINE Developers. Add a LINE channel access token as an HTTP Header Auth credential (Authorization: Bearer ) and select it on the LINE download and reply requests. Add an OpenAI API credential and ensure the selected model in the workflow settings supports image inputs. Add a Google Sheets OAuth credential, set your spreadsheet ID and sheet name in the workflow settings, and create the columns: Receipt ID, Date, Store, Category, Amount, Currency, Memo. Update the workflow settings for default currency and category list to match your bookkeeping needs, and test with a clear receipt photo before activating.
Related Templates
Verify Linkedin Company Page by Domain with Airtop
Automating LinkedIn Company URL Verification Use Case This automation verifies that a given LinkedIn URL actually belo...
Create a Speech-to-Text API with OpenAI GPT4o-mini Transcribe
Description This template provides a simple and powerful backend for adding speech-to-text capabilities to any applicat...
Build a Restaurant Voice Assistant with VAPI and PostgreSQL for Bookings & Orders
This n8n template demonstrates how to create a comprehensive voice-powered restaurant assistant that handles table reser...
🔒 Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments