Automate Invoice Parsing with n8n & LlamaParse AI

This workflow automates parsing invoices and documents received via Gmail using n8n and LlamaParse AI, extracting detailed invoice data and summaries. It saves time and errors in manual data entry by delivering structured information to Google Sheets, Drive, and Telegram.
gmail
httpRequest
lmChatOpenAi
+11
Workflow Identifier: 1288
NODES in Use: Webhook, Gmail, Limit, Get Message, If, HTTP Request, Aggregate, Set, Merge, Google Drive, Google Sheets, Telegram, chainLlm, lmChatOpenAi

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

What this workflow does

This workflow helps to automatically handle invoices sent by email. It looks for new emails with attachments, downloads those attachments, and sends them to an AI service that reads and extracts invoice data. Then, it saves the original and processed files, updates a Google Sheet with invoice details, and sends a short invoice summary via Telegram. This removes hours of manual work, reduces mistakes, and speeds up invoice processing.

The main problem solved is the slow, error-prone task of manually opening emails, reading invoices, and copying data into systems. The outcome is a fast, automated system that manages invoices accurately and keeps records organized.


Who should use this workflow

This workflow fits any user who receives many invoices by email and wants to save time on data entry. It works well for accounting teams, small business managers, and finance professionals who want fewer errors and faster invoice management. No advanced technical skills are needed to use it once it is set up.


Tools and services used

  • Gmail: Checks email for new messages with attachments.
  • LlamaParse API: Uses AI to extract structured data and summaries from invoice documents.
  • Google Drive: Stores original invoice files and extracted text files.
  • Google Sheets: Updates spreadsheet rows with extracted invoice data.
  • Telegram Bot API: Sends quick invoice summaries to users or groups.
  • n8n Automation platform: Runs the whole workflow with nodes and triggers.

For self hosting n8n, consider a VPS or hosting provider with stable uptime and accessible webhook URLs, for example self-host n8n resources.


How this workflow works: Inputs → Processing → Outputs

Inputs

  • Incoming Gmail emails from specified senders containing invoice attachments.
  • Attachments in supported document formats (PDF, Word, images).

Processing Steps

  • Monitor Gmail inbox and filter emails by sender and attachment presence.
  • Limit to last 28 recent emails to avoid overload.
  • Download email attachments in binary form.
  • Check if email contains attachments; skip if none.
  • Call LlamaParse API to get list of supported file extensions.
  • Verify each attachment is supported; skip unsupported files.
  • Upload supported documents to LlamaParse using multipart form, including webhook URL for callback.
  • Listen on the Webhook node for parsed text returned from LlamaParse.
  • Classify document type using AI to confirm if it is an invoice.
  • If invoice, use LangChain AI to extract detailed invoice data in JSON format.
  • Save original attachments to Google Drive with unique filenames.
  • Save extracted markdown text as text files in Google Drive.
  • Update a Google Sheet row with invoice ID, amounts, payment info, and summary.
  • Send concise invoice summary message via Telegram to team or user.

Outputs


Beginner step-by-step: How to use this workflow in n8n

1. Import Workflow

  1. Download the workflow file from this page using the Download button.
  2. In your open n8n editor, click “Import from File” and select the downloaded workflow file.

2. Add Credentials and Settings

  1. Connect Gmail credential with OAuth access to monitor inbox and download attachments.
  2. Enter the LlamaParse API Key in the HTTP Request nodes configured to call the API.
  3. Link Google Drive account using OAuth to save documents.
  4. Connect Google Sheets with OAuth and specify the spreadsheet ID and sheet name where invoices will be logged.
  5. Set up Telegram Bot credentials to send messages to desired chat or user.
  6. Update email sender filters and Google Drive folder IDs if needed to match your environment.

3. Test and Activate

  1. Manually run the trigger once or send a sample invoice email to the monitored Gmail account to test the workflow.
  2. Check Google Drive and Google Sheets for correct file uploads and data entries.
  3. Verify Telegram messages are received.
  4. If all tests succeed, turn on the workflow toggle to activate it for production.

Once activated, the workflow will automatically process incoming invoices without any manual steps.


Handling Errors and Edge Cases

If errors occur such as “401 Unauthorized” from LlamaParse API, check API key validity and update credentials.

If webhook responses from LlamaParse do not arrive, confirm the webhook URL is correct, publicly reachable, and firewall rules allow inbound connections.

If Google Sheets fails to update, verify spreadsheet ID, sheet name, and OAuth permissions.

If emails have no attachments or unsupported formats, those emails are skipped to save resources.


Customization Ideas

  • Change LangChain prompts to adjust how invoice details or document summaries are extracted.
  • Expand Gmail sender filters to include multiple vendors.
  • Save files to different Google Drive folders based on department or client.
  • Add more categories in document classification node to handle other document types.
  • Adjust the email Limit node to control processing volume as per system capacity.

Summary of Benefits

✓ Automatically finds and downloads incoming invoices from Gmail.

✓ Uses AI to extract detailed invoice data without manual reading.

✓ Saves documents and data in Google Drive and Sheets for easy tracking.

✓ Sends quick summaries to Telegram for fast review.

✓ Cuts hours of manual work to minutes with fewer errors.

Frequently Asked Questions

Check Gmail trigger settings for correct sender filters and attachment conditions. Make sure the Gmail account has new emails arriving from those senders.
Yes, but only file types supported by LlamaParse API. The workflow checks supported extensions before processing.
Verify the Google Sheets document ID and sheet name match workflow settings. Also ensure OAuth credentials have edit permissions.
No. The workflow uses Gmail-specific nodes. Using other email providers requires node and automation changes.

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation Workflows in n8n

A complete beginner guide to building an AI SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free