Document Intelligence
Get Started
Test drive worker agent
Test Worker Agent Business Processing

Test Worker Agent Business Processing

After validating document integrity, Worker Agents execute business-specific processing logic. This phase involves applying business rules, integrating with external systems, and managing processing outcomes. Let's test both successful and discrepancy scenarios to ensure robust business processing.

Business Processing Phase
Business Processing Phase

Unlike validation testing which focuses on document integrity, business processing testing verifies:

  • Business rule application
  • External system integration
  • Discrepancy handling
  • User collaboration triggers

Testing Successful Processing

In the previous page, we validated the Eco-Green Growth Ltd - Wire Transfer - RC1.pdf document. Let's analyze its reconciliation processing results:

Reconciliation Report
Reconciliation Report

Understanding Multi-Level Analysis

The reconciliation report demonstrates a critical pattern for financial processing agents - hierarchical analysis:

Multi-level reconciliation enables both efficient verification and precise discrepancy detection. By analyzing at progressively granular levels (total → group → individual), agents can pinpoint exactly where issues occur while giving users natural verification paths.

The hierarchical analysis pattern serves two key purposes:

This hierarchical approach enables a "trust but verify" model where users can efficiently validate agent findings as they build confidence in the agent's capabilities. By providing clear verification paths through progressive levels of detail, agents help users transition from verification to reliance.

Implementation Through Actions

All arithmetic operations and comparisons are performed within actions, not by the LLM, ensuring deterministic and accurate results. The LLM orchestrates the process while actions handle precision-critical operations.

Testing Discrepancy Handling

Let's examine how the agent handles payment discrepancies:

Create Discrepancy Work Item
Create Discrepancy Work Item
  1. Select "Create Work Item"
  2. Choose VerticalAG Innovation - Wire Transfer - RC2.pdf
  3. Click "Create" to process
Discrepancy Reconciliation Report
Discrepancy Reconciliation Report

The discrepancy report demonstrates how the hierarchical analysis pinpoints issues:

# Reconciliation Report
Status: DISCREPANCY_FOUND
Total Discrepancy: $18,197.95
 
## Facility Level Discrepancies
❌ Greenhouse Complexes
- Remittance: $900,798.13
- AR System: $918,996.08
- Difference: -$18,197.95

Business Processing Outcomes and Work Item States

Worker Agents map business processing outcomes to specific work item states through Document Intelligence:

Processing OutcomeBusiness MeaningWork Item StateUser Action Required
SUCCESSRemittance document reconciled successfullyCOMPLETED (Terminal state)None - Agent has autonomously completed processing
FAILUREPayment amounts don't match AR recordsREQUIRES_USER_COLLABORATIONAccess Work Room to investigate discrepancy with agent assistance. Agent provides full context for expected business exception (e.g., payment discrepancy)
ERRORUnexpected reconciliation process errorFAILEDAccess Work Room to troubleshoot with agent. Agent provides context for unexpected system exception requiring root cause analysis

Example state transition for successful processing:

di_client.work_items_complete_stage(
    remittance_id,
    "SUCCESS",                                  # Processing outcome
    "All payment amounts successfully matched",  # Outcome reason
    reconciliation_report                       # Detailed report
)

This mapping between business outcomes and work item states is a common pattern across Worker Agents. It ensures:

  • Clear communication of processing results
  • Appropriate next steps based on outcome
  • Proper handling of both expected and unexpected exceptions
  • Clear guidance on required user actions

Best Practices for Business Processing

Next Steps

Continue to Test User-Agent Collaboration to learn how agents intelligently engage human expertise when processing requires intervention.

Proper error handling and state management are critical for production deployment. Ensure your agent handles both successful and error scenarios appropriately.