Quick overview
This workflow lets users register fridge items by sending images to LINE, uses Google Gemini to extract item details, saves them to Google Sheets, and runs a daily check to notify users in LINE with AI-generated meal ideas for items expiring soon.
How it works
- Receives a POST webhook from the LINE Messaging API when a user sends a message containing a food package image.
- Downloads the image content from LINE and sends it to Google Gemini to extract the food name, expiration date, storage location, and notes in a fixed text format.
- Appends the extracted details to a Google Sheets inventory table with an “In Stock” status, registration timestamp, and the originating LINE user ID.
- Replies to the user in LINE confirming the registration and echoing the stored item details.
- Runs every day at 9:00 to read all rows from the Google Sheets inventory.
- Filters the sheet to items marked as in stock whose expiration dates fall between today and the next three days, then aggregates the results into a single list.
- Uses Google Gemini to generate short Japanese meal suggestions based on the expiring items and sends the suggestions as a LINE push notification.
Setup
- Create a LINE Messaging API channel, enable webhooks, and add an HTTP Header Auth credential with your LINE channel access token for the LINE content, reply, and push endpoints.
- Add a Google Sheets OAuth2 credential and set the target spreadsheet and sheet to store your inventory rows.
- Add a Google Gemini (PaLM) API credential and confirm the selected Gemini model is available in your region/project.
- Ensure your Google Sheet columns match the workflow’s mappings (e.g., Food Name, Expiration Date, Storage Location, Status, Notes, AI Output, LINE User ID, Registered At) and update any localized column names used for filtering if they differ.
- Copy the n8n webhook URL for the /line-fridge path into your LINE webhook settings and verify your LINE bot can receive image messages.