Skip to content

aceymagallanes/ap-control-tower

Repository files navigation

Intelligent AP Control Tower

AI-powered invoice processing, validation & financial risk detection

An end-to-end accounts-payable automation that reads invoices, validates them against multiple business rules, uses AI to investigate exceptions and recommend actions, and routes only the risky or uncertain cases to humans — processing the routine automatically and focusing expert attention on exceptions and risk.

View the live dashboard →  ·  View the business case →


The problem

Accounts Payable teams manually key invoice data and eyeball each one for problems. At scale this is slow, costly (industry benchmark: $10–18 per invoice fully loaded), and a genuine source of financial loss — duplicate payments, PO mismatches, math errors, and fraud that slips through manual review.

What this system does

It reframes invoice automation as an intelligent control tower: clean invoices flow straight through, while anything risky or uncertain is caught, investigated, and escalated.

The pipeline (built in n8n):

  1. Ingest — reads invoice data (and, in the document-AI demo, actual PDF files)
  2. Validate — a business-rules engine runs seven checks:
    • Duplicate-invoice detection (prevents double payments)
    • Math validation (subtotal + tax = total)
    • Tolerance-based 3-way match (invoice vs PO, allowing the greater of 5% or $500 variance — how real AP departments operate)
    • Missing-PO / completeness checks
    • Threshold-skimming detection (invoices priced just under approval limits — a fraud signal)
    • Vendor bank-detail-change detection (impersonation risk)
    • Confidence gate (low-quality inputs routed to human review)
  3. Branch — clean invoices are auto-approved; exceptions are routed onward
  4. Investigate (agentic AI) — a Claude-powered exception advisor investigates each flagged invoice and returns a severity rating, likely cause, recommended action, and a hold-payment decision
  5. Record — all results, flags, and AI recommendations are written to a results ledger
  6. Visualise — a live dashboard and an interactive ROI calculator

Key results

  • 85% straight-through processing rate (170 of 200 invoices auto-approved, fully reconciled)
  • 30 exceptions caught and individually investigated by the AI advisor
  • 14 financial-risk signals surfaced (threshold-skimming, bank-detail changes, duplicates)
  • Defensible ROI model: ~$663K hard annual savings + ~$300K upside at mid-market volume, scaling to seven figures at enterprise scale — every assumption sourced to published benchmarks (IOFM / Ardent Partners)

Intelligent document processing (confidence scoring)

A companion workflow demonstrates AI document extraction: Claude reads actual invoice PDFs and returns structured data with a confidence score per field. Clean invoices extract at ~1.0 confidence and auto-process; a deliberately degraded scan dropped to 0.88, fell below the 0.90 review threshold, and was automatically routed for human review — with the AI noting the legibility issue itself. This human-in-the-loop design means the system knows when it's unsure rather than guessing.

Why it's built this way (design decisions)

  • Tolerance-based matching, not exact-match — mirrors real ERP configuration and avoids drowning the team in trivial exceptions
  • Agentic exception handling — the AI doesn't just flag, it investigates and recommends, turning a detector into an advisor
  • Honest measurement — accuracy and confidence are reported transparently, including where the system is uncertain
  • Reconciled numbers — every figure ties to the 200-invoice total, a financial-controls discipline
  • Conservative, sourced ROI — savings use the low end of published benchmark ranges and separate "hard" savings from "upside"

Tech stack

n8n (workflow orchestration) · Claude API (extraction, confidence scoring, agentic exception advisory) · Google Sheets (data + results ledger) · Google Drive (PDF intake) · Chart.js (dashboard) · HTML/CSS/JS (dashboard + ROI calculator)

Repository contents

  • AP-Control-Tower-workflow.json — the main n8n validation + advisory pipeline
  • PDF-Extraction-Demo-workflow.json — the document-AI / confidence-scoring workflow
  • index.html — the live control-tower dashboard
  • roi.html — the interactive ROI / business-case calculator
  • data/ — sample data: 200 invoices, purchase orders, goods receipts, and sample invoice PDFs
  • screenshots/ — dashboard, ROI calculator, workflow, and confidence-scoring output
  • AP-Control-Tower-Case-Study.docx — full written case study

Built by Maria Corazon "Acey" Magallanes — Business Transformation Manager · AI & Automation · Lean Six Sigma Black Belt.

About

AI-powered Accounts Payable automation: validates invoices, detects fraud signals, and uses an agentic AI advisor to investigate exceptions — built with n8n and the Claude API

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages