RPA bot fails to complete invoice processing when unexpected popup appears

Our RPA bot for automated invoice processing is failing intermittently when the legacy ERP system displays unexpected popup dialogs. The bot successfully handles the normal invoice entry workflow, but when the ERP shows validation warnings or confirmation popups, the bot execution halts and requires manual intervention.

The legacy UI is a thick client application with inconsistent popup behavior - sometimes it asks for confirmation, sometimes it shows warnings that can be dismissed, and occasionally displays error dialogs that require specific responses. The bot’s current popup detection logic only handles the standard confirmation dialog.


// Current popup handling
if popup.exists("Confirm") then
  click button("OK")
end if

The problem is that other popup types aren’t being detected, causing the bot to timeout waiting for the next expected screen element. This is particularly problematic because invoice processing runs overnight in batch mode, so failures aren’t discovered until morning when hundreds of invoices are backed up.

How can we implement more robust exception handling in RPA workflows to deal with unpredictable legacy UI automation scenarios? Need strategies for detecting and handling multiple popup variations without creating brittle automation.

The multi-layered approach makes sense. I’m particularly interested in the timeout recovery strategy - how do you implement that in Appian RPA? Can the bot detect when it’s been waiting too long and automatically trigger recovery actions? Also, is there a way to catalog popup variations programmatically so we can build a comprehensive detection library?

Legacy UI automation is notoriously challenging for exactly this reason. Your popup detection needs to be more generic and fault-tolerant. Instead of checking for specific popup titles, implement a pattern-matching approach that detects any modal dialog based on UI characteristics like window hierarchy or Z-order. Also add timeout handlers that can recognize when the bot is stuck waiting for an element that won’t appear.

Implement a multi-layered exception handling strategy. First layer: comprehensive popup detection covering all known dialog types. Second layer: timeout recovery that takes a screenshot and logs the unexpected state. Third layer: fallback to a safe state by sending escape key or alt-F4 to dismiss unknown dialogs. Document all encountered popup variations and continuously update your detection library.

Your RPA bot needs comprehensive exception handling addressing all three focus areas:

Popup Detection Logic: Replace single-condition popup checking with a hierarchical detection framework that checks for multiple popup indicators:


// Enhanced popup detection
loop until screen.stable() or timeout(30)
  if popup.anyExists() then
    popupType = identifyPopupType()
    handlePopupByType(popupType)
  end if
end loop

Implement identifyPopupType() to check for multiple characteristics: window title patterns (“Confirm”, “Warning”, “Error”, “Validation”), button configurations (OK/Cancel, Yes/No, Retry/Abort), and visual elements like icon types. Use fuzzy matching for text detection since legacy UIs often have inconsistent labeling.

Create a popup catalog as a configuration data structure that maps popup signatures to appropriate responses. This allows you to add new popup types without modifying core bot logic.

Exception Handling in RPA: Implement multi-level error handling throughout your invoice processing workflow:

Level 1 - Step-level handlers: Wrap each UI interaction in timeout protection (3-5 seconds for normal operations, 30 seconds for slow screens).

Level 2 - Workflow-level handlers: If any step fails repeatedly, capture diagnostic information (screenshot, window hierarchy, current field values) and transition to recovery mode.

Level 3 - Process-level handlers: When recovery fails, mark the invoice for manual review, log detailed error context, and continue with next invoice rather than halting entire batch.

Use Appian’s RPA error handling blocks to catch exceptions and route to appropriate recovery subroutines. Implement a “safe state” recovery that attempts to return to the main menu before processing the next item.

Legacy UI Automation: Legacy thick clients require defensive automation techniques:

  • Add wait-for-idle checks before each interaction to ensure UI is ready
  • Implement retry logic with exponential backoff for transient failures
  • Use keyboard navigation (Tab, Enter, Escape) as fallback when mouse clicks fail
  • Capture baseline screenshots of expected states for visual comparison
  • Monitor CPU and memory usage of legacy application to detect hung states

For your overnight batch processing, implement a monitoring dashboard that tracks bot progress in real-time. Configure alerts when the bot encounters repeated failures or exceeds expected processing time per invoice.

Add a “learning mode” that logs all encountered popups with screenshots during initial deployment, then use this data to build your comprehensive popup handling library. Review logs weekly to identify new patterns and update detection logic accordingly.

This approach transforms brittle single-path automation into resilient, self-recovering RPA that handles legacy UI unpredictability while maintaining high straight-through processing rates.