Skip to main content

Extract and log data to Airtable with Google Gemini, ILovePDF, and Google Drive

Workflow preview

Workflow preview
100%
Extract and log data to Airtable with Google Gemini, ILovePDF, and Google Drive preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Who is this workflow template for? This workflow template is perfect for freelancers, small business owners, accounting teams, or anyone responsible for managing and recording invoices regularly. I...

Best for

  • Personal Productivity automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

@n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatgooglegemini, n8n-nodes-base.merge, n8n-nodes-base.compression, n8n-nodes-base.switch, n8n-nodes-base.httprequest, @n8n/n8n-nodes-langchain.outputparserstructured, n8n-nodes-base.airtable

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by AlexAy.

Original n8n.io source

1.1 Workflow description

Title
Extract and log data to Airtable with Google Gemini, ILovePDF, and Google Drive
Workflow name
Extract and log data to Airtable with Google Gemini, ILovePDF, and Google Drive

Who is this workflow template for?

This workflow template is perfect for freelancers, small business owners, accounting teams, or anyone responsible for managing and recording invoices regularly. If you deal with multiple invoices and spend considerable time manually entering invoice data into a database, this automation will significantly simplify your daily operations and reduce potential errors.

What this workflow does

The workflow automates the entire invoice logging process. It continuously monitors a designated Google Drive folder every minute for new PDF invoice uploads. Once a new invoice is detected, it is automatically converted from PDF to an image format using the ILovePDF API. After conversion, Google's Gemini AI analyzes the image, intelligently extracting essential details such as vendor name, item description, invoice amount, invoice date, payment date, and bank reference numbers. Finally, this structured data is automatically recorded in an Airtable database (or optionally in a Google Sheet), ensuring organized, accessible records.

Detailed Workflow Explanation

  • Step 1: Invoice Detection

    • Monitors Google Drive for newly uploaded PDF invoices.
  • Step 2: PDF to Image Conversion

    • Converts PDFs into images using ILovePDF.
  • Step 3: Data Extraction via Gemini AI

    • Uses Gemini AI to analyze the invoice image.

    • Extracts data such as Vendor, Description, Amount, Invoice Date, Paid Date, and Bank Reference.

    • Provides clear descriptions even when original invoice descriptions are vague or missing by analyzing vendor context.

  • Step 4: Structured Data Storage

    • Automatically sends extracted data to Airtable or Google Sheets.
  • Step 5: File Management

    • Moves processed PDF files into a separate "Done" folder to clearly differentiate between processed and unprocessed invoices.

Step-by-Step Setup Instructions

  1. Set Up Google Drive:

    • Log in to Google Drive and create two folders:

      • One named Invoices (for incoming PDF files)

      • One named Processed (for processed files)

  2. Obtain API Credentials:

    • ILovePDF API:

      • Sign up at ILovePDF Developers.

      • Retrieve your API key from your account dashboard.

    • Google Gemini AI API:

      • Register at Google AI and generate an API key.
  3. Airtable Database Preparation:

    • Create an Airtable base with the following columns:

      • Vendor (Text)

      • Description (Text)

      • Amount (Number or Text)

      • Invoice Date (Date)

      • Paid Date (Date)

      • Bank Reference (Text)

  4. Import and Configure Workflow in n8n:

    • Import the provided workflow JSON file into your n8n instance.

    • Connect your Google Drive, ILovePDF, Google Gemini AI, and Airtable accounts by entering your credentials in their respective nodes.

  5. Adjust Workflow Settings:

    • In the Google Drive nodes, ensure your newly created Invoices and Processed folders are correctly selected.

    • Update the ILovePDF public key in the appropriate HTTP Request node.

    • Customize the Gemini AI prompt to refine or expand data extraction according to your specific needs.

  6. Testing Your Setup:

    • Upload a sample PDF invoice into the Invoices folder.

    • Execute the workflow by clicking Test Workflow in n8n and verify if data extraction and Airtable logging operate correctly.

Airtable Column Specifications

Ensure your Airtable includes the following structure:

  • Vendor: Single Line Text

  • Description: Single Line Text

  • Amount: Currency or Single Line Text

  • Invoice Date: Date (formatted as YYYY-MM-DD)

  • Paid Date: Date (formatted as YYYY-MM-DD)

  • Bank Reference: Single Line Text

How to Customize the Workflow

  • System Prompt: Adjust the AI instructions by modifying the prompt text to focus on additional or fewer invoice details.

  • Structured Output Parser: Modify the JSON schema in the parser node to match the structure and data points your project specifically requires:

By following these instructions, you’ll have a fully automated, reliable system for handling and logging invoice data, significantly enhancing your productivity.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - AI Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.7

Block 2 - Google Gemini Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - lmChatGoogleGemini
Config choices
Version 1

Block 3 - Merge

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3

Block 4 - Compression

Type / Role
n8n-nodes-base.compression - compression
Config choices
Version 1.1

Block 5 - Switch

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3.2

Block 6 - get server get task

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 7 - upload pdf

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 8 - convert to jpg

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 9 - download file

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 10 - Structured Output Parser

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.2

Block 11 - Airtable

Type / Role
n8n-nodes-base.airtable - airtable
Config choices
Version 2.1

Block 12 - When clicking ‘Test workflow’

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 13 - move file to done

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 14 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 15 - Download file

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 16 - Upload your file to google drive

Type / Role
n8n-nodes-base.googleDriveTrigger - googleDriveTrigger
Config choices
Version 1

Block 17 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 18 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 19 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 20 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 21 - Get token

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

3. Summary Table

Workflow Extract and log data to Airtable with Google Gemini, ILovePDF, and Google Drive
Complexity advanced
Nodes 21
Categories Personal Productivity
Author AlexAy
Published 17 Mar 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/3193/3193.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Extract and log data to Airtable with Google Gemini, ILovePDF, and Google Drive do?

Who is this workflow template for? This workflow template is perfect for freelancers, small business owners, accounting teams, or anyone responsible for managing and recording invoices regularly. I...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Personal Productivity use case.