Skip to main content

Extract & process invoices with Gemini AI, Google Sheets & Gmail notifications

Workflow preview

Workflow preview
100%
Extract & process invoices with Gemini AI, Google Sheets & Gmail notifications preview
Open on n8n.io

Important notice

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

1. Workflow Overview

AI Powered Invoice Extraction & Automation System Workflow Aim The aim of the Invoice Data Automation workflow is to streamline invoice processing by extracting, validating, and storing invoice det...

Best for

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

Tools used

@n8n/n8n-nodes-langchain.chattrigger, @n8n/n8n-nodes-langchain.googlegemini, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatgooglegemini, n8n-nodes-base.googlesheets, n8n-nodes-base.set, n8n-nodes-base.if, 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 Yashraj singh sisodiya.

Original n8n.io source

1.1 Workflow description

Title
Extract & process invoices with Gemini AI, Google Sheets & Gmail notifications
Workflow name
Extract & process invoices with Gemini AI, Google Sheets & Gmail notifications

AI-Powered Invoice Extraction & Automation System Workflow

Aim

The aim of the Invoice Data Automation workflow is to streamline invoice processing by extracting, validating, and storing invoice details automatically. It uses AI to read invoices (from images/PDFs), structures the data in JSON, checks for missing or duplicate entries, and records the information in a Google Sheet while also uploading the original invoice to Google Drive. Additionally, it sends email notifications for successful entries, duplicates, or missing fields.

Goal

The goal is to:

  • Allow users to upload invoice images/files via chat.
  • Extract invoice data using AI and format it into a structured JSON.
  • Validate mandatory fields like invoice_id, shop_name, date, Total, and items.
  • Check if the invoice already exists in the Google Sheet.
  • Append new invoices to Google Sheets and upload the original file to Google Drive.
  • Notify the user via email about success, duplicates, or errors.

This ensures that invoices are processed accurately, efficiently, and securely with minimal manual effort.

Requirements

The workflow relies on specific components and configurations:

n8n Platform

The automation is built and hosted on n8n, which orchestrates the entire workflow.

Node Requirements

  1. When chat message received – Triggers the workflow when a user submits an invoice.
  2. Analyze image1 – Uses Google Gemini Vision AI to extract invoice data from the uploaded file.
  3. AI Agent1 + Google Gemini Chat Model1 – Restructures the extracted data into strict JSON format.
  4. Make data in JSON structure format – Prepares and organizes the structured output.
  5. Get data – Looks up the Google Sheet to check if the invoice already exists.
  6. check if Data exist or not in table – Decides whether to process as new data or duplicate.
  7. New data add using payload / Check Mandatory fields – Ensures invoice JSON is valid and complete.
  8. If – check missing field – Branches based on whether mandatory fields are present.
  9. no missing field – new data add using payload 2 – Passes only verified invoices forward.
  10. Append data to sheet – Saves invoice data in Google Sheets.
  11. Upload invoice to drive – Uploads the original invoice file to Google Drive.
  12. Send successful email – Notifies the user of successful entry.
  13. Duplicate entry send mail – Alerts the user if the invoice already exists.
  14. Send missing field error on mail – Sends an error email if mandatory fields are missing.

Credentials

  • Google Gemini (PaLM) API – For AI-based invoice data extraction and formatting.
  • Google Sheets API – For storing structured invoice records.
  • Google Drive API – For uploading original invoices.
  • Gmail API – For sending success, duplicate, and error notifications.

Input Requirements

  • Invoice file (Image or PDF).

Output

  • Structured invoice data in Google Sheets.
  • Original invoice stored in Google Drive.
  • Notifications sent via Gmail (success, duplicate, or error).

API Usage

  • Google Gemini (PaLM API): Used in Analyze image1 and AI Agent1 to extract and structure invoice data. It ensures fields like invoice_id, shop_name, date, and items are clearly formatted.

  • Google Sheets API: Used in Get data and Append data to sheet nodes to validate duplicates and store new invoices.

  • Google Drive API: Used in Upload invoice to drive to securely store the original uploaded invoice file.

  • Gmail API: Used in Send successful email, Duplicate entry send mail, Send missing field error on mail to notify users about the status of invoice processing.

Workflow Summary

The Invoice Data Automation workflow automates the entire process of invoice handling by:

  1. Receiving invoice uploads via chat.
  2. Extracting invoice details with AI (Google Gemini).
  3. Structuring and validating the data in JSON format.
  4. Checking Google Sheets for duplicates.
  5. Appending new invoices to the sheet and uploading originals to Google Drive.
  6. Sending email notifications to keep the user updated on the process outcome.

This end-to-end automation ensures invoices are handled with speed, accuracy, and transparency, reducing manual work and eliminating common errors in invoice management.

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 - When chat message received

Type / Role
@n8n/n8n-nodes-langchain.chatTrigger - chatTrigger
Config choices
Version 1.3

Block 2 - Analyze image1

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

Block 3 - AI Agent1

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2.2

Block 4 - Google Gemini Chat Model1

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

Block 5 - Get data

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

Block 6 - Make data in json structure format

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 7 - check if Data exist or not in table

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 8 - Upload invoice to drive

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

Block 9 - Sticky Note

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

Block 10 - no missing field - new data add using payload 2

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 11 - If - check missing field

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 12 - Send missing field error on mail

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

Block 13 - Duplicate entry send mail

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

Block 14 - New data add using payload

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 15 - Append data to sheet

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

Block 16 - Check Mandatory fields

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 17 - Send successful email

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

Block 18 - Sticky Note2

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

Block 19 - Sticky Note1

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

Block 20 - Sticky Note3

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

Block 21 - Sticky Note4

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

Block 22 - Sticky Note5

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

Block 23 - Sticky Note6

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

Block 24 - Sticky Note7

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

Showing the first 24 of 32 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Extract & process invoices with Gemini AI, Google Sheets & Gmail notifications
Complexity advanced
Nodes 32
Categories Invoice Processing, AI Summarization
Author Yashraj singh sisodiya
Published 13 Sept 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/8548/8548.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 & process invoices with Gemini AI, Google Sheets & Gmail notifications do?

AI Powered Invoice Extraction & Automation System Workflow Aim The aim of the Invoice Data Automation workflow is to streamline invoice processing by extracting, validating, and storing invoice det...

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.