<!-- [MermaidChart: febba174-7331-4fb4-92b9-84a95ea7b6a8] -->
```mermaid
flowchart TB
    %% Device Layer
    subgraph DEVICE ["Device Channel Layer"]
        DEV1["POS Terminal"]
        DEV2["ATM Device"]
        DEV3["Web Gateway"]
    end

    %% Protocol Layer
    PROTOCOL["Enhanced Protocol<br/>(TCP 8583/8584/8585)"]

    %% Processing Pipeline
    subgraph PIPELINE ["Processor Pipeline System"]
        PARSE["Message Parser"]
        VALIDATE["Validation Processor"]
        ENRICH["Enrichment Processor"]
        ROUTER["Routing Processor<br/>(Dual Mode)"]
    end

    %% Decision Point
    DECISION{"Should use<br/>Async Correlation?"}

    %% AsyncCorrelator System (Phase 2)
    subgraph ASYNC ["AsyncCorrelator System (Phase 2)"]
        direction TB
        
        subgraph MANAGERS ["Correlator Managers"]
            MGR_VISA["Visa Manager<br/>(3 instances)"]
            MGR_MC["MasterCard Manager<br/>(2 instances)"]
        end
        
        subgraph BALANCING ["Load Balancing"]
            LB_RR["Round Robin"]
            LB_LL["Least Loaded"]
            LB_CH["Correlation Hash"]
        end
        
        subgraph INSTANCES ["AsyncCorrelator Instances"]
            CORR_V1["Visa Correlator 1<br/>(Connected)"]
            CORR_V2["Visa Correlator 2<br/>(Processing)"]
            CORR_MC1["MC Correlator 1<br/>(Connected)"]
        end
        
        subgraph STORAGE ["ETS Correlation Tables"]
            ETS_VISA["Visa Correlation Table"]
            ETS_MC["MC Correlation Table"]
        end
    end

    %% Telemetry System
    subgraph TELEMETRY ["Telemetry & Monitoring"]
        TELEM_COLLECTOR["Telemetry Collector"]
        TELEM_STORAGE["Metrics Storage"]
        TELEM_ALERTS["Performance Alerts"]
    end

    %% Synchronous Processing
    SYNC_PROC["Traditional Sync Processing<br/>(Wait for Response)"]

    %% Upstream Networks
    subgraph UPSTREAM ["Upstream Networks"]
        UP_VISA["Visa Network<br/>(High Volume)"]
        UP_MC["MasterCard Network<br/>(High Volume)"]
        UP_GENERIC["Generic Processor<br/>(Low Volume)"]
    end

    %% Response Processing
    CALLBACK_HANDLER["Async Callback Handler"]
    RESPONSE_PIPELINE["Response Pipeline"]

    %% Main Flow
    DEVICE --> PROTOCOL
    PROTOCOL --> PARSE
    PARSE --> VALIDATE
    VALIDATE --> ENRICH
    ENRICH --> ROUTER
    ROUTER --> DECISION

    %% Decision Branches
    DECISION -->|"Yes - High Volume"| MANAGERS
    DECISION -->|"No - Low Volume/Test"| SYNC_PROC

    %% Async Path
    MANAGERS --> BALANCING
    BALANCING --> INSTANCES
    INSTANCES --> STORAGE

    %% Correlators to Upstream
    CORR_V1 -.->|"Async Request"| UP_VISA
    CORR_V2 -.->|"Async Request"| UP_VISA
    CORR_MC1 -.->|"Async Request"| UP_MC

    %% Sync Path
    SYNC_PROC -->|"Sync Request"| UP_GENERIC

    %% Response Flows
    UP_VISA -.->|"Async Response"| CORR_V1
    UP_VISA -.->|"Async Response"| CORR_V2
    UP_MC -.->|"Async Response"| CORR_MC1
    UP_GENERIC -->|"Sync Response"| RESPONSE_PIPELINE

    %% Async Response Processing
    CORR_V1 --> CALLBACK_HANDLER
    CORR_V2 --> CALLBACK_HANDLER
    CORR_MC1 --> CALLBACK_HANDLER
    CALLBACK_HANDLER --> RESPONSE_PIPELINE

    %% Response back to devices
    RESPONSE_PIPELINE --> PROTOCOL

    %% Telemetry Integration
    ROUTER -.-> TELEM_COLLECTOR
    MANAGERS -.-> TELEM_COLLECTOR
    INSTANCES -.-> TELEM_COLLECTOR
    TELEM_COLLECTOR --> TELEM_STORAGE
    TELEM_COLLECTOR --> TELEM_ALERTS

    %% Pipeline State Annotations
    ROUTER -.->|"Pipeline HALTED<br/>(Await Async Callback)"| CALLBACK_HANDLER
    SYNC_PROC -.->|"Continue Sync Processing"| RESPONSE_PIPELINE

    %% Styling
    classDef deviceClass fill:#e1f5fe,stroke:#01579b,stroke-width:2px
    classDef pipelineClass fill:#e8f5e8,stroke:#1b5e20,stroke-width:2px
    classDef asyncClass fill:#fff3e0,stroke:#e65100,stroke-width:3px
    classDef telemetryClass fill:#fce4ec,stroke:#880e4f,stroke-width:2px
    classDef syncClass fill:#f1f8e9,stroke:#33691e,stroke-width:2px
    classDef upstreamClass fill:#e3f2fd,stroke:#0d47a1,stroke-width:2px
    classDef decisionClass fill:#ffebee,stroke:#c62828,stroke-width:3px

    class DEV1,DEV2,DEV3,PROTOCOL deviceClass
    class PARSE,VALIDATE,ENRICH,ROUTER,RESPONSE_PIPELINE pipelineClass
    class MGR_VISA,MGR_MC,LB_RR,LB_LL,LB_CH,CORR_V1,CORR_V2,CORR_MC1,ETS_VISA,ETS_MC,CALLBACK_HANDLER asyncClass
    class TELEM_COLLECTOR,TELEM_STORAGE,TELEM_ALERTS telemetryClass
    class SYNC_PROC syncClass
    class UP_VISA,UP_MC,UP_GENERIC upstreamClass
    class DECISION decisionClass
```