Multi-Attachment Invoice Sorter and Sequential Batch OCR
Read the execution path horizontally, with supporting AI nodes below. Layout changes affect this preview only; the download stays unchanged.
Loading workflow…
Workflow Description
This workflow ingests emails carrying multiple mixed attachments (invoices, receipts, agreements, and corrupted files). It unbundles the attachment array into discrete n8n items, validates MIME types and file sizes, routes supported files through sequential OCR simulation and classification, and isolates invalid files. Finally, it compiles an integrated audit ledger item with overall status flags without performing unverified automated payments.
How it works
- 1.Trigger the workflow manually via Manual Trigger to produce a realistic 4-attachment email payload.
- 2.Deconstruct the attachments array into individual items and validate file extensions and size limits.
- 3.Route valid files to OCR simulation and invalid files to rejection formatting using an If node.
- 4.Extract simulated accounting fields (invoice number, amount, currency, confidence) and classify document types.
- 5.Normalize rejected items with explicit rejection causes and zeroed balances in a Set node.
- 6.Append both processing streams and compile a consolidated financial audit ledger item.
Use cases
- Accounts payable teams receiving vendor emails with combined invoices, agreements, and receipts.
- Preventing batch OCR crashes caused by non-supported file formats or oversized files.
- Generating structured pre-audit accounting summaries for internal financial review.
Requirements
- n8n instance supporting Code v2, Set v3.4, and Merge v3.2 nodes.
- No external credentials required for the self-contained demonstration flow.
- For production: connect Gmail/IMAP trigger, live Document AI / OCR HTTP service, and Google Drive / Sheets nodes.
Setup and testing in n8n
- Click 'Test step' on Manual Trigger to emit the fictional email payload with 4 mixed attachments.
- Inspect Explode & Validate Attachments to ensure 4 distinct items are emitted with format flags.
- Verify that 3 items traverse the valid OCR path while the .exe file is directed to the rejection branch.
- Inspect Build Financial Audit Ledger to confirm a single consolidated output object with complete summary counts and ledger rows.
Service Value
Ready-made workflow template for automation delivery and service execution.
Apps Used
Details
How to Use
- 1.Click "Download Template"
- 2.Open your n8n dashboard
- 3.Go to Workflows > Import from File
- 4.Select downloaded file and configure credentials
Nodes Used (8)
Manual Trigger
Manual Trigger
Mock Inbound Email Payload
Code
Explode & Validate Attachments
Code
Filter Supported Files
If
Simulate Sequential OCR & Extraction
Code
Format Rejected Attachments
Set
Merge File Streams
Merge
Build Financial Audit Ledger
Code
Workflow Overview Note
Sticky Note
Production Setup Instructions Note
Sticky Note
Fresh workflows, straight to your inbox
Get newly published DROPIDEA workflows, a clear overview of what they do, and a link to explore them.
- New workflows
- Clear overviews
- Setup guides