I wanted to share our successful implementation of automated invoice matching using an RPA bot in the workflow-mgmt module. We process approximately 2,500 supplier invoices monthly, and the manual matching process was taking our AP team 3 full days each week.
The challenge was matching incoming invoices against purchase orders with complex line-item validation rules. Our suppliers use different invoice formats, and we needed to handle partial deliveries, quantity variances, and price discrepancies according to our tolerance policies.
We deployed an RPA bot that automatically extracts invoice data, matches it against PO records in our ERP, applies our business rules for variance tolerance, and routes exceptions to the appropriate approvers. The results have been impressive:
- Processing time reduced from 3 days to 4 hours per week
- 87% of invoices now auto-match without human intervention
- Exception routing improved from 24-hour delays to real-time assignment
- AP team can now focus on resolving discrepancies rather than data entry
The implementation took about 6 weeks and required careful attention to PO-based matching logic, exception routing workflows, and bot log monitoring. Happy to share more details about our approach.
We use a combination approach. For structured formats (XML, EDI), the bot extracts data directly. For PDFs, we integrated an OCR service (Azure Form Recognizer) that the bot calls before processing. The OCR accuracy is about 95%, and the bot validates extracted data against expected patterns before attempting PO matching.
For price variances, we have tiered tolerances: under 2% auto-approves, 2-5% routes to AP supervisor, over 5% requires manager approval. Quantity variances follow similar rules. The key is having these business rules configurable so we can adjust without changing bot logic.
Also curious about exception routing. When the bot identifies a discrepancy that needs human review, how does it determine which approver to route to? Is it based on dollar amount, supplier relationship, or something else? We have a complex approval matrix that varies by department and spend category.
Great question. The bot maintains a matching table that tracks all goods receipts against each PO line item. When an invoice arrives, it queries all open receipts for that PO and calculates the remaining unbilled quantity. If the invoice quantity equals the sum of unbilled receipts, it auto-matches. If there’s a discrepancy, it flags for review with a detailed breakdown showing which receipts it considered. This was one of the more complex parts of our PO-based matching logic, but it’s critical for accuracy.
What about partial deliveries? That’s where our current manual process breaks down. An invoice might cover multiple PO line items with different delivery dates. How does your bot handle matching across multiple receipts?
How do you handle bot log monitoring? With 2,500 invoices per month, you must generate significant log data. Do you have automated alerts for bot failures, or do you review logs manually? We’re planning a similar implementation and want to make sure we have proper monitoring from day one.
Let me provide comprehensive details on all three key areas: PO-based matching logic, exception routing, and bot log monitoring.
PO-Based Matching Logic:
Our matching algorithm follows a multi-stage process:
Stage 1 - Invoice Data Extraction:
- Bot receives invoice (PDF, XML, or EDI format)
- For PDFs: Calls Azure Form Recognizer API to extract invoice number, date, supplier, line items, amounts
- Validates extracted data against business rules (e.g., invoice date not in future, amounts are numeric)
- Confidence threshold: 90% or higher, otherwise routes to manual data entry queue
Stage 2 - PO Identification:
- Bot searches for PO number in invoice header or line items
- If PO not found in invoice, searches by supplier ID + date range (±30 days)
- Queries ERP database for PO details including all line items and goods receipts
- Handles multiple POs per invoice by splitting into separate matching transactions
Stage 3 - Line-Item Matching:
// Pseudocode - Matching algorithm:
1. For each invoice line item:
a. Find corresponding PO line by item number or description match
b. Calculate total received quantity from goods receipts
c. Calculate total previously invoiced quantity
d. Determine remaining unbilled quantity
e. Compare invoice quantity to unbilled quantity
2. Calculate variance percentages for quantity and price
3. Apply tolerance rules to determine match status
4. Generate match result: EXACT, WITHIN_TOLERANCE, or EXCEPTION
Stage 4 - Tolerance Application:
- Exact match: Invoice = PO (auto-approve)
- Quantity variance: <2% auto-approve, 2-5% supervisor review, >5% manager approval
- Price variance: <2% auto-approve (accounts for rounding), 2-5% supervisor, >5% manager
- Multiple variances: Route to highest required approval level
- Partial delivery logic: Accepts invoice if quantity matches sum of unbilled receipts
Exception Routing:
We built a dynamic routing engine in the workflow-mgmt module:
Routing Decision Matrix:
- Variance Type (quantity, price, missing PO, data quality)
- Dollar Amount (<$1K, $1K-$10K, $10K-$50K, >$50K)
- Supplier Tier (strategic, preferred, standard)
- Department (based on PO cost center)
- Historical Pattern (first-time issue vs recurring)
Routing Rules:
- Missing PO + <$1K → AP Clerk (80% of these cases)
- Price variance 2-5% + Strategic supplier → Category Manager
- Price variance >5% + >$10K → Finance Manager + Procurement Manager (parallel approval)
- Quantity variance + Partial delivery → Receiving Supervisor
- Data quality issues (OCR confidence <90%) → Data Entry Queue
The bot creates a workflow task with:
- Detailed variance explanation
- Side-by-side comparison (invoice vs PO)
- Recommendation (approve with adjustment, reject, request clarification)
- Relevant documents attached (invoice PDF, PO, receipts)
- SLA timer based on dollar amount (4 hours for >$50K, 24 hours for <$10K)
Exception handlers can:
- Approve with adjustment (bot updates invoice amount)
- Reject and notify supplier with reason
- Request additional documentation (bot pauses and waits)
- Override tolerance and force approve (requires manager privileges)
Bot Log Monitoring:
We implemented a comprehensive monitoring framework:
Real-Time Monitoring:
- Bot execution dashboard in workflow-mgmt module shows:
- Current processing queue depth
- Invoices processed in last hour/day/week
- Success rate by invoice type
- Average processing time per invoice
- Active exceptions by category
Automated Alerts (configured in Service Center):
-
Bot Failure: Immediate email/SMS to RPA support team
- Triggers: Bot crash, API timeout, database connection failure
- Includes: Error message, stack trace, last successful step
-
Processing Delays: Alert if queue depth exceeds 50 invoices
- Indicates bot performance issue or high volume spike
- Triggers investigation of bot resource allocation
-
Match Rate Degradation: Alert if auto-match rate drops below 80%
- Suggests data quality issues or business rule changes needed
- Triggers review of recent exceptions
-
OCR Accuracy Drop: Alert if confidence scores average <85% over 100 invoices
- Indicates new invoice format or OCR service issue
- Triggers OCR model retraining consideration
Log Retention and Analysis:
- Detailed logs stored for 90 days in OutSystems database
- Key metrics: Invoice ID, processing time, match result, variance amounts, routing decision
- Weekly reports generated showing:
- Top 10 suppliers by exception rate
- Most common exception types
- Average processing time trends
- Cost savings calculation (hours saved vs manual processing)
Log Review Process:
- Daily: Automated report of failed transactions (reviewed by RPA support)
- Weekly: Exception pattern analysis (reviewed by AP manager)
- Monthly: Comprehensive performance review (includes ROI calculation)
Implementation Tips:
- Start with a pilot covering 20% of invoice volume (single supplier or department)
- Run parallel processing for first month (bot + manual) to validate accuracy
- Tune tolerance thresholds based on actual variance patterns in your data
- Build configurable business rules table so AP team can adjust without developer involvement
- Include supplier feedback loop - notify suppliers of common issues causing exceptions
- Document bot logic thoroughly - future maintenance will be easier
Results After 6 Months:
- 2,200 of 2,500 monthly invoices auto-processed (88% automation rate)
- Average processing time per invoice: 3.5 minutes (vs 45 minutes manual)
- Exception resolution time: 4.2 hours average (vs 24 hours previously)
- AP team FTE requirement reduced from 3.0 to 1.5
- Error rate (incorrect payments): Decreased from 2.3% to 0.4%
- Supplier satisfaction improved due to faster payment cycle
- Estimated annual savings: $180K in labor costs + $25K in early payment discounts captured
The key success factors were: thorough business rule documentation, phased rollout, comprehensive monitoring from day one, and close collaboration between AP team and RPA developers to continuously refine the matching logic.
This is exactly what we need! We’re drowning in manual invoice processing. Can you share more about how you handle different invoice formats? Do you use OCR, or does the bot extract data directly from PDFs? Also, what’s your tolerance threshold for price variances before it routes to manual review?