When I Get An Email With Invoice, This n8n Agent Workflow Automatically Tells My Accounting Agent To Process It 🔥
Built two separate n8n agents: One monitors email. Another handles accounting. Connected them. Now they coordinate automatically - email agent briefs accounting agent with invoice data. THE PROBLEM WITH SINGLE AGENTS: One agent trying to do everything: monitor email, parse documents, check duplicates, post to QuickBooks. Gets confused. Makes errors. Too many tools overload the context. THE MULTI-AGENT SOLUTION: Split responsibilities. Specialized agents. Each does one thing excellently. AGENT 1: EMAIL MONITOR AGENT Role: Watch Gmail, identify invoices, extract data. Tools: Gmail trigger, document parsing tool, confidence scoring. Output: Structured invoice summary with confidence score. Workflow: Receives email → Checks for invoice keywords → Parses PDF attachment → Extracts vendor, amount, date, invoice number → Scores confidence → Passes to router. AGENT 2: ACCOUNTING AGENT Role: Process financial data, post transactions, check duplicates. Tools: QuickBooks API, Google Sheets, duplicate detection database. Output: Posted transaction confirmation, notification. Workflow: Receives invoice summary → Checks for duplicates → Validates data → Posts to QuickBooks → Updates tracking sheet → Sends confirmation. THE COORDINATION LAYER: Router node between agents. Checks confidence score from Email Agent. High confidence (above 0.90): Sends directly to Accounting Agent. Medium confidence (0.75-0.90): Sends with review flag. Low confidence (below 0.75): Human approval required first. DATA PASSING: Email Agent outputs: vendor_name, invoice_amount, due_date, invoice_number, confidence_score, pdf_url Accounting Agent receives: Same structured data, processes automatically or flags for review based on confidence. THE COMPLETE FLOW: Gmail Trigger → Email Agent (with document processing tool) → Confidence Router → Accounting Agent → Post to QuickBooks → Notify THE NUMBERS: - 40 invoices monthly processed - 36 posted automatically (90%) - 4 flagged for review (10%)