Skip to content
AI Agents

Multi-Attachment Invoice Sorter and Sequential Batch OCR

8 nodes 64 6 Manual trigger
Download

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. 1.Trigger the workflow manually via Manual Trigger to produce a realistic 4-attachment email payload.
  2. 2.Deconstruct the attachments array into individual items and validate file extensions and size limits.
  3. 3.Route valid files to OCR simulation and invalid files to rejection formatting using an If node.
  4. 4.Extract simulated accounting fields (invoice number, amount, currency, confidence) and classify document types.
  5. 5.Normalize rejected items with explicit rejection causes and zeroed balances in a Set node.
  6. 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

  1. Click 'Test step' on Manual Trigger to emit the fictional email payload with 4 mixed attachments.
  2. Inspect Explode & Validate Attachments to ensure 4 distinct items are emitted with format flags.
  3. Verify that 3 items traverse the valid OCR path while the .exe file is directed to the rejection branch.
  4. 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

Manual Trigger Code If Set Merge

Details

Trigger Manual trigger
Nodes 8
Apps 5
Views 64
Downloads 6

How to Use

  1. 1.Click "Download Template"
  2. 2.Open your n8n dashboard
  3. 3.Go to Workflows > Import from File
  4. 4.Select downloaded file and configure credentials

Nodes Used (8)

Manual Trigger

Manual Trigger

#1

Mock Inbound Email Payload

Code

#2

Explode & Validate Attachments

Code

#3

Filter Supported Files

If

#4

Simulate Sequential OCR & Extraction

Code

#5

Format Rejected Attachments

Set

#6

Merge File Streams

Merge

#7

Build Financial Audit Ledger

Code

#8

Workflow Overview Note

Sticky Note

#9

Production Setup Instructions Note

Sticky Note

#10
Stay in the loop

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

Be first to discover what is new

Your name, your email, and one confirmation.

Email confirmation · Unsubscribe anytime