Automate Colombian Invoice Processing with AI and Email Integration
detail.loadingPreview
Streamline the extraction and processing of Colombian invoices received via email. This workflow automatically retrieves invoice ZIP attachments, extracts data from PDFs and XMLs, and leverages AI to structure the information for further use.
About This Workflow
This n8n workflow is designed to automate the tedious task of processing Colombian invoices. It begins by monitoring your Gmail for new emails containing ZIP attachments, a common method for sending invoices. Upon detection, the workflow securely downloads and extracts the contents of these ZIP files. It then intelligently separates PDF and XML invoice files. For PDFs, it extracts text content, while for XMLs, it prepares them for parsing. The core of the automation lies in leveraging advanced AI models (specifically OpenAI's GPT-4o-mini) and Langchain tools. The AI parses the extracted document data, identifies key invoice fields, and structures them into a usable JSON format, including details like invoice type, numbers, dates, sender/receiver information, and item summaries. This significantly reduces manual data entry and errors, freeing up valuable resources.
Key Features
- Automated Email Monitoring: Continuously scans your Gmail for incoming invoice ZIP files.
- Intelligent File Handling: Automatically unzips attachments and distinguishes between PDF and XML invoice formats.
- AI-Powered Data Extraction: Utilizes OpenAI's GPT-4o-mini to accurately extract and structure key invoice data.
- Structured Output: Generates well-organized JSON output with essential invoice details.
- Customizable AI Prompting: The structured output schema can be easily adapted to your specific data needs.
How To Use
- Configure Gmail Trigger: Connect your Gmail account and set up filters to capture emails with invoice ZIP attachments (e.g.,
has:attachment filename:zip). - Process Attachments: The 'Get Filename and mimeType' and 'Filter ZIP files only' nodes ensure only relevant ZIP files are processed.
- Unzip and Separate: The 'Unzip Invoice' node extracts files, and the 'Split XML and PDF' node categorizes them.
- Extract Document Data: Use the 'Extract PDF Data' and 'Extract XML Data' nodes to get the raw content from each file type.
- AI Data Structuring: Connect the output of the document extraction to the 'OpenAI Chat Model' and 'Structured Output Parser' nodes. Configure the
jsonSchemaExamplein the parser to match the exact fields you need (e.g.,Tipo,Numero_Factura,Fecha_Emision, etc.). - Review and Connect: Review the structured JSON output and connect it to subsequent nodes for further processing (e.g., database storage, sending to another system).
Apps Used
Workflow JSON
{
"id": "000204c6-8d84-4166-9100-c6ebf7f36f3d",
"name": "Automate Colombian Invoice Processing with AI and Email Integration",
"nodes": 26,
"category": "Operations",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: 000204c6-8d84...
About the Author
N8N_Community_Pick
Curator
Hand-picked high quality workflows from the global community.
Statistics
Related Workflows
Discover more workflows you might like
Universal CSV to JSON API Converter
Effortlessly transform CSV data into structured JSON with this versatile n8n workflow. Integrate it into any application as a custom API endpoint, supporting various input methods including file uploads and raw text.
Instant WooCommerce Order Notifications via Telegram
When a new order is placed on your WooCommerce store, instantly receive detailed notifications directly to your Telegram chat. Stay on top of your e-commerce operations with real-time alerts, including order specifics and a direct link to view the order.
On-Demand Microsoft SQL Query Execution
This workflow allows you to manually trigger and execute any SQL query against your Microsoft SQL Server database. Perfect for ad-hoc data lookups, administrative tasks, or quick tests, giving you direct control over your database operations.