Extract timesheet data with Mistral OCR & Gmail human verification
Needs changesNeeds changes. This template uses 1 thing(s) that n8n 3.0 removes: AI Agent v1 (old agent modes). 1 breaking item(s) found. Static check, last run 2026-10-19.
What to replace before upgrading
| Removed in 3.0 | Replace with |
|---|---|
| AI Agent v1 (old agent modes) AI Agent to clean and format exctracred data (v1.9) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Worth a look
- Spreadsheet File (Read Spreadsheet File): Convert to File / Extract from File
Nodes used (12)
- Manual Trigger
n8n-nodes-base.manualTrigger - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - Spreadsheet File
n8n-nodes-base.spreadsheetFile - Mistral Cloud Chat Model
@n8n/n8n-nodes-langchain.lmChatMistralCloud - Google Drive
n8n-nodes-base.googleDrive - Edit Fields (Set)
n8n-nodes-base.set - Switch
n8n-nodes-base.switch - Gmail
n8n-nodes-base.gmail - HTTP Request
n8n-nodes-base.httpRequest - Aggregate
n8n-nodes-base.aggregate - AI Agent
@n8n/n8n-nodes-langchain.agent - Code
n8n-nodes-base.code
What it does
📖 Description 🔹 How it works This workflow introduces an AI + Human-in-the-Loop pipeline for employee timesheet management. It combines the power of Google Drive, AI (OCR + LLM), and Gmail with a human review step to ensure accuracy and compliance. 1. AI-Powered File Discovery - Scans a Google Drive folder for new or updated timesheet files (PDF, Word, Excel, Images). 2. AI Data Extraction - Uses OCR and LLM (Mistral) to intelligently read and extract structured data. - Supports multiple formats: PDF, Word (DOC/DOCX), Excel (XLS/XLSX), and Image files (JPG, PNG, scanned documents). - Creates clean JSON with file details and timesheet logs (date, hours worked, tasks, notes). 3. Smart Data Formatting - Converts AI output into a clear HTML summary table for easy review. - Flags potential anomalies (missing hours, duplicate dates, irregular entries). 4. Human-in-the-Loop Verification - Sends an approval email via Gmail containing: - File metadata - AI-generated HTML summary - JSON attachment of raw extracted data - HR/Managers review the summary and approve/reject before final actions occur. 5. Post-Approval Automation (optional) - Approved records can be saved in a separate Google Drive folder. - Employees or HR receive confirmation emails. --- ⚙️ Set up steps 1. Connect Credentials - Add Google Drive and Gmail credentials in n8n. - Configure Mistral (or any LLM) API credentials. 2. Configure Google Drive - In the “Search files and folders” node, replace the folderId with your company’s timesheet folder ID. 3. Customize Extraction Schema - Sticky notes explain how JSON output is structured. - Adapt it for your organization’s needs (e.g., overtime, project codes). 4. Set Up Human Verification Emails - Update Gmail node recipients to your HR or approval team. - Customize the email body (AI summary + JSON file attached). 5. Activate & Test - Enable the workflow. - Upload a sample timesheet to trigger the AI + human verification loop. --- ⚡ Result: A robust AI + Human-in-the-Loop workflow that reduces repetitive data entry, prevents payroll errors, and gives HR full confidence before final approval.