← All N8N workflows
AI & researchAgentAggregateCodeCompressionExtract From File

Colombian Invoices Processing

Configured with Agent, Aggregate, Compression, Extract From File, and additional nodes. Review the connections and setup before adapting this template.

Workflow preview
RoutingLoop Over ItemsLoop Over ItemsAI & modelsOpenAI Chat ModelOpenAI Chat ModelIntegrationCalculatorTool CalculatorTransformStructured OutputParserOutput Parser StructuredTriggerOn Email receiptGmail TriggerCodeGet Filename andmimeTypeCodeRoutingFilter ZIP files onlyFilterTransformUnzip InvoiceCompressionRoutingJust for styleNo OpCodeGet filename andmimeType on extracted…CodeRoutingSplit XML and PDFSwitchTransformExtract PDF DataExtract From FileTransformExtract XML DataExtract From FileTransformConvert to JSONXmlTransformAppend both DocsMergeTransformAggregate all Data into1 listAggregateAI & modelsExtract Data from PDFand XMLAgentFiles / mediaCreate initial PDFGoogle DriveTransformMerge both flowsMergeFiles / mediaUpdate PDF with actualnameGoogle DriveCodeGet Current DateCodeData storeCreate or update rowGoogle Sheets

Node categories in this workflow

  • Routing
  • AI & models
  • Integration
  • Transform
  • Trigger
  • Code
  • Files / media
  • Data store

Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.

Drag to pan; use + and − to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.

How it works

The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.

Workflow node names, types, and operations
NodeCategoryTypeOperation
Loop Over ItemsRoutingLoop Over ItemsSee node parameters
OpenAI Chat ModelAI & modelsOpenAI Chat ModelSee node parameters
CalculatorIntegrationTool CalculatorSee node parameters
Structured Output ParserTransformOutput Parser StructuredSee node parameters
On Email receiptTriggerGmail TriggerSee node parameters
Get Filename and mimeTypeCodeCodeSee node parameters
Filter ZIP files onlyRoutingFilterSee node parameters
Unzip InvoiceTransformCompressionSee node parameters
Just for styleRoutingNo OpSee node parameters
Get filename and mimeType on extracted docsCodeCodeSee node parameters
Split XML and PDFRoutingSwitchSee node parameters
Extract PDF DataTransformExtract From Filepdf
Extract XML DataTransformExtract From Filexml
Convert to JSONTransformXmlSee node parameters
Append both DocsTransformMergeSee node parameters
Aggregate all Data into 1 listTransformAggregateSee node parameters
Extract Data from PDF and XMLAI & modelsAgentSee node parameters
Create initial PDFFiles / mediaGoogle DriveSee node parameters
Merge both flowsTransformMergeSee node parameters
Update PDF with actual nameFiles / mediaGoogle Driveupdate
Get Current DateCodeCodeSee node parameters
Create or update rowData storeGoogle SheetsappendOrUpdate

Setup

  1. Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
  2. Connect your own credentials through n8n’s credential store. Replace REPLACE_WITH_* values with your resource identifiers.
  3. Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
  4. Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.

Requirements

An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.

Credential types declared in the source

  • gmailOAuth2
  • googleDriveOAuth2Api
  • googleSheetsOAuth2Api
  • openAiApi

Workflow notes

On Email receipt

Executed every 30 minutes as it's for personal invoices, one can wait

Get Current Date

Not in use actually...

🧾 Colombian electronic invoices processing

🧾 Colombian electronic invoices processing

This N8N workflow automates the extraction and organization of personal electronic invoices in Colombia received via Gmail. It includes the following key steps:

🔁 Flow Summary

  1. Email Trigger

    • Polls Gmail every 30 minutes for emails with .zip attachments (assumed to contain invoices).
    • Following DIAN requirements in Colombia
  2. ZIP File Handling

    • Extracts all files.
    • Filters only PDF and XML files for processing.
  3. Data Extraction & Processing

    • Uses LangChain Agent + OpenAI (GPT-4o-mini) to extract:
      • Tipo de documento (Factura / Nota Crédito)
      • Número de factura
      • Fecha de emisión (YYYY-MM-DD)
      • NIT emisor y receptor (sin dígito de verificación)
      • Razón social del emisor
      • Subtotal, IVA, Total
      • CUFE
      • Resumen de compra (max 20 words, formatted sentence)
  4. Validation

    • Ensures Total = Subtotal + IVA using a calculator node.
  5. Storage

    • Uploads the original PDF to Google Drive.
    • Renames the file to: YYYY-MM-DD-NUMERO_FACTURA.pdf.
    • Inserts or updates invoice details in Google Sheets using a unique Key (NIT_Emisor + Numero_Factura) to prevent duplication.

⚙️ Designed for personal use with minimal latency tolerance and high automation reliability.

Colombian Invoices Processing

Colombian Invoices Processing

Purpose and structure

This folder contains the Colombian Invoices Processing workflow. Its executable nodes use agent, aggregate, code, compression, extractFromFile, filter, gmailTrigger, googleDrive, googleSheets, lmChatOpenAi, merge, noOp, outputParserStructured, splitInBatches, switch, toolCalculator, xml. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.

Setup

Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.

Entry points

On Email receipt

Verification

Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.

Attribution

https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Code/1765_Code_Filter_Process_Triggered.json MIT; preserve source notices.

More in AI & research