n8nflow.net logo

Process Receipt Images with GPT-4o-mini, WhatsApp & Google Sheets Automation

by Atharvaβ€’Updated: Last update 3 hours agoβ€’Source: n8n.io
Loading workflow viewer...

Getting Started

🧾An intelligent automation system that turns WhatsApp into your personal receipt manager β€” integrating Meta WhatsApp Cloud API , Google Drive , Google Sheets , and OpenAI GPT-4o-mini via n8n.

πŸŽ₯ Demo: Watch the Loom walkthrough


βš™οΈ What It Does

The AI-Powered WhatsApp Receipt Bot automates the complete invoice handling process through a conversational interface.

Workflow Summary:

  1. User sends a receipt image via WhatsApp.

  2. The bot automatically downloads the media using the WhatsApp Cloud API.

  3. The image is uploaded to a Google Drive β€œInvoices” folder.

  4. The file is shared publicly, generating a shareable URL.

  5. The receipt is analyzed using OpenAI GPT-4o-mini to extract structured data:

    • Store name
    • Items purchased
    • Payment method
    • Total amount
  6. The extracted details are appended to a Google Sheet for record-keeping.

  7. The bot sends a human-readable summary back to WhatsApp with emojis and the invoice link.

Output Example:

🏬 Store: Big Bazaar  
πŸ“ Items: Rice, Detergent, Snacks  
πŸ’³ Payment: Card  
πŸ’° Total: β‚Ή1520.75  
πŸ”— Link: https://drive.google.com/file/d/1abcXYZ/view  

This system eliminates manual expense tracking, improves accuracy through OCR, and provides a seamless way to manage receipts in real time.


πŸ’‘ Use Cases

ScenarioDescription
Personal Expense ManagementAutomatically store and categorize receipts from daily purchases.
Business AccountingCollect employee expense receipts through WhatsApp and centralize them in Google Sheets.
Freelancer or Consultant TrackingKeep a digital record of client reimbursements or software purchase receipts.
Family BudgetingFamily members send receipts to one shared WhatsApp number, all data gets logged centrally.
E-commerce / Delivery TeamsDrivers or delivery agents send invoices from the field to WhatsApp; data automatically goes to the accounting sheet.

πŸ”§ Setup

1. Accounts and Tools Needed

ToolPurposeLink
Meta Developer AccountTo access WhatsApp Business Cloud APIhttps://developers.facebook.com/apps
Google Cloud AccountFor enabling Drive and Sheets APIshttps://console.cloud.google.com
n8n InstanceWorkflow automation engine (local or cloud)https://app.n8n.cloud
OpenAI API KeyFor GPT-4o-mini model OCR + reasoninghttps://platform.openai.com/account/api-keys

2. Meta Developer Setup (WhatsApp Cloud API)

  1. Go to Meta Developer Dashboard β†’ My Apps β†’ Create App β†’ Business type.

  2. Add WhatsApp product under your app.

  3. Retrieve the following from WhatsApp > Configuration:

    • Permanent Access Token
    • Phone Number ID
    • WhatsApp Business Account ID
  4. Add these credentials in n8n β†’ Credentials β†’ WhatsApp API.

    • Use the same credentials for WhatsApp Trigger and Send Message nodes.
  5. Verify webhook in Meta with your n8n webhook URL.

Important:
In your HTTP Node , set the header as:

Authorization: Bearer <access_token>

Replace <access_token> with your WhatsApp Cloud API permanent token.
Without this, the workflow will fail to send or receive WhatsApp messages properly.


3. Google Drive Setup

  1. Create a folder named Invoices on your Google Drive.

  2. Copy the Folder ID (found in the Drive URL).

  3. In Google Cloud Console β†’ APIs & Services β†’ Enable APIs:

    • Enable Google Drive API
    • Enable Google Sheets API
  4. Go to Credentials β†’ Create Credentials β†’ OAuth 2.0 Client ID.

  5. Download the credentials.json file.

  6. Upload this to n8n β†’ Credentials β†’ Google Drive OAuth2 API.

  7. Authorize the connection on first workflow run.


4. Google Sheets Setup

  1. Create a new Google Sheet titled Invoices.
  2. Add the following headers in Row 1 :
store name | discription | image_url | payment | total
  1. Copy the Sheet ID (from the URL).
  2. Add the ID under the Google Sheets Append node in n8n.
  3. Map each field to its corresponding value extracted from the OCR result.

5. OpenAI Setup

  1. Generate an API key from https://platform.openai.com/account/api-keys.

  2. Add it to n8n β†’ Credentials β†’ OpenAI API.

  3. Use model gpt-4o-mini in the β€œAnalyze Image” node.

    • Can upgrade to gpt-4o for better OCR accuracy if account supports it.

6. n8n Workflow Setup

  1. Import the provided n8n workflow JSON.

  2. Configure credentials for:

    • WhatsApp API
    • Google Drive OAuth2
    • Google Sheets OAuth2
    • OpenAI API
  3. Activate workflow and set webhook in Meta Developer console.

  4. Send a test receipt image to your WhatsApp Business number.

The bot will automatically:
Download β†’ Upload β†’ Extract β†’ Log β†’ Summarize β†’ Reply


πŸ“Š Example Google Sheet Record

store namediscriptionimage_urlpaymenttotal
Big BazaarRice, Detergent, Snackshttps://drive.google.com/file/d/1abcXYZ/viewCard1520.75

🧠 Result

A fully automated AI pipeline that transforms WhatsApp into a smart expense-tracking interface β€” integrating vision, automation, and natural language processing for zero-manual financial documentation.


Support & Contact:
If you face any issues during setup or execution, contact:
πŸ“§ Email: [email protected]
πŸ”— LinkedIn: Atharva Jaiswal