Why Automate This?
The Problem: Documents arrive in bulk — scanned invoices from vendors, receipts submitted by employees, ID copies from customers. Someone has to open each file, read the fields, and key them into a system. They cross-check every entry against vendor lists or PO registers and flag anything that looks wrong. At any volume, this is slow, error-prone, and expensive. A misread invoice number, a vendor not in the system, or a VAT rate that does not match all create downstream problems in finance, compliance, or operations. The Solution: A Duvo agent that reads every document using the Intelligent Document Reader, extracts the fields you need, validates each field against your master data, and routes anything below your confidence threshold or outside your rules to a human reviewer. Clean documents go straight to your system of record. Borderline ones get a human decision before anything is written. Expected Results:- Eliminate manual data entry for clean, well-formatted documents
- Catch extraction errors and validation failures before they reach your system
- Create a full audit trail: what was extracted, what was changed by a reviewer, and why
- Scale document processing without adding headcount
What You’ll Build
By the end of this playbook, you’ll have an agent that:- Reads incoming documents (PDFs, scanned images, or Word files) from a folder, email, or upload
- Extracts structured fields: vendor, invoice number, line items, amounts, dates, tax, and any custom fields you need
- Checks field-level confidence scores and flags anything the extraction was uncertain about
- Cross-validates extracted values against your master data: vendor list, PO register, employee directory, or product catalog
- Handles tax, currency, and formatting edge cases (VAT rates, multi-currency, multi-page documents)
- Routes low-confidence or anomalous documents to a human reviewer with full extraction context
- Writes validated records to your system of record: ERP, spreadsheet, finance system, or database
- Maintains a complete audit trail of every extraction, review decision, and write action
- Intelligent Document Reader — extract text and structured fields from PDFs, Word files, scanned images, and photos
- Email Attachments Reader (if documents arrive by email) — pull attachments from incoming messages
- Your source system — Google Drive, SharePoint, email inbox, or a file upload trigger
- Your target system — NetSuite, SAP, Google Sheets, Salesforce, Dynamics 365, or your ERP
- Human-in-the-Loop — pause for review on low-confidence extractions and validation failures
Before You Start
Make sure you have these ready:- Clean digital PDF invoice
- Scanned image invoice (JPG or PNG)
- Multi-page PDF
- Document with multiple tax rates
- Zero-tax or tax-exempt document
- At least one intentionally imperfect scan (low resolution, skewed, or photographed)
Create Your Agent
- Click ”+ Create Agent” from your dashboard.
- Select “Use Agent Builder”.
Describe Your Workflow
Review Generated AOP
- The document type (invoice, receipt, ID) is correctly named throughout.
- The field list matches what your target system actually requires.
- The validation rules reflect your real business rules — not overly strict (causing too many flags) or too loose (letting bad data through).
- The anomaly routing describes what your reviewers will see and what actions they can take.
Configure Connections
- Intelligent Document Reader — Already available by default; no additional setup required.
- Email Attachments Reader — Already available by default; needed if documents arrive as email attachments.
- Source connection — Gmail or Outlook (if triggered by email), Google Drive or SharePoint (if polling a folder), or leave unset if using manual file upload.
- Target system — The ERP, spreadsheet, or database where validated records land. See My Logins to store your login.
- Human-in-the-Loop — Already available by default.
Set Confidence Thresholds
Cross-Validate Against Master Data
Handle Tax, Currency, and Multi-Page Edge Cases
Configure HITL Review Requests
Test with Sample Documents
- Click “Start Work” to run the agent manually with a test document.
- Cover these test cases:
Write to Your Target System
Expected Results
When your agent is running successfully: In your target system:- A new record for each validated document, with all extracted fields populated and source document reference included.
- No partial or incorrect records — anomalous documents are held for human review before anything is written.
- Pending review requests for each flagged document, with extracted fields, confidence scores, and specific failure reasons clearly described.
- For each document processed: document number, vendor, date, extracted fields, validation outcome (auto-validated or reviewed), reviewer name and corrections (if any), and timestamp.
- A complete session log for each run showing each extraction step, validation check, and write action.
Troubleshooting
Extraction is missing fields or returning wrong values
Extraction is missing fields or returning wrong values
- Scanned quality: Low-resolution scans (below 150 DPI) reduce extraction accuracy. Where possible, request native digital PDFs from vendors rather than scans.
- Complex layouts: Documents with heavy formatting, watermarks, or multi-column tables can confuse extraction. Test your most complex document types and add explicit AOP instructions:
"The vendor name appears in the top-left corner of the first page."— spatial hints improve accuracy. - Non-standard field labels: Some vendors use non-standard labels (“Bill-to Party” instead of “Vendor Name”). Update your AOP to list the alternative labels your documents use.
- Multi-page line items: If line items spanning multiple pages are only partially extracted, add:
"Read all pages before extracting line items. Line items continue until the subtotal row."
Too many documents are going to human review
Too many documents are going to human review
- Confidence threshold too high: Lower your threshold and re-run your test set to see the effect. A threshold of 85% is a reasonable starting point for most typed PDFs; scanned documents may need 75%.
- Validation rules too strict: Check which rule is generating the most flags. Common culprits: vendor name matching (names differ slightly between document and master data), date format expectations, or amount ranges set too narrow for the actual data.
- Vendor name normalization: Add a normalization step to your AOP:
"Trim whitespace, remove punctuation, and convert to title case before looking up the vendor name."This handles “ACME CORP.”, “Acme Corp”, and “Acme Corp.” as the same vendor.
Records are written with wrong values
Records are written with wrong values
- Review: confidence threshold too low: If low-confidence fields are passing through undetected, increase your threshold and/or raise the lower bound below which fields are treated as missing.
- Math check not firing: Confirm your AOP explicitly instructs the agent to verify totals. Add a separate validation step:
"After extracting all amounts, verify: total = subtotal + tax. If not, flag the specific discrepancy."
Duplicate detection is generating false positives
Duplicate detection is generating false positives
- Blanket/standing invoices: Some vendors send monthly invoices with the same base reference number. Add an exception:
"Treat document numbers ending in -YYYY-MM as recurring monthly invoices; do not flag these as duplicates." - Reused document numbers across vendors: Narrow the duplicate check to same vendor + same document number rather than document number alone.
Agent processing stalls or stops mid-run
Agent processing stalls or stops mid-run
- Session log: Open the run in Duvo and check the session log for timeout or connection errors. The log shows exactly which step the agent stopped at.
- Source permissions: Verify the source folder or inbox is still accessible and that the connected login has not expired. Re-authorize the connection if needed.
- Requests: Check Requests for any pending Human-in-the-Loop requests that may be holding up the run.
Records validated but not written to target system
Records validated but not written to target system
- Write permissions: Confirm the login used for the target system has create/write access, not just read.
- API rate limits: If processing a large backlog, your target system may be throttling writes. Add a pause between writes in your AOP:
"Wait 2 seconds between each record creation." - Schema mismatch: Your target system may reject records missing required fields. Identify which fields are mandatory and add them to the extraction and validation steps so documents are flagged before a write is attempted.