Библиотека / Финансы, счета и бухгалтерия
Финансы, счета и бухгалтерия
Обработка колумбийских электронных счетов с OpenAI
Когда в Gmail приходит письмо со счетами в архиве ZIP, он распаковывает их, OpenAI извлекает данные, файлы попадают в Google Drive, а строки добавляются в Google Sheets.
Что делает
# 🧾 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.
Шаги
- Loop Over Items
- OpenAI Chat Model
- Calculator
- Structured Output Parser
- On Email receipt
- Get Filename and mimeType
- Filter ZIP files only
- Unzip Invoice
- Just for style
- Get filename and mimeType on extracted docs
- Split XML and PDF
- Extract PDF Data
- Extract XML Data
- Convert to JSON
Всего шагов: 22.
Похожие автоматизации
Финансы, счета и бухгалтерияСохранение чеков из Gmail в Drive и Sheets с OpenAIШагов: 12Финансы, счета и бухгалтерияСохранение счетов n8n Paddle из Gmail в Google DriveШагов: 32Финансы, счета и бухгалтерияИзвлечение чеков из почты, Telegram и Drive с помощью GeminiШагов: 21Финансы, счета и бухгалтерияИзвлечение и проверка счетов с OpenRouter, Sheets и GmailШагов: 34