Log food calories from images to Google Sheets using LINE and OpenAI Vision
Ready for 3.0What this workflow does
This AI workflow has 14 nodes and runs when an HTTP POST request hits its webhook URL. Along the way it connects OpenAI Chat Model, OpenAI and Google Sheets. It also calls api.line.me over HTTP.
How it runs
Trigger: When an HTTP POST request hits its webhook URL.
- user verification (If): checks a condition and branches into true / false
- Switch: routes items into 2 branches
- only message (Edit Fields (Set)): sets 1 field: text
- images download (HTTP Request): calls an HTTP API
- AI Agent: runs an AI agent, with model: OpenAI Chat Model; memory: Simple Memory
- Analyze image (OpenAI): analyze (image)
- send LINE (HTTP Request): calls api.line.me (POST)
- Code: runs custom JavaScript code
- Code: runs custom JavaScript code
- Append row in sheet (Google Sheets): append
…plus 1 more step. See the full node list below.
Services it uses
HTTP calls to: api.line.me
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (11)
- Switch
n8n-nodes-base.switch - AI Agent
@n8n/n8n-nodes-langchain.agent - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - OpenAI
@n8n/n8n-nodes-langchain.openAi - Edit Fields (Set)
n8n-nodes-base.set - Simple Memory
@n8n/n8n-nodes-langchain.memoryBufferWindow - Code
n8n-nodes-base.code - Google Sheets
n8n-nodes-base.googleSheets - Webhook
n8n-nodes-base.webhook - If
n8n-nodes-base.if - HTTP Request
n8n-nodes-base.httpRequest
From the author
This workflow allows a LINE user to send either text or an image of food to a connected LINE bot. If text is sent, the AI agent responds directly via LINE. If an image is sent, the workflow downloads it from LINE’s API, analyzes it using OpenAI’s Vision…