> ## 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.

# Workflow KPI Dashboard

> Track key business metrics and workflow performance indicators with configurable date ranges and drill-down navigation.

The Workflow KPI Dashboard at `/fw/kpi` displays configured KPI metric cards for the active organization, with date range filtering, drill-down navigation, metric configuration, and scheduled report delivery.

## Overview

The KPI Dashboard fetches configured metric cards via `useKpiDashboard`, scoped to the active organization. The default date range is the last 30 days with weekly period type. Users with `fw.kpi.manage` can add metrics via `KpiConfigDialog` and schedule reports via `KpiScheduleDialog`. Clicking a metric card navigates to a drill-down route defined in `DRILL_DOWN_ROUTES` (e.g., approvals, automations, analytics).

## Who it's for

Requires `fw.kpi.view` permission, enforced by `RequirePermission` in `src/routes/fw.tsx`.

The "Add Metric" and "Schedule Report" actions are additionally gated by `fw.kpi.manage` via `PermissionGate`.

## Before you start

* You must have `fw.kpi.view` to access this page.
* For metric configuration and scheduled reports you additionally need `fw.kpi.manage`.
* An organization must be active for metrics to be scoped correctly.

## Steps

**Viewing metrics:**

1. Navigate to `/fw/kpi`.
2. Review the KPI cards in the grid. Each card shows the metric value and trend.
3. Use the `KpiDateRangeToolbar` to adjust the period type and date range.
4. Click a metric card to navigate to its drill-down route (e.g., `/fw/approvals` for approval metrics).

**Adding a metric (requires `fw.kpi.manage`):**

1. Select "Add Metric" in the page header.
2. Configure the metric type and settings in `KpiConfigDialog`.
3. Save. The new card appears in the grid.

**Scheduling a report (requires `fw.kpi.manage`):**

1. Select "Schedule Report."
2. Configure the schedule in `KpiScheduleDialog`.
3. Save.

**Retrying on error:**
If loading fails, an error card with a "Retry" button is shown. Select it to re-fetch.

## Key concepts

* **Metric type** — One of: `approval_rate`, `approval_cycle_time`, `sla_compliance`, `form_completion_rate`, `automation_throughput`, `automation_success_rate`, `time_saved_estimate`.
* **Period type** — Controls time bucket aggregation (e.g., `weekly`).
* **Drill-down route** — Each metric type maps to a related page for detailed analysis (defined in `DRILL_DOWN_ROUTES`).
* **KPI card** — A configured metric instance; `configId` links the card to its `KpiConfigDialog` configuration.

## Related

<Columns cols={2}>
  <Card title="Forms & Workflow" icon="diagram-project" href="/fw/overview">
    Forms & Workflow core overview.
  </Card>

  <Card title="Governance & parity" icon="scale-balanced" href="/governance/index" />
</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/fw\.tsx
  * src/cores/fw/pages/KpiDashboardPage.tsx
  * src/cores/fw/hooks/useKpiDashboard.ts
  * src/cores/fw/components/kpi/KpiCardGrid.tsx
  * src/cores/fw/components/kpi/KpiConfigDialog.tsx
  * src/cores/fw/types/kpi.ts
</Accordion>
