Skip to main content

Log LINE invoice photos to Google Sheets with OCR.space and Gemini AI

Workflow preview

Workflow preview
100%
Log LINE invoice photos to Google Sheets with OCR.space and Gemini AI preview
Open on n8n.io

1. Workflow Overview

Who is this for Freelancers, small business owners, and accounting teams in Japan who receive invoices and want to eliminate manual data entry into spreadsheets. What this workflow does Send an inv...

Best for

  • Invoice Processing automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

@n8n/n8n-nodes-langchain.lmchatgooglegemini, n8n-nodes-base.stickynote, n8n-nodes-base.webhook, n8n-nodes-base.respondtowebhook, n8n-nodes-base.if, n8n-nodes-base.set, n8n-nodes-base.httprequest, n8n-nodes-base.code

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Ryo Sayama.

Original n8n.io source

1.1 Workflow description

Title
Log LINE invoice photos to Google Sheets with OCR.space and Gemini AI
Workflow name
Log LINE invoice photos to Google Sheets with OCR.space and Gemini AI

Who is this for

Freelancers, small business owners, and accounting teams in Japan who receive invoices and want to eliminate manual data entry into spreadsheets.

What this workflow does

Send an invoice photo to your LINE bot and the rest is automatic. The workflow fetches the image via LINE Messaging API, runs it through OCR.space to extract raw text, then passes that text to a Gemini AI Agent to parse the key fields — invoice number, date, due date, vendor name, subtotal, tax, and total. The result is appended as a new row in your Google Sheets ledger and a confirmation is sent back to LINE. If the image is not an invoice, a friendly error message is returned instead.

How to set up

  1. Create a LINE Messaging API channel and get your Channel Access Token
  2. Get a free OCR.space API key at ocr.space/ocrapi/freekey
  3. Get a free Gemini API key at aistudio.google.com
  4. Set up Google Sheets OAuth2 credentials in n8n
  5. Enter your LINE token, OCR key, and Spreadsheet ID in the Variables node
  6. Set the Webhook URL in LINE Developers to your n8n instance URL
  7. Activate the workflow and send an invoice photo to your LINE bot

Requirements

  • LINE Messaging API channel and channel access token
  • OCR.space API key (free tier: 25,000 requests/month)
  • Google Gemini API key (free tier: 1,500 requests/day)
  • Google Sheets with OAuth2 credentials configured in n8n

How to customize

Change SHEET_NAME in the Variables node to file invoices by month. Edit the Gemini prompt to capture extra fields like bank details or line items. Swap OCR.space for Google Cloud Vision API if you need better accuracy on complex layouts.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Google Gemini Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - lmChatGoogleGemini
Config choices
Version 1

Block 2 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - Receive LINE Webhook

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2

Block 4 - Return 200 OK to LINE

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1

Block 5 - Check Image Message

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Block 6 - Variables (API Key Management)

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 7 - Fetch Image from LINE

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 8 - Convert Image to Base64

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 9 - OCR - Extract Text from Image

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.4

Block 10 - AI Agent - Parse Invoice with Gemini

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 3.1

Block 11 - Parse & Format JSON

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 12 - Error Check

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 13 - Append to Google Sheets

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.4

Block 14 - LINE Reply - Success

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.4

Block 15 - LINE Reply - Error

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.4

Block 16 - LINE Reply - Not an Image

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.4

Block 17 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 18 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 19 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 20 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 21 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 22 - Sticky Note6

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Log LINE invoice photos to Google Sheets with OCR.space and Gemini AI
Complexity advanced
Nodes 22
Categories Invoice Processing, AI Summarization
Author Ryo Sayama
Published 21 Mar 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/14210/14210.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Log LINE invoice photos to Google Sheets with OCR.space and Gemini AI do?

Who is this for Freelancers, small business owners, and accounting teams in Japan who receive invoices and want to eliminate manual data entry into spreadsheets. What this workflow does Send an inv...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Invoice Processing, AI Summarization use case.