Automated PDF Invoice Data Extraction and Tracking - n8n Workflow

Use this powerful n8n workflow to automate invoice processing. Extract structured data from PDF files in Google Drive, log details to Google Sheets, and send instant alerts via Telegram using Claude AI.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Accounting and Finance Teams needing real-time invoice tracking.

  • Business owners looking to automate bookkeeping and data entry.

  • Users searching for efficient n8n templates for document processing.

  • Developers needing a robust example of AI-powered document extraction within an n8n node flow.

Overview

Managing incoming invoices manually is time-consuming and prone to errors. This specialized n8n workflow solves this by creating a fully automated pipeline for invoice ingestion and tracking. It leverages the power of n8n to connect file storage (Google Drive) with structured data logging (Google Sheets) and intelligent AI processing (Anthropic/Claude).

When a PDF invoice is dropped into a monitored Google Drive folder, the n8n trigger instantly starts the automation. The file content is extracted, and an advanced AI model (LangChain Information Extractor) pulls critical details like invoice number, client name, and due date. Finally, this data is logged to a sheet and a real-time notification is sent via Telegram. This setup is a prime example of leveraging an n8n node structure to create significant operational efficiency.

How it Works

The entire process is initiated by an n8n trigger set up on Google Drive.


  1. File Upload Trigger: The Google Drive Trigger monitors a specified folder for newly created PDF files, serving as the starting point for the n8n workflow.

  2. File Retrieval: The Google Drive n8n node downloads the file identified by the trigger.

  3. PDF Parsing: The 'Extract from File' n8n node specifically parses the PDF document to convert its content into raw, searchable text.

  4. AI Data Extraction: The 'Information Extractor' n8n node (utilizing a LangChain component) takes the raw text and applies a schema to extract precise fields, such as 'Invoice Number', 'Client Name', 'Total Amount', and 'Due Date'. This critical step structures the unstructured data.

  5. Data Logging: The extracted, structured data is immediately appended as a new row in a designated Google Sheets document (the 'Invoice DB').

  6. Notification Formatting: An 'Anthropic Agent' (using the Claude 4 Sonnet AI model) receives the structured invoice details and uses a predefined prompt to generate a concise, professional notification message optimized for Telegram.

  7. Team Alert: The final 'Telegram' n8n node sends the AI-formatted message to the billing team's chat, completing the notification process. This robust n8n workflow ensures immediate actionability.

Installation Guide

To deploy this powerful n8n workflow, follow these setup steps:


  1. Import the n8n Templates: Copy the provided JSON code and import it directly into your n8n instance using the 'New' -> 'Import from JSON' option.

  2. Google Drive Setup: Configure the 'Google Drive Trigger' n8n node. You will need to authenticate your Google Drive credentials (OAuth2) and specify the exact Folder ID where new invoices will be uploaded.

  3. Google Sheets Setup: Configure the 'Google Sheets' n8n node. Connect your Google Sheets credentials and link the node to the specific spreadsheet and worksheet where you want the invoice data logged.

  4. AI Credentials (Anthropic/Claude): Ensure you have active credentials set up for Anthropic (or OpenAI, if you modify the extraction node connection) to power the data extraction and message formatting steps.

  5. Telegram Configuration: Set up the 'Telegram' n8n node. You must provide the correct Bot Token credentials and the target Chat ID where the alerts should be sent.

  6. Activation: Save the n8n workflow and toggle the workflow 'Active' status on. The Google Drive n8n trigger will begin monitoring the folder.

Node Details


  • Google Drive Trigger: The specialized n8n trigger that starts the automation. Key configuration: Set to 'fileCreated' event, watching a 'specificFolder' identified by its ID.

  • Google Drive (Download): Downloads the binary file identified by the trigger. Key configuration: Uses the file ID ={{ $json.id }} from the trigger output.

  • Extract from File: An essential n8n node for document parsing. Key configuration: Operation set to pdf to handle invoice documents, converting them to text for AI analysis.

  • Information Extractor (LangChain): The core AI processing n8n node. Function: Pulls structured data based on a defined list of required attributes (e.g., Invoice Number, Client Name, Total Amount) from the raw text.

  • Google Sheets: The data logging n8n node. Function: Appends extracted invoice data to a Google Sheet. Key configuration: Input columns are dynamically mapped from the AI extraction output.

  • Anthropic Agent (LangChain): An AI-powered n8n node for generating custom output. Function: Acts as a notification expert to format the collected invoice data into a concise message summary for immediate dispatch.

  • Telegram: The final action n8n node. Function: Sends the AI-generated notification message to a specific Telegram chat ID, completing the business process notification within this n8n workflow.

Related n8n Workflows

Free

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

Automating Start-Up and Business processes. Helping non-techies understand and leverage Agentic AI with easy to understand step-by-step tutorials. Check out my educational content: https://www.youtube.com/@Automatewithmarc

Featured*