> ## Documentation Index
> Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Portal Automation

> Configure, run, and monitor RPA bots that automate payer portal interactions, with tabs for bot management, execution monitoring, and staged documents.

The Portal Automation page (`/pm/portal-automation`) is a tabbed hub for managing robotic process automation (RPA) bots that interact with payer portals on behalf of billing staff.

## Overview

The page presents three tabs — Bots, Monitoring, and Staged Documents — each loaded lazily. The active tab is persisted in the URL via a `tab` query parameter. The Bots tab (`RpaBotListPage`) shows a toggle between "My Bots" and "Templates" views; users with `pm.rpa-bots.admin` can create or clone bots via the `RpaBotConfigDialog`. The Monitoring tab (`RpaMonitoringPage`) shows KPI dashboard cards and an execution history table; clicking a row opens `RpaExecutionDetailSheet` for error and log detail. The Staged Documents tab (`RpaStagedDocsPage`) shows a filterable table of documents retrieved by bots that are waiting for review.

## Who it's for

Requires permission: `pm.rpa-bots.view` (inline string guard in route)

Creating or editing bots additionally requires: `pm.rpa-bots.admin`

## Before you start

* Your account must have the `pm.rpa-bots.view` permission to access the page.
* Bot creation and editing requires `pm.rpa-bots.admin`.
* At least one bot must be configured before the Monitoring tab will show execution history.

## Steps

<Steps>
  <Step title="Navigate to Portal Automation">
    Go to `/pm/portal-automation`. The page opens on the Bots tab by default (or the tab stored in the URL `?tab=` parameter).
  </Step>

  <Step title="Review existing bots (Bots tab)">
    The Bots tab defaults to "My Bots" view showing the configured bots table. Switch to "Templates" to browse available bot templates.
  </Step>

  <Step title="Create a new bot (requires pm.rpa-bots.admin)">
    On the Bots tab in "My Bots" view, click "Create Bot". Fill in the `RpaBotConfigDialog` and submit. Alternatively, switch to "Templates" and click the clone action on a template to pre-populate the dialog.
  </Step>

  <Step title="Monitor bot executions (Monitoring tab)">
    Click the "Monitoring" tab to see KPI dashboard cards and the execution history table. Click any row to open the execution detail sheet showing logs and error information.
  </Step>

  <Step title="Review staged documents (Staged Documents tab)">
    Click the "Staged Documents" tab to see documents retrieved by bots. Use the status filter tabs (All, Pending, Completed, Duplicate) to narrow the list.
  </Step>
</Steps>

## Key concepts

<Tooltip tip="Robotic Process Automation — software that automates repetitive browser-based interactions with external web portals.">RPA</Tooltip>

<AccordionGroup>
  <Accordion title="Bot configuration">
    Each bot (`RpaBotConfiguration`) defines the target payer portal, the automation task, and any credentials or parameters needed. Configuration is managed via `RpaBotConfigDialog`.
  </Accordion>

  <Accordion title="Bot execution">
    A bot execution (`RpaBotExecution`) is a single run of a bot. The Monitoring tab records each execution's status, start time, and any errors. The detail sheet surfaces logs for failed runs.
  </Accordion>

  <Accordion title="Staged documents">
    Documents retrieved from payer portals by bots are held in a staged queue pending staff review before they are imported into the system.
  </Accordion>

  <Accordion title="Tab URL state">
    The active tab is stored as `?tab=bots`, `?tab=monitoring`, or `?tab=staged-documents` in the URL, so the correct tab is restored on page reload or when sharing a link.
  </Accordion>
</AccordionGroup>

## Related

<Columns cols={2}>
  <Card title="Practice Management" icon="briefcase" href="/pm/overview">
    Overview of the Practice Management core.
  </Card>

  <Card title="Governance & parity" icon="scale-balanced" href="/governance/index">
    Documentation coverage and governance.
  </Card>
</Columns>

<Note>
  This page documents shipped product behavior. It is not medical, legal, or
  billing advice. Verify against your organization's policies and applicable
  regulations before using it for clinical, compliance, or billing decisions.
  Protected health information (PHI) shown in the product is governed by your
  tenant's access controls and is never exposed in this documentation.
</Note>

<Accordion title="Documentation sources">
  * src/routes/pm.tsx
  * src/cores/pm/pages/rpa/RpaPortalAutomationPage.tsx
  * src/cores/pm/pages/rpa/RpaBotListPage.tsx
  * src/cores/pm/pages/rpa/RpaMonitoringPage.tsx
  * src/cores/pm/pages/rpa/RpaStagedDocsPage.tsx
</Accordion>
