
n8n Ships AI Invoice Processing Template With GL Code Mapping
n8n released a workflow template that automates invoice processing from PDF drop to accounting system import, using AI to classify expenses and route high-value transactions for human review.
The template, shared on LinkedIn, triggers when a PDF lands in Google Drive. The workflow extracts invoice data, classifies the expense category using a language model, suggests general ledger codes, and converts the structured output to XML for direct import into accounting platforms.
Automated Approval Rules
The workflow includes conditional logic that flags invoices over $5,000 or those classified as unusual for manual review. Everything else processes automatically. This threshold-based routing mirrors how many finance teams already handle approvals, but removes the manual triage step.
The GL code suggestion relies on the AI model's understanding of expense categories. Teams can map their own chart of accounts to the classification output, letting the workflow propose codes based on vendor, amount, and description.
Workflow Components
The template combines several existing n8n capabilities:
- Google Drive trigger for new PDF files
- PDF text extraction
- AI classification via language model node
- Conditional routing based on amount and category
- XML formatting for ERP import
- Human-in-the-loop approval for flagged items
Users can swap the Google Drive trigger for email attachments, Dropbox, or any other file source. The XML output format is customizable to match different accounting systems' import schemas.
Technical Setup
The template requires an n8n instance (cloud or self-hosted), Google Drive API credentials, and an AI model provider like OpenAI or Anthropic. Teams using the self-hosted version can run the entire workflow on their own infrastructure, keeping invoice data internal.
GL code mapping happens through a lookup table or API call to the accounting system. For companies with complex coding rules, the workflow can call out to custom logic or a rules engine before finalizing the code assignment.
Context for Finance Automation
n8n has been expanding its AI workflow capabilities over the past year. The platform recently added verified cognee integration for agent memory, and shipped a multi-model debate template for consensus-based answers. This invoice template applies similar AI orchestration to a finance operations workflow.
The template is available now in n8n's workflow library. Teams can clone it directly into their workspace and modify triggers, classification logic, or approval thresholds to match their existing processes.
Sources
1 checkedHow we cover tool news: Create With's tool desk drafts these reports with AI from the sources listed above and checks them against those sources before publishing.







