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.

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:

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:

- Select "Create Work Item"
- Choose
VerticalAG Innovation - Wire Transfer - RC2.pdf
- Click "Create" to process

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 Outcome | Business Meaning | Work Item State | User Action Required |
---|---|---|---|
SUCCESS | Remittance document reconciled successfully | COMPLETED (Terminal state) | None - Agent has autonomously completed processing |
FAILURE | Payment amounts don't match AR records | REQUIRES_USER_COLLABORATION | Access Work Room to investigate discrepancy with agent assistance. Agent provides full context for expected business exception (e.g., payment discrepancy) |
ERROR | Unexpected reconciliation process error | FAILED | Access 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.