Automate pay slip data extraction from Line images using an n8n workflow leveraging Google Gemini vision capabilities. Log results instantly to Google Sheets.
Download this n8n workflow template and start using it instantly.
This comprehensive n8n workflow addresses the challenge of manually extracting structured financial data from unstructured image submissions, such as pay slips or receipts, sent via the Line messaging application. By implementing a sophisticated AI structure, this n8n template automatically classifies the incoming message type (text or image) using the initial n8n trigger. If an image is detected, the workflow utilizes the multimodal power of Google Gemini to perform accurate data extraction (OCR) for fields like Status, Date, From, To, and Amount. The resulting data is then cleanly appended to a Google Sheet, ensuring efficient record-keeping. This robust n8n workflow offers dual functionality: a smart conversational agent for text messages and a specialized data extraction tool, showcasing the flexibility of the n8n node architecture.
The entire automation begins with the Line: Messaging API n8n trigger, which listens for new messages. The subsequent Message Classification switch n8n node directs the flow based on the message type (text or image).
For Text Messages: The message flows to the Text Message Processing LangChain agent. This agent utilizes the Window Buffer Memory n8n node to maintain conversation context based on the user ID, ensuring continuity. The core logic is powered by the Google Gemini for Text model. The final response from the AI is returned to the user via the Line: Text Response to User HTTP Request n8n node.
For Image Messages (Pay Slips): The flow first uses the Line: Get Image HTTP Request n8n node to fetch the actual image binary content using the message ID. This binary data is then passed to the Image Message Processing LangChain LLM Chain n8n node, which connects to the Google Gemini for Image model. A specific instruction is provided, asking Gemini to analyze the pay slip image and return the extracted data strictly in a JSON format containing Status, From, To, Date, and Amount. The resulting JSON is extracted, replied to the user via the Line: Response to User n8n node, and finally, parsed and inserted into a Google Sheet using the Text from Slip Result n8n node, completing this powerful n8n workflow.
Line: Messaging API n8n trigger webhook path and connect it to your Line developer console.Google Gemini for Text and Google Gemini for Image n8n node configurations. Line: Messaging API (n8n trigger): The starting n8n node. It acts as a webhook to instantly receive incoming text or image messages from the Line chat platform.
Message Classification (Switch n8n node): A critical flow control element that checks the incoming message type (text or image) and routes the execution down the appropriate processing path.
Window Buffer Memory (n8n node): Used in the text path to store and manage the conversational history for each unique user session ID, enhancing the AI agent's responsiveness.
Google Gemini for Text/Image (n8n node): Specifies the models/gemini-2.0-flash-exp model, providing the underlying large language model capabilities for both conversation and vision tasks within this n8n workflow.
Text Message Processing (LangChain Agent n8n node): Handles conversational input, integrating memory and the Gemini LLM to generate relevant text responses.
Line: Get Image (HTTP Request n8n node): Executes a GET request to the Line data API to securely download the image binary content sent by the user, preparing it for AI analysis.
Image Message Processing (LangChain LLM Chain n8n node): Uses a specific, structured prompt combined with the image binary to instruct Gemini to extract financial fields (Status, From, To, Date, Amount) and return them as a JSON object, enabling structured data handling.
Text from Slip Result (Google Sheets n8n node): The final action in the image processing path. This n8n node parses the JSON output from Gemini and uses the 'Append' operation to insert the extracted pay slip data into the configured Google Sheet.
Use this powerful n8n workflow to automatically extract structured data from PDF travel itineraries using GPT-4o-mini, save results to Google Sheets, and send confirmation emails via Gmail. Explore n8n templates for document automation.

Use this advanced n8n workflow to automatically analyze new Google Drive documents, extract text using Foxit, identify organizations with Diffbot, and send a summary report via Gmail.

Use this powerful n8n workflow to extract named entities (people, organizations, locations) from any web page URL using the Google Natural Language API. Automate data analysis tasks.

Use this powerful n8n workflow to enrich lead data, verify corporate emails, find LinkedIn profiles, extract key information, and calculate an ICP score using Airtop. Ideal for sales automation.

Use this efficient n8n workflow to automate medical document processing. Extract structured physician orders using the VLM Run n8n node and automatically log key healthcare data directly into Google Sheets for compliance and tracking.

Use this powerful n8n workflow template to automate competitor monitoring. Capture full-page screenshots, extract detailed product data using Dumpling AI and GPT-4o, and save structured results to Google Sheets. This n8n workflow enhances market intelligence.

Automation consultant with 1 year experience helping Sales & Marketing teams to streamline their processes. Use my link to book an initial consultation for custom n8n work.







































