💼 Case study - Automating File Processing & Renaming with AI
Last time, I shared how we automated hiring 500+ candidates for a client without an HR team. If you missed that post, check it out here. Now, let’s talk about documents—because if you run a business, you know the struggle. This same client receives a constant flow of receipts and invoices via email and manually saves them to Google Drive. The problem? Finding and organizing these files later is a nightmare. They needed a way to automatically process, rename, and categorize them without spending hours sorting through folders. So we built an AI-powered automation that handles everything on autopilot. Here’s how it works: 🛠️ The Setup 1️⃣ Fetching New Files • Every time a new email arrives with an attachment, the system downloads the file and checks if it’s a receipt or invoice. • If it’s something else, we ignore it. 2️⃣ Smart AI Recognition • We process the file using LlamaParse, which allows us to: ✅ Extract tables (common in invoices) ✅ Recognize logos that contain company names ✅ Parse text even from image-based PDFs (which standard N8N nodes can’t handle) 3️⃣ Context-Aware Parsing • Instead of relying on generic AI recognition, we guide the AI with a predefined list of banks and companies the client frequently deals with. • This makes the results far more accurate and stable. 4️⃣ File Renaming & Metadata Tagging • AI extracts key details like date, amount, and entity name based on separate rule sets. • Each parameter is processed separately to increase precision—because main info and entities follow different logic. • Once identified, the file is renamed according to a structured pattern and saved in Google Drive. 5️⃣ Preventing Duplicates • To avoid reprocessing the same document, we add hidden metadata to each file. If a document comes through again, our system detects it and skips processing. 6️⃣ Structured Data Storage • Parsed information is saved in Airtable, where it links to related records—keeping everything structured for future reference.