Skip to main content

Extract invoice data from PDFs with AI - Google Sheets Email alerts

Workflow preview

Workflow preview
100%
Extract invoice data from PDFs with AI - Google Sheets  Email alerts preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Built by Setidure Technologies This smart n8n automation extracts invoice details from PDF files uploaded to Google Drive using AI, logs them to a Google Sheet, and notifies the billing team via em...

Best for

  • Invoice Processing automation workflows
  • AI Summarization automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

@n8n/n8n-nodes-langchain.informationextractor, n8n-nodes-base.gmail, n8n-nodes-base.noop, @n8n/n8n-nodes-langchain.lmollama, @n8n/n8n-nodes-langchain.vectorstorepgvector, n8n-nodes-base.stickynote, n8n-nodes-base.googledrivetrigger, n8n-nodes-base.googledrive

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Aashit Sharma.

Original n8n.io source

1.1 Workflow description

Title
Extract invoice data from PDFs with AI - Google Sheets Email alerts
Workflow name
Extract invoice data from PDFs with AI - Google Sheets Email alerts

Built by Setidure Technologies This smart n8n automation extracts invoice details from PDF files uploaded to Google Drive using AI, logs them to a Google Sheet, and notifies the billing team via email — all without manual intervention.

⚠️ Note: This workflow requires a self-hosted n8n instance with LangChain, LLM, and Google integrations configured.

📦 What This Workflow Does Monitors a Google Drive folder for new invoice uploads

Extracts text and parses key invoice details using LLM via LangChain

Logs extracted data into a Google Sheet (Invoice Database)

Generates a summary email using GPT-4O-MINI (Greenie)

Sends the email to the billing team via Gmail

✅ Prerequisites A Google Drive folder to monitor for PDF uploads

A Google Sheet named Invoice Database with the following columns:

Invoice Number, Client Name, Client Email, Client Address, Client Phone, Invoice Date, Due Date, Total Amount

Service account or OAuth credentials for:

Google Drive

Google Sheets

Gmail

LangChain + Ollama integration for LLM responses

🔧 Step-by-Step Setup Instructions Clone this workflow into your self-hosted n8n instance

Set up credentials:

Google Drive (for folder trigger)

Google Sheets (for data logging)

Gmail (for sending email)

Ollama (local LLM) or any connected LangChain provider

Configure the trigger node to watch your specific Invoice Uploads folder

Update the Google Sheet node with your Invoice Database sheet URL and column mapping

Test with a sample invoice to validate the AI extraction and email generation

🔄 Workflow Steps

Step 1: Trigger on New File in Google Drive

Node Name: Watch for New Invoices Type: Google Drive Trigger

Event: fileCreated

Triggers when a new PDF file is uploaded to a designated folder

Step 2: Download the Uploaded File

Node Name: Download Invoice PDF Type: Download Binary

Downloads the invoice file from Google Drive

Step 3: Extract Raw Text from PDF

Node Name: Extract PDF Text Type: Extract from File

Extracts unstructured text content from the downloaded PDF

Step 4: Parse Invoice Fields Using AI

Node Name: Parse Invoice Data with LLM Type: LangChain Agent

LLM is prompted to extract:

Invoice Number

Client Name, Email, Address, Phone

Invoice Date, Due Date, Total Amount

Fields not found are skipped

Step 5: Log Extracted Data to Google Sheet

Node Name: Log to Invoice Database Type: Google Sheets

Appends a new row with the extracted fields to the Invoice Database spreadsheet

Step 6: Create Email Notification via LLM

Node Name: Generate Billing Email Summary Type: LangChain Agent (GPT-4O-MINI)

Prompt instructs AI to:

Act as “Greenie” from Green Grass Corp

Inform billing that a new invoice was processed

Confirm logging into the Invoice Database

Step 7: Send the Email to Billing Team

Node Name: Email Billing Team Type: Gmail Send

To: [email protected]

Subject and body injected from LLM output

Step 8: End Workflow Gracefully

Node Name: End Type: No Operation

Used to cleanly terminate the flow

🧠 Example Output (Email)

Subject: New Invoice Logged – Client: ABC Corp

Hi Billing Team,

A new invoice has been received and processed automatically. The following details have been extracted and logged into the Invoice Database:

  • Invoice Number: INV-1024
  • Client: ABC Corp
  • Amount: $1,450
  • Due Date: July 15, 2025

Please review the Invoice Database for full details.

Regards,
Greenie
Green Grass Corp

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Information Extractor

Type / Role
@n8n/n8n-nodes-langchain.informationExtractor - informationExtractor
Config choices
Version 1

Block 2 - Send Email

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Block 3 - No Operation, do nothing

Type / Role
n8n-nodes-base.noOp - noOp
Config choices
Version 1

Block 4 - Ollama Model

Type / Role
@n8n/n8n-nodes-langchain.lmOllama - lmOllama
Config choices
Version 1

Block 5 - Postgres PGVector Store

Type / Role
@n8n/n8n-nodes-langchain.vectorStorePGVector - vectorStorePGVector
Config choices
Version 1.2

Block 6 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 7 - Google Drive Trigger - file creation

Type / Role
n8n-nodes-base.googleDriveTrigger - googleDriveTrigger
Config choices
Version 1

Block 8 - Download Binary - file

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 9 - Extract from PDF

Type / Role
n8n-nodes-base.extractFromFile - extractFromFile
Config choices
Version 1

Block 10 - Create Email Agent

Type / Role
@n8n/n8n-nodes-langchain.openAi - openAi
Config choices
Version 1.8

Block 11 - Update DB - spreadsheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.5

3. Summary Table

Workflow Extract invoice data from PDFs with AI - Google Sheets Email alerts
Complexity intermediate
Nodes 11
Categories Invoice Processing, AI Summarization
Author Aashit Sharma
Published 07 Jun 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/4763/4763.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Extract invoice data from PDFs with AI - Google Sheets Email alerts do?

Built by Setidure Technologies This smart n8n automation extracts invoice details from PDF files uploaded to Google Drive using AI, logs them to a Google Sheet, and notifies the billing team via em...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Invoice Processing, AI Summarization use case.