AI-Powered OffboardCare — Project Story

Inspiration

Every separation is a deeply human moment — but the systems around it are anything but human.

When an employee is laid off, made redundant, or even chooses to retire after decades of service, they are handed a stack of paperwork, a list of acronyms they barely understand, and a set of deadlines that are simultaneously urgent and invisible. COBRA. OWBPA. FSA forfeiture. 401(k) rollover windows.

Miss the COBRA election by a single day and your family loses health coverage — permanently. Forget to initiate the 401(k) rollover within 60 days and face a 10% early withdrawal penalty. Let the life insurance conversion window close and you may never qualify for individual coverage again due to health conditions.

We were inspired by a simple but powerful question:

"What if the system looked out for the employee the moment separation happened — automatically, intelligently, and with a human safety net?"

That question became AI-Powered OffboardCare.

We chose the insurance domain because post-separation benefits sit at the intersection of regulatory compliance, human emotion, and operational complexity — a perfect arena for intelligent automation. And we chose UiPath because Maestro, Coded Agents, and Coded Apps gave us exactly the orchestration primitives we needed to build something that feels genuinely production-ready, not just a demo.


What We Built

OffboardCare is an end-to-end intelligent benefits continuity platform built on the Dispatcher–Performer pattern, orchestrated entirely by UiPath Maestro, with full exception handling, JIRA-based audit trails, and a queue-driven traceability model.

Architecture at a glance

Employee Email (signed PDF)
        ↓
[DISPATCHER — RPA]
  • Monitor inbox: offboard@company.com
  • Download PDF attachment
  • Create Queue item per request
  • Log JIRA ticket — Status: Open
        ↓
[QUEUE — UiPath Orchestrator]
        ↓
[PERFORMER COMPONENTS — Maestro orchestrated]

  Read Transaction      → RPA
  Document Validation   → Coded Agent (GateKeeper)
  COBRA Eligibility     → Coded Agent (GateKeeper)
  COBRA Review App      → Coded App (Human in the Loop)
  JIRA Update           → API Workflow
  Complete Transaction  → RPA
  Close Request         → RPA
  Form Submission       → RPA (carrier website)

The GateKeeper Agent — eligibility mathematics

At the heart of the system is GateKeeper, our UiPath Coded Agent powered by Claude claude-sonnet-4-6 and LangChain SDK. It reads the signed separation document, cross-references it against the COBRA eligibility rules document and benefits policy PDF using RAG (Retrieval-Augmented Generation), and evaluates 8 sequential eligibility gates.

COBRA eligibility decision logic:

$$ \text{COBRA eligible} = \bigcap_{i=1}^{8} G_i $$

where each gate $G_i$ is a binary predicate evaluated in sequence:

$$ G_1: \text{reason} \in {\text{LAYOFF, REDUNDANCY, RESIGN, RETIRE, MUTUAL, CONTRACT, PERFORMANCE}} $$

$$ G_4: \text{reason} \notin {\text{GROSS_MISCONDUCT}} \quad \text{(reversed logic)} $$

$$ G_6: \text{today} \leq \max(\text{coverage_loss_date},\ \text{notice_date}) + 60\ \text{days} $$

COBRA premium calculation:

$$ P_{\text{COBRA}} = P_{\text{group}} \times 1.02 $$

where $P_{\text{group}}$ is the combined employer + employee group premium and the $1.02$ factor includes the 2% administrative fee permitted under 29 U.S.C. § 1162(3).

Severance entitlement formula:

$$ S = \begin{cases} 2\ \text{weeks} & \text{if}\ y < 2 \ \lfloor y \times 1.5 \rfloor\ \text{weeks} & \text{if}\ 2 \leq y < 10 \ \min(\lfloor y \times 2 \rfloor,\ 26)\ \text{weeks} & \text{if}\ y \geq 10 \end{cases} $$

where $y$ = years of service and $S$ is capped at 26 weeks.

Coverage duration assignment:

$$ D_{\max} = \begin{cases} 18\ \text{months} & \text{termination or reduction in hours} \ 29\ \text{months} & \text{SSA disability within first 60 days} \ 36\ \text{months} & \text{death, divorce, Medicare, or dependent loss} \end{cases} $$

Document validation — 9-rule sequential gate

Before eligibility is even evaluated, the Document Validation Coded Agent runs 9 rules on the signed PDF submitted by the employee:

Rule Check Fail code
R1 File format — valid PDF, 10 KB–20 MB VAL_001_FILE_FORMAT
R2 Readable content — not blank or corrupt VAL_002_UNREADABLE
R3 Mandatory fields — name, ID, date, reason, signature VAL_003_MISSING_FIELDS
R4 Signature present and dated VAL_004_NO_SIGNATURE
R5 Signature date logic — not future, not > 90 days before separation VAL_005_SIGNATURE_DATE_INVALID
R6 Separation date — valid, not future, not > 180 days old VAL_006_INVALID_DATE
R7 Employee ID format — matches ^EMP-\d{5}$ VAL_007_INVALID_EMPLOYEE_ID
R8 Duplicate check — no active JIRA case for same employee VAL_008_DUPLICATE_CASE
R9 Separation reason — maps to approved category code VAL_009_UNKNOWN_REASON

The agent uses a fail-fast strategy — stops at the first failure and sends a precise, field-specific automated reply to the employee. All 9 rules are logged to the JIRA ticket regardless.

JIRA lifecycle — API workflow

Every separation request has a JIRA ticket that progresses through a defined status lifecycle:

$$ \text{Open} \xrightarrow{\text{extraction}} \text{In Progress} \xrightarrow{\text{validation}} \text{On Hold}\ \text{or}\ \text{In Progress} \xrightarrow{\text{eligibility}} \text{Approved / Rejected} \xrightarrow{\text{submission}} \text{Resolved} $$

The JIRA update step is implemented as a UiPath API Workflow — a clean separation of concerns between the RPA orchestration layer and the integration layer.


How We Built It

Phase 1 — Data foundation (Hours 0–3)

We started by defining the separation data schema and building the context documents that the AI agents would reason over:

  • Employee Separation Record — a structured PDF with 7 sections mirroring what a real HRIS system produces
  • Post-Separation Benefits Policy — a comprehensive PDF covering COBRA rules, severance tiers, 401(k) vesting, life insurance conversion, and FSA deadlines
  • COBRA Eligibility Context Document — a Markdown rules document with all 8 gates, premium rate tables, and output schemas
  • Rules Excel File — severance calculation tiers and COBRA rate tables for deterministic lookups

We built 8 sample input documents covering every scenario: layoff, redundancy, voluntary resignation, retirement, mutual agreement, stale date (validation fail), missing signature (validation fail), and gross misconduct (COBRA ineligible).

Phase 2 — RPA dispatcher and queue (Hours 3–6)

The Dispatcher was built as a UiPath RPA workflow that monitors a dedicated inbox (offboard@company.com), extracts the PDF attachment from each incoming email, creates a queue item in UiPath Orchestrator with the file name and metadata, and logs an initial JIRA ticket via the API workflow.

The queue item carries: employee_email, file_name, received_at, jira_ticket_id, and submission_source.

Phase 3 — Coded Agents (Hours 6–10)

Document Validation Agent was built as a UiPath Coded Agent in Python, calling Claude claude-sonnet-4-6 via the Anthropic API. It reads the PDF using UiPath IXP (Intelligent Document Processing), extracts structured fields, and runs all 9 validation rules. The output is a typed ValidationResult JSON object passed to Maestro.

GateKeeper (COBRA Eligibility Agent) was built as a second Coded Agent. It uses LangChain SDK with FAISS vector store to perform RAG over the benefits policy PDF and COBRA context document. The agent is prompted to:

  1. Extract all employee fields from the validated JSON
  2. Run all 8 COBRA gates sequentially, citing the source document section for each decision
  3. Calculate exact premiums per plan using the rate table
  4. Return a structured JSON with covered benefits, uncovered benefits, deadlines, and JIRA action

We used LangGraph to manage the agentic flow — the graph ensures that gate evaluation is sequential and that escalation decisions are explicit state transitions, not implicit fallbacks.

Phase 4 — Coded App (HITL) (Hours 10–13)

The COBRA Review App was built as a UiPath Coded App — the Human-in-the-Loop interface for HR adjusters. It displays:

  • The original signed PDF alongside the extracted employee record
  • GateKeeper's 8-gate eligibility summary with each gate's result and source citation
  • Calculated COBRA premiums per plan with exact deadlines
  • Any soft warnings or field confidence flags from the validation agent
  • Three action buttons: Approve, Modify + Approve, or Reject (with mandatory reason code)

The adjuster's decision is posted back to Maestro as a workflow variable, which then routes to the appropriate next step: RPA form submission (approve) or employee notification (reject).

Phase 5 — Form submission and closure (Hours 13–16)

On approval, an RPA bot navigates to the insurance carrier's web portal, fills the COBRA election form using the employee's approved benefits data, submits it, and captures the confirmation reference number. A second bot updates the JIRA ticket to Resolved and attaches the full audit log. A third bot sends the employee a personalised notification email with their benefits summary, premium amounts, and all key deadlines.

The LangChain-powered chatbot (RAG over policy documents + employee record) is activated at this point, allowing the employee to ask follow-up questions and receive personalised, deadline-aware answers.


Challenges We Faced

1. Orchestrating across heterogeneous components

Getting Maestro to reliably coordinate between RPA bots, two Coded Agents, a Coded App, an API workflow, and a LangChain chatbot required careful state management. We designed a clean event-driven handoff schema — each component consumes a typed input contract and produces a typed output contract, with Maestro managing the routing logic. Failures in one component do not silently drop cases; they route to the exception handler, which logs to JIRA and alerts the operations team.

2. RAG accuracy on dense policy documents

Benefits policy documents are written in legal language with deeply nested conditional clauses. Naive chunking produced poor retrieval results — the model would find a paragraph about COBRA but miss the specific rate table it needed.

We solved this by implementing semantic chunking with overlap and metadata tagging by benefit type (MEDICAL, DENTAL, COBRA_RATE, SEVERANCE_TIER). Retrieval precision improved significantly once the vector store could filter by benefit type before running similarity search.

3. Knowing when to escalate vs auto-decide

Designing the escalation trigger for the HITL step was harder than expected. A purely confidence-based threshold caused too many false positives — routing straightforward layoff cases to the HR adjuster unnecessarily.

We ended up combining LLM confidence scoring with a rule-based overlay: specific field combinations (tenure dispute + disability flag, gross misconduct + employee contest, separation date in a different calendar year from submission) always trigger HITL regardless of model confidence. This reduced false escalations by approximately 70% in our test dataset.

4. Prompt engineering for deterministic JSON output

Getting Claude to return pure JSON (no preamble, no markdown fences, no explanation text) consistently across all document types required careful prompt design. The solution was:

  • System prompt explicitly sets the agent's identity and output contract
  • User prompt ends with: "Return ONLY a pure JSON object. No text before or after."
  • Post-processing strips any accidental fences before json.loads()
  • A fallback re-prompt is triggered if the first response fails JSON parsing

5. Audit trail completeness under exception conditions

Insurance and HR processes are heavily regulated. Every automated decision needed a traceable record — including decisions made during failure paths. We built structured logging into every Maestro transition, capturing: component name, decision output, timestamp, input hash, and reviewer ID (for HITL steps). This ensures that even if a case fails at Step 3, the JIRA ticket has a complete record of what was attempted, what failed, and why.


What We Learned

RPA + AI is a genuine force multiplier. RPA handles the brittle, UI-dependent extraction work that LLMs cannot reliably do. AI handles the reasoning and conversation that RPA cannot do. Together they cover the full workflow without gaps.

Human oversight is not a fallback — it is a feature. Regulated industries like insurance require a human in the loop for high-stakes decisions. Designing HITL as a first-class component from day one, rather than an afterthought, made the system more trustworthy, more auditable, and more deployable in a real enterprise.

Prompt design for RAG is an engineering discipline. The difference between a useful chatbot and a hallucinating one came down to how we chunked documents, what metadata we attached, and how we structured the retrieval prompt. Small changes in chunking strategy had large effects on answer accuracy.

Maestro changes how you think about orchestration. Being able to visually design and monitor the workflow in Maestro made debugging dramatically faster. We could see exactly where in the pipeline a case was stuck, which component had failed, and what the input/output state was at each step.

LangGraph is the right abstraction for multi-step agentic flows. Using LangGraph to define the eligibility evaluation as an explicit state machine — rather than a chain of prompts — made the agent's behaviour predictable, testable, and debuggable. Each gate is a node; each routing decision is an edge; the graph is the specification.


What's Next

  • Multi-jurisdiction COBRA — extend GateKeeper to cover state mini-COBRA laws (Cal-COBRA, NY mini-COBRA) for employees in states with smaller employers
  • Proactive deadline reminders — scheduled RPA jobs to send reminders at $t - 30$, $t - 14$, and $t - 7$ days before each benefits deadline
  • Analytics dashboard — cohort-level view of separation patterns, COBRA election rates, HITL escalation frequency, and processing time per case
  • Real carrier API integration — replace portal RPA with direct REST API calls where carriers support it, reducing form-fill time from minutes to seconds
  • Multi-language support — extend the LangChain chatbot to handle employee queries in Spanish, French, and Mandarin using Claude's multilingual capabilities

Tech Stack

Component Technology
Orchestration UiPath Maestro
Dispatcher UiPath RPA
Document extraction UiPath LangChain SDK
Document validation UiPath Coded Agent (Python + Claude claude-sonnet-4-6)
COBRA eligibility UiPath Coded Agent + LangChain + LangGraph + RAG
Human in the Loop UiPath Coded App (Action Center)
JIRA integration UiPath API Workflow
Form submission UiPath RPA
Employee chatbot LangChain SDK + RAG + Claude claude-sonnet-4-6
Queue & assets UiPath Orchestrator
Storage Cloud Storage (input + context buckets)
Language Python

Built with ❤️ by Team ClearPath Collective

"Your benefits don't stop when your job does. OffboardCare makes sure of it."

Built With

  • api-workflow
  • claude-code
  • codedautomation
  • coding-agent
  • langchain
  • maestro
  • rag
  • rpa
  • uipath
  • uipath-skill
Share this project:

Updates