Skip to main content

Extract Colombian invoice data from Drive to Sheets with GPT-4o

Workflow preview

Workflow preview
100%
Extract Colombian invoice data from Drive to Sheets with GPT-4o preview
Open on n8n.io

Important notice

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

1. Workflow Overview

Automate Colombian Cashflow Data Extraction to Google Sheets with AI Who’s it for This workflow is designed for finance professionals, accountants, small business owners in Colombia , or anyone nee...

Best for

  • Invoice Processing automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

@n8n/n8n-nodes-langchain.lmchatazureopenai, @n8n/n8n-nodes-langchain.outputparserstructured, n8n-nodes-base.googledrivetrigger, n8n-nodes-base.googledrive, n8n-nodes-base.switch, @n8n/n8n-nodes-langchain.chainllm, n8n-nodes-base.set, n8n-nodes-base.splitout

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Extract Colombian invoice data from Drive to Sheets with GPT-4o
Workflow name
Extract Colombian invoice data from Drive to Sheets with GPT-4o

Automate Colombian Cashflow Data Extraction to Google Sheets with AI

Who’s it for

This workflow is designed for finance professionals, accountants, small business owners in Colombia, or anyone needing to automate the extraction of invoice data and its entry into Google Sheets. It's particularly useful for handling Colombian tax and legal specifics.

How it works / What it does

This workflow automates the process of extracting critical data from invoices and receipts (PDFs and JPEGs) and organizing it in a Google Sheet:

  • Triggers: The workflow initiates when a new file is created or an existing file is updated in a designated Google Drive folder.
  • File Handling: It first downloads the detected file.
  • Routing: A "Switch" node intelligently routes the file based on its extension – one path for PDFs and another for JPEGs.
  • Data Extraction:
    • For PDF files, it directly extracts all text content from the document.
    • For JPEG image files, it utilizes an AI Agent (Azure OpenAI) to process the image and extract its textual content.
  • AI-Powered Reasoning: Two "Reasoning Agent" nodes (Azure OpenAI Chat Models) act as a specialized "Colombian Tax and Legal Extraction Agent". They parse the extracted text from invoices to pull out structured data in JSON format, including:
    • Vendor name.
    • Modification date.
    • Line items with detailed description, sub_total, iva_value, total_amount, category, and sub_category.
    • Specific Colombian tax fields like Retefuente and ReteICA.
    • The number of items generated.
  • Output Parsing: A "Structured Output Parser" node ensures that the AI's output strictly adheres to a predefined JSON schema, guaranteeing consistent data formatting.
  • Data Preparation: "Edit Field" nodes ensure the AI's extracted data is in a valid format.
  • Item Splitting: "Split data" nodes separate the 'items' array from the AI's output, allowing each individual line item from the invoice to be processed as a separate entry for the Google Sheet.
  • Google Sheet Integration: Finally, "Fill Template" nodes append the fully processed invoice data (per line item) into your designated Google Sheet.

How to set up

  1. Google Drive Credentials: Ensure you have configured your Google Drive OAuth2 API credentials in n8n.
  2. Azure OpenAI Credentials: Set up your Azure OpenAI API credentials, ensuring access to models like gpt-4o. Or you can simply use your traditional OpenAI or others LLMs.
  3. Google Sheets Credentials: Configure your Google Sheets OAuth2 API credentials.
  4. Google Drive Folder ID: In the "1a. Updated file trigger" and "1b. Created file trigger" nodes, update the folderToWatch parameter with your specific Google Drive Folder ID.
  5. Google Sheet ID and Sheet Name: In the "8. Fill Template" and "8. Fill Template1" nodes, update the documentId and sheetName parameters with your specific Google Sheet ID and the name of the sheet where data should be appended.

Requirements

  • An active n8n instance.
  • A Google Drive account for file uploads.
  • A Google Sheets account for data storage.
  • An Azure OpenAI account with access to chat models (e.g., gpt-4o) for the "Azure OpenAI Chat Model" nodes and "Extract Data Agent".

How to customize the workflow

  • AI Extraction Prompts: Modify the prompt instructions in the "5. Reasoning Agent" and "5. Reasoning Agent1" nodes if you need to extract different data points or change the output format.
  • Google Sheet Column Mappings: Adjust the columns mapping in the "8. Fill Template" and "8. Fill Template1" nodes to match your specific Google Sheet headers and data requirements.
  • File Types: Extend the "3. Route" node to handle additional file types (e.g., DOCX, PNG) by adding new conditions and corresponding extraction nodes.

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 - Azure OpenAI Chat Model

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

Block 2 - Azure OpenAI Chat Model2

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

Block 3 - Azure OpenAI Chat Model3

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

Block 4 - Structured Output Parser

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

Block 5 - 1a. Updated file trigger

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

Block 6 - 1b. Created file trigger

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

Block 7 - 2. Download file

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

Block 8 - 3. Route

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

Block 9 - 5. Reasoning Agent

Type / Role
@n8n/n8n-nodes-langchain.chainLlm - chainLlm
Config choices
Version 1.5

Block 10 - 6. Edit Field

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 11 - 7. Split data

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

Block 12 - 8. Fill Template

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.5

Block 13 - 4. Extract data from PDF

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

Block 14 - 4. Extract Data Agent

Type / Role
@n8n/n8n-nodes-langchain.chainLlm - chainLlm
Config choices
Version 1.5

Block 15 - 5. Reasoning Agent1

Type / Role
@n8n/n8n-nodes-langchain.chainLlm - chainLlm
Config choices
Version 1.5

Block 16 - 6. Edit Field1

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 17 - 7. Split Data

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

Block 18 - 8. Fill Template1

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.5

Block 19 - Sticky Note1

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

Block 20 - Sticky Note2

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

Block 21 - Sticky Note3

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

Block 22 - Sticky Note4

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

Block 23 - Sticky Note5

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

Block 24 - Sticky Note6

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

Showing the first 24 of 29 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Extract Colombian invoice data from Drive to Sheets with GPT-4o
Complexity advanced
Nodes 29
Categories Invoice Processing, AI Summarization
Author Caio Garvil
Published 31 Aug 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/8099/8099.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 Colombian invoice data from Drive to Sheets with GPT-4o do?

Automate Colombian Cashflow Data Extraction to Google Sheets with AI Who’s it for This workflow is designed for finance professionals, accountants, small business owners in Colombia , or anyone nee...

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 Invoice Processing, AI Summarization use case.