Use this comprehensive n8n workflow to automate invoice processing. Extract data from Telegram documents via OCR, structure it with Gemini AI, update Google Sheets, and archive the file in Google Drive.
Download this n8n workflow template and start using it instantly.
This powerful n8n workflow eliminates the manual effort involved in recording invoices. By setting up a Telegram n8n trigger, the process is instantaneous when a document is received. The solution intelligently manages documents, using an external OCR service to read the text content of the invoice image or PDF. Following this, the Google Gemini AI is employed through a dedicated n8n node to transform the raw text into highly structured, usable data points (invoice number, amount, due date). The resulting data is automatically logged into Google Sheets, while the original file is archived in Google Drive. This end-to-end n8n workflow significantly enhances financial data management and provides an immediate confirmation reply back to the user via Telegram.
The process is initiated by the Telegram Trigger, which is the foundational n8n trigger designed to activate upon receiving a document message.
To implement this n8n workflow, follow these steps:
Analyze Image1 (HTTP Request) n8n node, replace yourkeyhere in the header parameters with a valid API key from OCR.space.Google Gemini Chat Model n8n nodes.Update Database1 (Google Sheets) n8n node, replace the placeholder documentId with your actual Google Sheet ID and verify the sheetName (GID).Add Invoice Image to Drive1 (Google Drive) n8n node, replace the folderId with the ID of your target 'Invoices' folder.This advanced n8n workflow utilizes several key nodes:
Telegram Trigger (n8n trigger):
Function: Starts the n8n workflow when a user sends a document (file) to the configured Telegram Bot.
Key Configuration: Listens for message updates.
Analyze Image1 (HTTP Request n8n node):
Function: Sends the invoice file binary data to OCR.space for text extraction.
Key Configuration: URL: https://api.ocr.space/parse/image; Uses multipart-form-data and requires an apikey header.
AI Agent (n8n node):
Function: Uses the Google Gemini Chat Model2 and the Structured Output Parser to convert raw OCR text into a predictable JSON object with required invoice fields.
Key Configuration: Instructs the AI to map extracted text to fields like invoiceNumber, totalAmount, and to default the dueDate to the invoiceDate if the former is missing.
Update Database1 (Google Sheets n8n node):
Function: Appends the structured invoice data generated by the AI agent to the Google Sheet.
Key Configuration: Operation: append; Uses column mapping based on AI output (e.g., Date receives {{ $json.output.invoiceDate }}).
Add Invoice Image to Drive1 (Google Drive n8n node):
Function: Archives the original invoice file for storage.
Key Configuration: File name is dynamically set using the current timestamp (e.g., Invoice [MMMM-dd-yyyy]).
Invoice Agent1 (n8n node):
Function: Uses the Google Gemini Chat Model1 and a rich system prompt to formulate a friendly, informative response for the user, summarizing the key extracted data and providing the Drive link.
Reply1 (Telegram n8n node):
* Function: Sends the AI-generated confirmation summary back to the chat ID of the user who initiated the n8n workflow.
Use this powerful n8n workflow to automate invoice processing. Extract data from Slack PDF uploads using the GPT-4o n8n node and log structured results directly into Google Sheets.

Use this powerful n8n workflow to automatically monitor Google Drive for new PDFs, extract structured invoice data using Google Gemini, and log results directly into Google Sheets. Get started with n8n templates today.

Automate PDF invoice data extraction using an n8n workflow, Ollama LLM, and Google Sheets. This n8n templates solution provides instant email alerts upon successful data entry.

Automate legal document processing using this powerful n8n workflow. Extract key contract data (dates, parties) via VLM Run, save to Google Sheets, and schedule alerts in Slack and Google Calendar. Deploy this advanced n8n template today.

Automate scraping LinkedIn post metrics (reactions, comments, and audience data) using this powerful n8n workflow template. Extract structured data for lead generation.

Use this powerful n8n workflow to automatically capture LinkedIn profile screenshots via Google Forms, extract structured data using OpenAI Vision, and generate personalized follow-up messages for seamless CRM updates.








































