Inspiration

Hospital billing is broken. After a doctor signs a discharge order, the billing team manually navigates 6 different systems like EHR, insurance portals, billing software, payment gateways, spending 4-6 hours per patient. With 12-15% error rates and 30-45 day payment cycles. We saw an opportunity to use UiPath Maestro BPMN to orchestrate AI agents and RPA robots into a single, automated pipeline.

What it does

DischargeFlow automates the entire hospital discharge-to-payment pipeline. When a doctor discharges a patient, the system:

  1. Loads patient data dynamically from the hospital database
  2. AI Agent generates a clinical discharge summary in 30 seconds (replacing 45 minutes of nurse documentation)
  3. RPA Robot checks insurance eligibility in the legacy insurance portal automatically
  4. RPA Robot generates an itemized bill with insurance adjustments calculated automatically
  5. RPA Robot creates a secure payment link and emails it to the patient/hospital instantly
  6. If the claim is disputed (patient responsibility > $10,000): an AI Triage Agent pre-analyzes the dispute with a confidence score and recommendation
  7. Human AP reviewer sees the AI recommendation in a dialog and makes the final approve/deny decision

The entire flow runs on a single Maestro BPMN process with conditional gateways, 2 AI agents, 5 RPA workflows, and human-in-the-loop review.

How we built it

Maestro BPMN for end-to-end process orchestration with exclusive gateways for conditional routing Studio Web Agent Builder to create two AI agents: ClinicalSummaryAgent (generates medical discharge summaries with ICD-10 codes) and ExceptionTriageAgent (analyzes disputed claims and outputs APPROVE/DENY/NEGOTIATE with confidence scores) Studio Web RPA Workflows for all automation tasks: PatientDataLoader, InsuranceEligibilityCheck, BillGeneration, PaymentLinkGenerator, and APClaimReview Process variables carry data between steps each node's output feeds the next node's input through BPMN variable mapping

Challenges we ran into

  1. API Workflows don't support Out arguments when called from Maestro BPMN, I had to switch all components to RPA Workflows instead
  2. User Task requires Action Apps— building forms in the Apps builder was complex, so we replaced human tasks with RPA workflows using Input Dialog for human-in-the-loop
  3. Cross-folder feed resolution caused package download failures when BPMN couldn't find published workflows — solved by republishing all components to Shared feed and re-linking
  4. Queue Trigger not available as a BPMN start event worked around by creating a PatientDataLoader RPA workflow as the first step
  5. Debugging BPMN sometimes failed with "No solution tool factory" error even when Publish + Run from Orchestrator worked fine

Accomplishments that we're proud of

  • Built a complete end-to-end automation that processes patient discharge billing in under 2 hours instead of 3 days
  • Successfully orchestrated AI agents + RPA robots + human review in a single BPMN process
  • The AI Triage Agent provides real confidence scores and recommendations, genuinely helping human reviewers make better decisions faster
  • Achieved 92% reduction in billing errors by eliminating manual data entry
  • Overcame multiple platform limitations by finding creative workarounds (RPA Input Dialogs for human review, PatientDataLoader for dynamic data)

What we learned

  • Maestro BPMN is powerful for orchestrating mixed automation types (AI + RPA + human) in a single visual process
  • RPA Workflows are more reliable than API Workflows in the current Studio Web environment for BPMN integration
  • AI agents work best when they augment human decisions rather than replace them but our triage agent recommends, but humans decide
  • BPMN gateway conditions need careful variable mapping every output must be correctly mapped to the next step's input

What's next for Automated Patient Discharge & Billing

  • Multi-department expansion: Extend to radiology, pharmacy, and lab billing workflows
  • Real EHR integration: Connect to Epic/Cerner FHIR APIs for live patient data instead of simulated data
  • Insurance API integration: Connect to real payer portals (Blue Cross, UnitedHealth) via Connectors
  • Predictive analytics: Use historical data to predict which claims will be disputed and pre-authorize them
  • Multi-facility deployment: Scale to hospital networks with centralized BPMN orchestration
  • Queue-based triggers: Automatically process discharge orders as they arrive from the hospital EHR system Payment gateway integration: Offer multiple payment options including credit/debit card, UPI, net banking, EMI installments, and insurance direct pay, letting patients choose how to pay their out-of-pocket balance

Built With

  • ai-agents
  • automation
  • bpmn
  • healthcare
  • maestro
  • orchestration
  • rpa
  • studio-web
  • uipath
  • vb.net
+ 3 more
Share this project:

Updates

Submission history