Colombian Invoices Processing

Colombian Invoices Processing automates the extraction and organization of personal electronic invoices received via Gmail. It checks for new invoices every 30 minutes, extracts data from ZIP files containing PDF and XML formats, and validates financial details. The workflow uploads the original PDF to Google Drive, renames it with the issue date and invoice number, and updates Google Sheets with key invoice information, ensuring efficient record-keeping and compliance with Colombian regulations.

7/8/2025
23 nodes
Complex
manualcomplexsplitinbatcheslangchaingmailtriggerfiltercompressionnoopextractfromfileaggregategoogle drivegooglesheetssticky noteadvancedlogicroutingfilesstoragedataparsing
Categories:
Communication & MessagingComplex WorkflowManual TriggeredData Processing & Analysis
Integrations:
SplitInBatchesLangChainGmailTriggerFilterCompressionNoOpExtractFromFileAggregateGoogle DriveGoogleSheetsSticky Note

Target Audience

This workflow is ideal for:
- Small Business Owners who deal with electronic invoices and need to automate the processing of invoices received via email.
- Freelancers who want to streamline their invoicing process and keep track of their expenses efficiently.
- Accountants looking to save time on data entry and ensure accurate record-keeping of invoices.
- Individuals who want to manage personal invoices without manual effort.

Problem Solved

This workflow addresses the challenges of:
- Manual Invoice Processing: Automates the extraction and organization of invoices, reducing the time spent on manual entry.
- Data Accuracy: Ensures that the extracted data is validated and accurate, minimizing errors in financial records.
- Storage and Organization: Automatically uploads invoices to Google Drive and keeps a structured record in Google Sheets, making retrieval easy and organized.
- Compliance: Follows DIAN requirements for electronic invoices in Colombia, ensuring that users remain compliant with local regulations.

Workflow Steps

  • Email Trigger: Checks Gmail every 30 minutes for emails with .zip attachments containing invoices.
    2. ZIP File Handling: Extracts files from the ZIP and filters for PDF and XML formats for further processing.
    3. Data Extraction: Uses LangChain Agent + OpenAI (GPT-4o-mini) to extract key invoice information:
    - Document Type (Invoice / Credit Note)
    - Invoice Number
    - Issue Date (format: YYYY-MM-DD)
    - Issuer's NIT and Receiver's NIT (without verification digit)
    - Issuer's Business Name
    - Subtotal, VAT, Total Amount
    - CUFE
    - Purchase Summary (max 20 words, grammatically formatted)
    4. Validation: Confirms that Total = Subtotal + VAT using a calculator node to ensure accuracy.
    5. Storage: Uploads the original PDF to Google Drive with the new name format: YYYY-MM-DD-NUMERO_FACTURA.pdf and updates Google Sheets with invoice details, using a unique key to prevent duplication.
  • Customization Guide

    Users can customize this workflow by:
    - Changing Email Filters: Adjust the Gmail trigger filters to match specific criteria for the invoices you want to process.
    - Modifying Data Extraction Prompts: Update the LangChain prompts to extract additional fields or change the format of the extracted data based on specific business needs.
    - Adjusting File Naming Conventions: Change the naming format for uploaded PDFs in Google Drive to match your company's standards.
    - Updating Google Sheets Structure: Modify the columns and mapping in Google Sheets to include any additional data points relevant to your invoicing process.
    - Adding Additional Nodes: Integrate additional nodes for further processing or notifications, such as sending alerts upon successful invoice processing.