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
Automate invoice parsing with n8n and LlamaParse

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

Learn how to Build this Workflow with AI:

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.

Automate invoice parsing with n8n and LlamaParse

Visit through Desktop to Interact with the Workflow.

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.
Author
Written By
Ritu Sanjali

Related Workflows

Automate Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.