🧾 Invoices from Gmail to Drive and Google Sheets

⚡ 38,008 views · 🧾 Invoice Processing

💡 Pro Tip — HTTP Request scraping tends to break when sites update their markup. If you’re scraping a major platform, check if ScraperNode covers it — it has maintained scrapers for LinkedIn, Instagram, TikTok, YouTube, and 20+ other platforms that return structured data.

View All Scrapers

Description

Attachments Gmail to Drive and Google Sheets

Description

Automatically process invoice emails by saving attachments to Google Drive and extracting key invoice data to Google Sheets using AI. This workflow monitors your Gmail for unread emails with attachments, saves PDFs to a specified Google Drive folder, and uses OpenAI’s GPT-4o to extract invoice details (date, description, amount) into a structured spreadsheet.

Use cases

Resources

Setup instructions

Prerequisites

  1. Active Gmail, Google Drive, and Google Sheets accounts
  2. OpenAI API key (GPT-4o model access)
  3. n8n instance with credentials manager

Steps

  1. Gmail and Google Drive Setup:

    • Connect your Gmail account in n8n credentials
    • Connect your Google Drive account with appropriate permissions
    • Create a destination folder in Google Drive for invoice storage
  2. Google Sheets Setup:

    • Connect your Google Sheets account
    • Create a spreadsheet with columns: Invoice date, Invoice Description, Total price, and Fichero
    • Copy your spreadsheet ID for configuration
  3. OpenAI Setup:

    • Add your OpenAI API key to n8n credentials
  4. Configure Email Filter:

    • Update the email filter node to match your specific sender requirements

Benefits

🔗 Nodes Used

Google Sheets, HTTP Request, Google Drive, Gmail, Gmail Trigger, Basic LLM Chain

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup