🔓 Unlock all 10,000+ workflows & prompts free Join Newsletter →
✅ Full access unlocked — explore all 10,000 AI workflow and prompt templates Browse Templates →
Home n8n Workflow
January 22, 2026

Google Drive to Google Sheets, clean invoice line items

Lisa Granqvist Partner Workflow Automation Expert

Invoice PDFs are the worst kind of “simple.” The info is right there, but getting it into a spreadsheet still means squinting, copying, pasting, and fixing weird formatting.

This invoice line automation hits ops teams first, but accountants and small business owners feel it too. When every invoice has 10 or 30 line items, manual entry quietly steals hours each week.

This workflow watches a Google Drive folder, extracts every invoice line item with Dumpling AI, and appends clean rows into Google Sheets. You’ll see how it works, what you need, and what to tweak so it matches your invoice format.

How This Automation Works

The full n8n workflow, from trigger to final output:

n8n Workflow Template: Google Drive to Google Sheets, clean invoice line items

The Problem: Invoice PDFs Don’t Turn Into Usable Data

PDF invoices were designed to be read, not processed. So when you need each line item in a spreadsheet (model, description, quantity, unit price, total price), you end up doing clerical work that feels invisible but never ends. One invoice turns into a dozen copy/paste actions. Then you’re cleaning commas, fixing broken columns, and realizing the “Unity price” column is full of text because one row had a currency symbol. Multiply that by a busy week, and it’s not just time. It’s attention, accuracy, and momentum.

It adds up fast. Here’s where it breaks down in real teams.

  • Someone mistypes a unit price or quantity, and you only catch it when totals don’t match later.
  • Line items end up inconsistent, which means filtering and sorting becomes unreliable.
  • Invoices pile up because “I’ll do them later” turns into an hour-long task.
  • Even if you delegate the work, you still spend time checking it.

The Solution: Auto-Extract Invoice Line Items Into Google Sheets

This workflow removes the manual step entirely. When a new invoice PDF lands in a specific Google Drive folder, n8n picks it up automatically and downloads the file. It then converts the file into a Base64 payload (basically a format that can be sent cleanly to an API) and submits it to Dumpling AI’s extract-document endpoint with a detailed prompt that tells the AI exactly what fields to pull. Dumpling AI responds with structured JSON data, which n8n parses and splits into individual line items. Finally, it appends one clean row per line item into your Google Sheet, along with the invoice header details like order number, PO number, and ship-to / sold-to info.

The workflow starts in Google Drive, then runs the invoice through Dumpling AI for extraction. After that, Google Sheets becomes your “system of record,” with every line item ready to filter, pivot, and audit without retyping anything.

What You Get: Automation vs. Results

Example: What This Looks Like

Say you process 25 invoices a week, and each one has about 15 line items. Manually, you might spend around 2 minutes per line item once you include copying, fixing columns, and sanity-checking totals, which comes out to roughly 12 hours a week. With this workflow, you drop invoices into one Google Drive folder and wait for the sheet to populate, usually in a minute or two per invoice. You still review the sheet, but you’re reviewing, not typing.

What You’ll Need

  • n8n instance (try n8n Cloud free)
  • Self-hosting option if you prefer (Hostinger works well)
  • Google Drive to store and detect new invoice PDFs.
  • Google Sheets to store clean invoice line item rows.
  • Dumpling AI API key (get it from your Dumpling AI account settings).

Skill level: Beginner. You’ll connect accounts, paste IDs (folder, sheet), and adjust a prompt if your invoices are unusual.

Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).

How It Works

A Google Drive folder triggers the run. When a new invoice file appears in the chosen folder, n8n grabs the file immediately so you don’t have to forward emails or click buttons.

The invoice is prepared for extraction. The workflow downloads the PDF and encodes it into Base64 so it can be sent reliably in an API request.

Dumpling AI turns the PDF into structured data. n8n sends the file to the extract-document endpoint with a prompt that asks for headers (order number, PO number, addresses) and the full items table (model, description, quantity, unit price, total price).

Google Sheets gets one row per line item. The response is parsed, the items array is expanded, and each item is appended to your sheet alongside the header fields so every row stays tied to its invoice.

You can easily modify the columns captured in the prompt to match your sheet layout based on your needs. See the full implementation guide below for customization options.

Step-by-Step Implementation Guide

Step 1: Configure the Drive Folder Watch Trigger

This workflow starts when a new file is created in a specific Google Drive folder.

  1. Add and open Drive Folder Watch Trigger.
  2. Set Event to fileCreated and Trigger On to specificFolder.
  3. In Folder to Watch, select the folder named Invoice Folder.
  4. Credential Required: Connect your googleDriveOAuth2Api credentials.

Tip: Ensure the folder contains only invoice files to avoid unnecessary processing.

Step 2: Connect Google Drive and Download the Invoice

The workflow downloads the newly created invoice file and prepares it for AI extraction.

  1. Open Fetch Invoice File and set Operation to download.
  2. Set File ID to {{ $json.id }}.
  3. Credential Required: Connect your googleDriveOAuth2Api credentials.
  4. Open Encode File to Base64 and set Operation to binaryToPropery.

⚠️ Common Pitfall: If File ID is not mapped to {{ $json.id }}, the download will fail and the workflow won’t progress.

Step 3: Set Up the AI Extraction and Parsing

This stage sends the file to Dumpling AI, parses the JSON response, and splits line items.

  1. Open AI Extraction Request and set Method to POST.
  2. Set URL to https://app.dumplingai.com/api/v1/extract-document.
  3. Set JSON Body to {
    "inputMethod": "base64",
    "files": ["{{ $json.data }}"],
    "prompt": "Extract the order number, document date, PO number, sold to name and address, ship to name and address, list of items with model, quantity, unit price, and total price, and the final total amount including tax.",
    "jsonMode": "true"
    }
    .
  4. Credential Required: Connect your httpHeaderAuth credentials.
  5. Open Parse AI JSON Output and keep the code as-is: const raw = $input.first().json.results; const parsed = JSON.parse(raw); return [{ json: parsed }];.
  6. Open Expand Invoice Line Items and set Field to Split Out to items.

Tip: If the AI output is not valid JSON, Parse AI JSON Output will fail. Confirm the provider returns raw JSON in results.

Step 4: Configure the Google Sheets Output

Each line item is appended as a new row in your Google Sheet along with header fields.

  1. Open Append Rows to Sheet and set Operation to append.
  2. Select Document as Invoice Sheet and Sheet as Sheet1.
  3. Map columns using these expressions: Model{{ $json.model }}, Quantity{{ $json.quantity }}, Po_number{{ $('Parse AI JSON Output').item.json.PO_number }}, Description{{ $json.description }}, Total price{{ $json.total_price }}, Unity price{{ $json.unit_price }}, Order number{{ $('Parse AI JSON Output').item.json.order_number }}, Ship to name{{ $('Parse AI JSON Output').item.json.ship_to_name }}, Sold to name{{ $('Parse AI JSON Output').item.json.sold_to_name }}, Document Date{{ $('Parse AI JSON Output').item.json.document_date }}, Ship to address{{ $('Parse AI JSON Output').item.json.ship_to_address }}, Sold to address{{ $('Parse AI JSON Output').item.json.sold_to_address }}.
  4. Credential Required: Connect your googleSheetsOAuth2Api credentials.

⚠️ Common Pitfall: Column names in Append Rows to Sheet must exactly match your Google Sheet headers (including capitalization and spacing).

Step 5: Test and Activate Your Workflow

Validate the end-to-end run and enable the trigger for production use.

  1. Click Execute Workflow and upload a test invoice to the watched folder.
  2. Confirm AI Extraction Request returns a JSON payload and Parse AI JSON Output emits structured fields.
  3. Verify new rows appear in Invoice SheetSheet1 with line item data.
  4. Toggle the workflow to Active to start monitoring the folder continuously.
🔒

Unlock Full Step-by-Step Guide

Get the complete implementation guide + downloadable template

Common Gotchas

  • Google Drive credentials can expire or need specific permissions. If things break, check the n8n credential connection status and the folder sharing/access first.
  • If you’re using Wait nodes or external rendering, processing times vary. Bump up the wait duration if downstream nodes fail on empty responses.
  • Dumpling AI API keys can get rotated, and a missing or wrong key will look like a “random” HTTP error. Check the HTTP Request node headers and Dumpling AI account settings before changing anything else.

Frequently Asked Questions

How long does it take to set up this invoice line automation automation?

About 30 minutes if your Google accounts are already connected.

Do I need coding skills to automate invoice line automation?

No. You’ll mainly paste IDs and connect accounts in n8n. The workflow already includes the parsing logic, so you’re configuring, not programming.

Is n8n free to use for this invoice line automation workflow?

Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in Dumpling AI API usage costs, which depend on how many invoices you process.

Where can I host n8n to run this automation?

Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.

Can I customize this invoice line automation workflow for different invoice formats?

Yes, and you’ll want to. You can modify the prompt inside the Dumpling AI HTTP Request node to capture extra fields like tax, shipping, discounts, or invoice number naming differences. Common customizations include renaming sheet columns, adding a “Vendor” column, and filtering by file name or subfolder when you have multiple invoice templates.

Why is my Google Drive connection failing in this workflow?

Usually it’s expired or unauthorized Google credentials in n8n. Reconnect Google Drive in your n8n credentials, then confirm the watched folder ID is correct and that the account has access to that folder. If the trigger fires but the download fails, the file may not be a supported type or it was moved right after upload. Less common, but real: Google API rate limits when you dump a big backlog into the folder at once.

How many invoices can this invoice line automation automation handle?

Practically, hundreds a day for most small teams. On n8n Cloud, the limit depends on your monthly execution allowance, while self-hosting has no fixed execution cap (it’s mainly your server size). The workflow processes one invoice at a time and then one row per line item, so a “huge” invoice with 200 lines will create a lot more spreadsheet writes than a small one.

Is this invoice line automation automation better than using Zapier or Make?

Often, yes, if you care about reliable parsing and line-item expansion. n8n makes it easier to handle arrays (line items), add conditional logic, and self-host for high volume without getting punished per step. Zapier and Make can work, but multi-row invoice writes get messy quickly, and the cost can climb once you’re doing AI extraction plus row-by-row inserts. If you just need a basic “log the invoice” flow, those tools might be fine. Talk to an automation expert if you want help choosing.

Once this is running, invoices stop being a weekly data-entry chore. The sheet stays clean, your line items stay usable, and you get your time back for work that actually moves the business.

Need Help Setting This Up?

Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.

Lisa Granqvist

Workflow Automation Expert

Expert in workflow automation and no-code tools.

×

Use template

Get instant access to this n8n workflow Json file

💬
Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Launch login modal Launch register modal