Automated Receipt Data Extraction and Logging via WhatsApp - n8n Workflow

Use this powerful n8n workflow to automate receipt processing. Receive images via WhatsApp, extract store, total, and payment data using GPT-4o-mini, log data to Google Sheets, and send instant confirmation messages.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Small business owners needing automated expense tracking.
Individuals who want a simple, conversational way to log personal finances.
Developers looking for advanced examples of integrating multimodal AI with an n8n trigger.
Users aiming to build custom n8n templates for accounting and operations.

Overview

Managing expenses often involves cumbersome manual data entry from physical or digital receipts. This sophisticated n8n workflow transforms that process using powerful AI and chat automation. When a user sends a receipt image to a linked WhatsApp account, the automation instantly downloads the media, uploads it to Google Drive for secure storage, and critically, uses the GPT-4o-mini model in an n8n node to perform complex image analysis. It accurately extracts key financial fields like the store name, total amount, and payment method. The extracted data is logged seamlessly into a Google Sheet and a concise, user-friendly summary is immediately sent back to the user via WhatsApp. This specific n8n template drastically reduces manual effort and ensures prompt, accurate financial record-keeping.

How it Works

This powerful n8n workflow begins execution using the dedicated WhatsApp n8n trigger.


  1. Ingestion: The WhatsApp Trigger starts the automation whenever an image message (receipt) is received.

  2. Media Handling: The workflow immediately uses the WhatsApp Download media n8n node, followed by an HTTP Request node, to retrieve the actual image data.

  3. Storage: The image is uploaded to Google Drive using the Upload file n8n node, ensuring the receipt is permanently stored, and then the file is shared using Share file to make the link accessible.

  4. AI Preparation: The workflow then uses the Google Drive Download file n8n node again. This is done to prepare the file content for the next step: the multimodal AI analysis.

  5. Extraction (Core Logic): The Analyze image n8n node, leveraging GPT-4o-mini (an OpenAI integration), is supplied with the image data and a strict system prompt. The prompt mandates the extraction of five fields (store name, description, total, payment, and image URL) and requires the output to be strictly valid JSON.

  6. Data Cleaning: The custom Code n8n node cleans up the AI's raw text output (removing markdown wrappers like ```json```) and parses it into a clean JSON object ready for database entry.

  7. Logging: The Append row in sheet n8n node (Google Sheets) takes the structured data and the permanent Google Drive link (from step 3) and logs a new expense record in the specified spreadsheet.

  8. Confirmation & Summary: The AI Agent n8n node, using the OpenAI Chat Model, generates a friendly, summarized confirmation message based on the newly recorded data, including emojis and the receipt link.

  9. Delivery: Finally, the Send message WhatsApp n8n node delivers this clear, concise summary back to the user, completing the fully automated cycle initiated by the n8n trigger.

Installation Guide

To deploy this automated n8n workflow, follow these steps:


  1. Import: Copy the entire n8n workflow JSON provided and paste it into your n8n instance using the 'New' > 'Import from JSON' function.

  2. WhatsApp Setup: Configure the WhatsApp Trigger and the two WhatsApp credential nodes (Download media, Send message). This requires setting up a WhatsApp Business Platform account and obtaining the necessary API keys and phone number IDs.

  3. OpenAI Credentials: Set up the credentials for the Analyze image n8n node and the OpenAI Chat Model. This n8n workflow requires an OpenAI API key capable of accessing GPT-4o-mini for vision analysis.

  4. Google Service Credentials: Configure OAuth2 credentials for Google Drive and Google Sheets. The n8n nodes for Google Drive need permissions to upload, download, and share files. The Google Sheets n8n node needs access to append data to your target expense sheet.

  5. Google Sheets Configuration: Ensure your target Google Sheet exists and its column headers match the fields specified in the Append row in sheet node (store name, description, image_url, payment, total).

  6. Activation: Once all credentials and configurations are set, activate the n8n workflow by toggling it to 'Active'.

Node Details

WhatsApp Trigger: The starting point of the n8n workflow, configured to listen for new messages (specifically receipt images) from the linked WhatsApp account. It acts as the primary n8n trigger for expense logging.
Analyze image (OpenAI): The core AI processing n8n node. It uses the gpt-4o-mini model and a specific prompt to convert the visual data of the receipt image into structured JSON data. It uses base64 input derived from the preceding Google Drive download.
Google Drive (Upload file/Share file/Download file): A sequence of n8n nodes managing file lifecycle. It uploads the receipt image, sets public viewing permissions via webViewLink, and then re-downloads the file content, ensuring the data is correctly prepared for the OpenAI n8n node.
Code: An essential custom n8n node that acts as a post-processor, cleaning up the JSON string output by GPT-4o-mini (which often includes markdown wrapping) and parsing it into a native n8n item structure.
Append row in sheet (Google Sheets): The database interaction n8n node, responsible for persisting the extracted fields and the permanent receipt link into your expense spreadsheet.
AI Agent / OpenAI Chat Model: These n8n nodes collaborate to generate a friendly, human-readable summary message based on the structured data, ensuring users receive immediate, clear feedback on the expense logged.

Related n8n Workflows

Free

Nodes: 10 Nodes
Updated: December 26 2025
View all
Created by

Featured*