Colombian Invoices Processing
Configured with Agent, Aggregate, Compression, Extract From File, and additional nodes. Review the connections and setup before adapting this template.
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.
| Node | Category | Type | Operation |
|---|---|---|---|
| Loop Over Items | Routing | Loop Over Items | See node parameters |
| OpenAI Chat Model | AI & models | OpenAI Chat Model | See node parameters |
| Calculator | Integration | Tool Calculator | See node parameters |
| Structured Output Parser | Transform | Output Parser Structured | See node parameters |
| On Email receipt | Trigger | Gmail Trigger | See node parameters |
| Get Filename and mimeType | Code | Code | See node parameters |
| Filter ZIP files only | Routing | Filter | See node parameters |
| Unzip Invoice | Transform | Compression | See node parameters |
| Just for style | Routing | No Op | See node parameters |
| Get filename and mimeType on extracted docs | Code | Code | See node parameters |
| Split XML and PDF | Routing | Switch | See node parameters |
| Extract PDF Data | Transform | Extract From File | |
| Extract XML Data | Transform | Extract From File | xml |
| Convert to JSON | Transform | Xml | See node parameters |
| Append both Docs | Transform | Merge | See node parameters |
| Aggregate all Data into 1 list | Transform | Aggregate | See node parameters |
| Extract Data from PDF and XML | AI & models | Agent | See node parameters |
| Create initial PDF | Files / media | Google Drive | See node parameters |
| Merge both flows | Transform | Merge | See node parameters |
| Update PDF with actual name | Files / media | Google Drive | update |
| Get Current Date | Code | Code | See node parameters |
| Create or update row | Data store | Google Sheets | appendOrUpdate |
Setup
- Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
- Connect your own credentials through n8n’s credential store. Replace
REPLACE_WITH_*values with your resource identifiers. - Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
- 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
gmailOAuth2googleDriveOAuth2ApigoogleSheetsOAuth2ApiopenAiApi
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
-
Email Trigger
- Polls Gmail every 30 minutes for emails with
.zipattachments (assumed to contain invoices). - Following DIAN requirements in Colombia
- Polls Gmail every 30 minutes for emails with
-
ZIP File Handling
- Extracts all files.
- Filters only PDF and XML files for processing.
-
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)
- Uses LangChain Agent + OpenAI (GPT-4o-mini) to extract:
-
Validation
- Ensures Total = Subtotal + IVA using a calculator node.
-
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.