# Business Flow

This document illustrates the business flow for the Digital Employee **Quality-of-Hire Analyst** system. The workflow covers how a user requests quality-of-hire insights (by university/education and prior experience) and how the DE clarifies parameters, retrieves HRIS-only data from CATAPA, computes retention and performance proxy metrics, and returns ranked segment outputs with coverage notes.

The process begins when the user asks a question such as “Which university produces the best outcomes?” The DE then confirms the **hire cohort time range** (start-date based), the **retention window**, and which **performance proxy method** to use (KPI / promotion proxy / salary proxy, default combined). After retrieving the required datasets from CATAPA HRIS and the KPI custom table, the DE normalizes education and experience dimensions, calculates retention and performance outcomes, and returns a ranked summary table per segment with sample size and data coverage notes. The user can iterate by changing filters, time ranges, or segmentation dimensions.

***

### Flow Description (End-to-End)

```mermaid
flowchart TD
    %% Swimlanes
    subgraph EndUser["End User"]
        A["Request Quality-of-Hire Analysis"]
        B["Receive Ranked Results"]
        C["Adjust Parameters / Filters (Iteration)"]
    end

    subgraph DigitalEmployee["Digital Employee"]
        D["Identify Intent & Output Type"]
        E["Clarify Hire Cohort Time Range"]
        F["Clarify Retention & Performance Metrics"]
        G["Clarify Retention Window"]
        H["Clarify Performance Proxy Method"]
        I["Clarify Scope & Filters"]
        J["Request Data from CATAPA HRIS"]
        K["Normalize Education & Experience"]
        L["Compute Retention & Performance Outcomes"]
        M["Segment, Rank & Package Results"]
        N["Deliver Analysis to User"]
    end

    subgraph CATAPA["CATAPA HRIS Data Provider"]
        O["Provide HRIS Data"]
    end

    %% Vertical main flow
    A --> D
    D --> E
    E --> F
    F --> G
    G --> H
    H --> I
    I --> J
    J --> O
    O --> K
    K --> L
    L --> M
    M --> N
    N --> B
    B --> C
    C -->|"Updated Parameters"| E

    %% Styling
    style EndUser fill:#e1f5ff,stroke:#000,color:#000
    style DigitalEmployee fill:#f3e5f5,stroke:#000,color:#000
    style CATAPA fill:#e8f5e9,stroke:#000,color:#000
     linkStyle default stroke:#1f77b4,stroke-width:1.5px;
```

1. **User Request**\
   User requests quality-of-hire analysis (e.g., “Which university produces the best outcomes?” / “How many hires joined from Campus A?”).
2. **Intent & Output Type Identification**\
   DE identifies whether the user wants:
   * Ranked analysis (best/worst segments), or
   * Count-only output (how many hires from X), or
   * Both.
3. **Hire Cohort Time Range Clarification (Start Date Based)**\
   DE checks whether a time range is provided for hires.
   1. Smallest: 6 months.
   2. Largest: 5 years.\
      If missing, DE uses the default last 1 year and states it.
4. **Metric Clarification: Retention / Performance**\
   DE determines whether the user wants:
   1. Performance only, retention only, or both (default both).
5. **Retention Window Clarification**\
   DE determines retention window: 90/180/365 days (default 180 days).
6. **Performance Definition Clarification (Proxy Method Selection)**\
   DE determines which performance method to use:
   1. KPI custom table metric, and/or
   2. Promotion history proxy, and/or
   3. Salary increase proxy.\
      If not specified, default = all combined and state it.
7. **Scope & Filters Clarification (Optional)**\
   DE checks for optional filters if mentioned or needed: job title/level, location, company/legal entity, and “experience” definition (years band vs last industry vs last role family).\
   If “experience” is ambiguous, DE asks; default = “All”.
8. **Data Retrieval (CATAPA HRIS + Custom KPI Table/Data)**\
   DE retrieves cohort and required datasets from CATAPA based on the hire time range and selected metrics:
   * Employee & Employment (current).
   * Hiring data.
   * Employment Data (historical) for promotion events.
   * Termination data (for retention outcome).
   * Education history (historical) + education master data.
   * Job experience history (historical).
   * Salary decree (historical) if salary proxy is selected.
   * Custom KPI data (historical) if the KPI method is selected.
9. **Normalization (Education / Experience Dimensions)**\
   DE normalizes:
   1. Institution name (aliases).
   2. Field of study (aliases).
   3. Education level (aliases).
10. **Computation: Retention**\
    DE computes the retention rate for the selected window (90/180/365 days) for the hire cohort.
11. **Computation: Performance Proxy**\
    DE computes performance using selected methods (or the combined default):
    1. KPI-based average score (1–5) across employee lifetime (per spec).
    2. Promotion proxy (promotion events treated equally; based on Employment Status = “Promotion”).
    3. Salary increase proxy (frequency + magnitude; penalties/deductions worsen if included in your proxy definition).\
       DE produces a coverage note (e.g., KPI data availability %).
12. **Segmentation, Ranking, and Aggregation**\
    DE groups results by requested segmentation(s):
    1. University / degree / major,
    2. Experience (as clarified),
13. **Result Packaging**\
    DE outputs ranked tables/list including:
    1. Segment name, employee count (N), retention rate, performance metric(s).
    2. Coverage/confidence notes (sample size + KPI coverage).
    3. Safe interpretation note: observed outcomes only, not causal claims.
14. **Delivery & Iteration**\
    DE sends the final analysis to the user. The user may iterate (change time range, retention window, segmentation, filters, or performance method), and DE reruns the flow with updated parameters.

***
