Automate Pay Slip Text Extraction with Line & Google Gemini

This workflow automates extracting key pay slip details sent as images via Line chat, using Google Gemini AI for image analysis, and logs results to Google Sheets, saving hours of manual data entry and reducing errors.
lmChatGoogleGemini
httpRequest
googleSheets
+7
Workflow Identifier: 1690
NODES in Use: memoryBufferWindow, stickyNote, httpRequest, set, switch, agent, chainLlm, googleSheets, webhook, lmChatGoogleGemini
Automate pay slip text with n8n and Google

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

What this workflow does

This workflow listens to messages on Line chat and handles text and image inputs differently.
It pulls key data from pay slip images and chats, then saves info to Google Sheets.
It helps HR reduce manual work and errors in payroll extraction.

  • Gets message type from Line API webhook.
  • Uses Google Gemini AI to understand text or read pay slip images.
  • Replies to users with info or answers.
  • Saves extracted data to Google Sheets for records.


Who should use this workflow

This is for HR teams or payroll managers who get pay slips as images in Line group chats.
Anyone who needs to save time by automating text extraction from pay slips.

It fits companies using Line messaging, Google Sheets, and Google Gemini AI.
Users with basic n8n knowledge can deploy it easily.


Tools and services used


Beginner step-by-step: How to use this workflow in n8n production

Download and import workflow

  1. Download the workflow file using the Download button on this page.
  2. Inside the n8n editor, click “Import from File” and choose the downloaded workflow.

Configure credentials and settings

  1. Add or update your Line Messaging API credentials in n8n.
  2. Set the Google Gemini API Key in the LangChain nodes.
  3. Connect your Google Sheets account and update the spreadsheet URL and sheet name if needed.
  4. If needed, update any referenced IDs, tokens, or fields such as webhook path, or sheet columns.

Test and activate workflow

  1. Send a test message and/or pay slip image via Line chat to check if the workflow processes data.
  2. Review outputs and Google Sheets entries for correctness.
  3. Once confirmed, toggle the workflow to Active in n8n for production use.

For stable production use, consider hosting n8n on your own server. You can visit self-host n8n resources for help.


Inputs, Processing Steps, and Outputs

Inputs:

  • Messages (text or images) sent by employees in Line chat.
  • Authentication tokens and credentials for APIs.

Processing:

  1. Webhook node receives Line chat events.
  2. Set node extracts message type, text, user ID, and message ID.
  3. Switch node classifies message as text or image.
  4. If text, LangChain Conversational Agent with Google Gemini AI processes message context.
  5. If image, HTTP Request downloads pay slip from Line server using message ID.
  6. Google Gemini AI analyzes pay slip image to extract JSON fields: Status, From, To, Date, Amount.
  7. Responses sent back to user through Line Messaging API reply.
  8. Extracted pay slip data appended to Google Sheets for record keeping.

Outputs:

  • User receives replies with extracted info or chat answers.
  • Google Sheets document updated with pay slip data rows.


Customization ideas

  • Add new pay slip fields like “Employee ID” or “Department” in the LangChain prompt and Google Sheets mapping.
  • Change LangChain prompts to support multiple languages per employee base.
  • Add email notifications to alert payroll team after a new pay slip is saved.
  • Add file conversion if PDFs need to be processed by converting them to images first.
  • Adjust chat memory window size or timeout in Window Buffer Memory node for better session context.


Edge cases and errors

  • Cannot get image from Line API: Check URL and ensure stored Line API access token in n8n is valid.
  • Malformed JSON from AI: Fix LangChain prompt to clearly ask for JSON and add error handling.
  • User not getting replies: Verify replyToken from incoming Line events is used correctly and promptly.


Pre-deployment checklist

  • Confirm Line webhook receives and classifies both text and images properly.
  • Verify Google Gemini API key allows chat and image processing.
  • Ensure Google Sheets fields match exactly what AI outputs.
  • Check HTTP Header Auth credential for Line API is active.
  • Run full test: upload a pay slip image, confirm user reply, and check Google Sheets entry.


Deployment guide

Toggle the workflow Active switch in n8n to start handling live messages.
Monitor executions to catch any errors early.
This runs without keeping open servers, triggering on incoming events.
For heavier usage or uptime, consider self-host n8n.


Summary

✓ Saves 4-5 hours of manual pay slip data reading each pay cycle.
✓ Automatically extracts key payment info from chat images.
✓ Replies to employees with clear extracted details.
✓ Archives data reliably in Google Sheets.
✓ Easy to test, configure, and run within n8n.


Automate pay slip text with n8n and Google

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

Yes, other AI models like OpenAI GPT can be used instead of Google Gemini, but changes in prompt and output formats might be needed.
Yes, all calls to Google Gemini API count toward your Google API quota depending on the number and size of requests.
Data is stored in the connected Google Sheets document and temporarily processed within n8n, which must be secured properly.
Yes, but scaling depends on n8n hosting capabilities and Google API rate limits; using self-host n8n can help handle larger loads.

Promoted by BULDRR AI

Related Workflows

Automate Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.