Automate Invoice Parsing with n8n and Google Drive Trigger

Struggling with manual invoice data entry? This n8n workflow automates extracting line items from invoices uploaded to Google Drive using AI parsing and webhook integration. Save hours and cut errors in invoice processing.
Google Drive Trigger
HTTP Request
Webhook
+1
Workflow Identifier: 2245
NODES in Use: Google Drive Trigger, HTTP Request, Webhook, Code

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

Learn how to Build this Workflow with AI:

What this workflow does

This n8n workflow saves time by automatically reading invoice line items from files added to Google Drive.
It stops the need to type data by hand and reduces errors.
Invoices dropped in a specific Drive folder are sent to an AI parser that extracts details like product names, quantities, and prices.
The data is then saved into a database or Airtable for easy tracking.
You get faster and more accurate invoice processing without manual work.


Who should use this workflow

This is for people who handle many invoices in PDF form.
If invoice info is copied by hand from PDF files in Google Drive, this helps cut that manual task.
It suits accountants, bookkeepers, or firms that want quicker invoice data processing.
Users must have basic n8n setup and API keys ready.


Tools and services used

  • Google Drive Trigger: Detects new invoice files in a chosen folder.
  • HTTP Request node: Sends invoice PDF to AI (LlamaParse/OpenAI) for parsing.
  • Webhook node: Receives structured invoice data back from the parser.
  • Code node: Extracts individual line items from the AI response.
  • Airtable or Database nodes: Save invoice and item details as records.

Inputs, processing steps, and outputs

Inputs

  • New invoice PDF uploaded to a set Google Drive folder.
  • OpenAI API key with permission to parse files.
  • Webhook URL for receiving parse results.

Processing Steps

  • Google Drive Trigger fires when invoice arrives.
  • HTTP Request node posts file to OpenAI chat completions API in multipart form data.
  • Webhook node gets JSON response containing parsed invoice line items.
  • Code node runs JavaScript to extract and format individual items from AI response.
  • Database or Airtable nodes then create invoice and line item records linked together.

Outputs

  • Fully parsed invoice stored in your chosen database.
  • Separate database records for each invoice line item (description, quantity, unit price, amount).
  • Reduction in manual effort and human error.

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

Import the workflow

Download the workflow file from this page.
Inside n8n editor, choose Import from File and select the downloaded workflow.

Configure credentials and variables

Add Google Drive credentials with access to your invoice folder.
Add OpenAI API Key in the HTTP Request node credentials.
Set correct Drive folder ID if needed.
Update the webhook URL in LlamaParse service to match the Webhook node URL.
Change Airtable or database table identifiers to your setup.

Test and activate

Run the workflow manually or upload a test file to your Google Drive invoice folder.
Look out for any errors in logs.
Once testing works, turn on workflow activation.
This makes workflow run automatically for every new invoice.
Consider self-host n8n if using own server.


Code snippet for parsing AI response

This JavaScript in the Code node reads the invoice items from the webhook JSON.

// Get the input from the Webhook node
const input = $("Webhook").first().json;

// Prepare an array for items
const outputItems = [];

// Find the content string in AI response
const content = input.choices[0]?.message?.content;

if (content) {
  try {
    // Parse the JSON inside the content field
    const parsedContent = JSON.parse(content);

    // If items array exists, add each item as an output object
    if (Array.isArray(parsedContent.items)) {
      outputItems.push(...parsedContent.items.map(i => ({ json: i })));
    }
  } catch (error) {
    // If parsing error occurs, log it
    console.error('Error parsing content:', error);
  }
}

// Return list of line items
return outputItems;

Customization options

  • Change AI model in the HTTP Request node by editing the “model” field to try different OpenAI models for parsing.
  • Adjust Google Drive Trigger node to watch different or multiple invoice folders.
  • Edit JavaScript in the Code node to format amounts as numbers instead of strings for calculations.

Common troubleshooting tips

Webhook not receiving data: Check if the webhook URL is correctly set in the parsing service settings.
Test webhook with tools like Postman or curl to confirm it is reachable.

Failed HTTP request to OpenAI API: Ensure API key is correct and present in the HTTP Request node headers.
Verify content type is set to “multipart-form-data” for file uploading.


Summary of results

✓ Automatically reads invoices from Google Drive folder.
✓ Extracts detailed line items using AI parsing.
✓ Saves structured data in database or Airtable.
✓ Cuts down manual entry errors and time.
✓ Runs every time a new invoice is uploaded.


Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

The workflow starts when a new file is added to the configured Google Drive folder.
It sends the invoice file to an AI service via HTTP POST, which returns parsed line items to an n8n webhook.
The Code node extracts and formats the individual invoice line items from the AI response JSON.
Add all required API keys and credentials, adjust folder or database IDs, test the workflow, then activate it for production.

Promoted by BULDRR AI

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.