# open-rpa/openrpa architecture

> Architecture diagram of the GitHub repository open-rpa/openrpa, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/open-rpa/openrpa
- Repository: https://github.com/open-rpa/openrpa

## Overview

##### Project type and purpose
- OpenRPA is a full-stack, plugin-driven desktop application for Robotic Process Automation (RPA).
- The core is a WPF/.NET client (“OpenRPA” folder) that provides a visual workflow designer and runtime.
- It dynamically loads many plugin modules (e.g., OpenRPA.Image, OpenRPA.IE, OpenRPA.SAP, etc.) to support different automation targets.
- There are companion services and integration layers:
– OpenRPA.Net (messaging library for backend communication)
– Named-Pipe wrapper and NativeMessaging host for browser integration
– RDService Windows service for unattended robot sessions
– JavaBridge/SAPBridge/TerminalEmulator for specialized app hooks
– PowerShell (OpenRPA.PS) and Node-RED connectors

##### File structure
- Top-level “OpenRPA” solution (.sln) contains:
– OpenRPA.Interfaces: shared interfaces (IPlugin, IDetector, IActivity, IPC services)
– OpenRPA (core WPF client)
– Per-domain plugin projects (OpenRPA.Image, OpenRPA.Database, OpenRPA.IE, …)
– Infrastructure libraries (OpenRPA.Net, OpenRPA.NamedPipeWrapper)
– External host processes (NativeMessagingHost, RDService, JavaBridge)
– Setup projects (WiX installers under OpenRPA.SetupProject & SetupActions)
– Docs and deployment manifests (docs/, manifests/, winget, chocolatey)

##### Supplementary README insights
- Emphasizes desktop installer, community docs, and “OpenFlow” backend for multi-robot orchestration.
- Mentions commercial support and links to the OpenFlow service (the server-side orchestration engine).

a. Main components
1. Desktop client (WPF UI + core runtime)
2. Plugin loader & runtime host
3. Plugin modules (Image, IE, SAP, Terminal, Database, Office, Script, Utilities, etc.)
4. Shared interface layer (OpenRPA.Interfaces)
5. IPC & integration layers:
– Named-Pipe wrapper
– NativeMessagingHost (browser extensions)
– JavaBridge and SAPBridge host processes
– RDService (Windows service for unattended mode)
6. Messaging & backend communication (OpenRPA.Net over WebSocket/REST to OpenFlow)
7. Local storage providers (Filesystem, LiteDB)
8. Installer & configuration (WiX projects, SetupActions)
9. Developer tooling (PowerShell modules, Node-RED connectors)

b. Relationships & interactions
- The WPF UI invokes activities which call into plugin modules via the shared interfaces.
- Plugins use detectors/hooks in their host processes to interact with target applications (e.g., SAPBridge.exe for SAP, JavaBridge.exe for Java apps, NativeMessagingHost for Chrome/Firefox).
- Plugins and core send/receive control messages via Named-Pipes and the OpenRPA.Net library to coordinate workflow execution and backend tasks.
- For unattended automation, the WPF client delegates execution to RDService, which runs as a Windows service under another session.
- Workflows and activity results are stored either in local files (Filesystem plugin) or in a local LiteDB database (LiteDB plugin).
- The core and plugins register with OpenFlow (cloud-hosted backend) via WebSocket messages (OpenRPA.Net) for orchestration, queue management, and metrics.
- PowerShell cmdlets and Node-RED nodes connect to the OpenRPA IPC or WebSocket endpoints for external automation control.

c. Architectural patterns & design principles
- Plugin architecture via a central IPlugin/IActivity contract (OpenRPA.Interfaces)
- Host-process isolation for each automation domain (browser, Java, SAP, terminals)
- IPC channels for within-machine communication (Named-Pipes, Native Messaging)
- Messaging bus for backend orchestration (WebSocket + JSON messages)
- Modular installer using WiX to compose plugins and services

d. Key technologies & frameworks
- .NET Framework 4.x / .NET Core (WPF)
- WiX Toolset for MSI installers
- Named-Pipes and Native Messaging for IPC
- WebSocket‐based messaging (OpenRPA.Net)
- PowerShell modules
- Node-RED integration

##### Detail without over-partitioning
- Distinct process (e.g., separate JavaBridge and SAPBridge)
- Plugin interface layer (OpenRPA.Interfaces) as the glue
- Distinguish local execution vs. remote/backend orchestration

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "UI & Core Runtime"
        DC["Desktop Client (WPF UI & Core Runtime)"]:::ui
        PL["Plugin Loader & Runtime Host"]:::ui
        DC --> PL
    end

    subgraph "Shared Interface Layer"
        SI["OpenRPA.Interfaces"]:::ui
    end

    PL --> SI

    subgraph "Plugin Modules"
        Img["Image Automation Plugin"]:::plugins
        Web["Web Automation Plugin (IE)"]:::plugins
        SAP["SAP Automation Plugin"]:::plugins
        Term["Terminal Automation Plugin"]:::plugins
        DB["Database Automation Plugin"]:::plugins
        Off["Office Automation Plugin"]:::plugins
        Script["Script Activities Plugin"]:::plugins
        OFDB["OpenFlow DB Connector Plugin"]:::plugins
    end

    SI --> Img
    SI --> Web
    SI --> SAP
    SI --> Term
    SI --> DB
    SI --> Off
    SI --> Script
    SI --> OFDB

    subgraph "Integration Hosts & IPC"
        NP["Named-Pipe Wrapper Library"]:::hosts
        NM["NativeMessaging Host"]:::hosts
        JB["Java Host Process (JavaBridge)"]:::hosts
        SB["SAP Host Process (SAPBridge)"]:::hosts
        RDsvc["RDService (Windows Service)"]:::hosts
        RDmon["RDService Monitoring Service"]:::hosts
        RDplug["RDService Plugin"]:::hosts
    end

    PL -->|NamedPipe| NP
    Web -->|NativeMessaging| NM
    Img -->|process hook| JB
    SAP -->|process hook| SB
    PL --> RDsvc
    RDsvc --> RDmon
    RDsvc --> RDplug

    subgraph "Messaging & Backend Communication"
        Net["OpenRPA.Net (WebSocket/JSON)"]:::storage
        Cloud["OpenFlow Backend"]:::storage
    end

    PL -->|WebSocket/JSON| Net
    OFDB -->|WebSocket/JSON| Net
    Net --> Cloud

    subgraph "Local Storage Providers"
        FS["Filesystem Provider"]:::storage
        LB["LiteDB Provider"]:::storage
    end

    Img -->|Files| FS
    Web -->|Files| FS
    SAP -->|Files| FS
    Term -->|Files| FS
    DB -->|Files| FS
    Off -->|Files| FS
    Script -->|Files| FS
    OFDB -->|Files| FS

    Img -->|LiteDB| LB
    Web -->|LiteDB| LB
    SAP -->|LiteDB| LB
    Term -->|LiteDB| LB
    DB -->|LiteDB| LB
    Off -->|LiteDB| LB
    Script -->|LiteDB| LB
    OFDB -->|LiteDB| LB

    subgraph "Installer & Tooling"
        WiX["Installer & WiX Packaging Project"]:::storage
        Actions["Installer Custom Actions"]:::storage
        PS["PowerShell Cmdlets & Node-RED Connectors"]:::storage
    end

    WiX --> DC
    WiX --> Img
    WiX --> Web
    WiX --> SAP
    WiX --> Term
    WiX --> DB
    WiX --> Off
    WiX --> Script
    WiX --> OFDB
    WiX --> RDsvc

    PS --> PL
    PS --> Net

    %% Click Events
    click DC "https://github.com/open-rpa/openrpa/tree/master/OpenRPA/"
    click PL "https://github.com/open-rpa/openrpa/blob/master/OpenRPA/Extensions.cs"
    click PL "https://github.com/open-rpa/openrpa/blob/master/OpenRPA/ServiceManager.cs"
    click SI "https://github.com/open-rpa/openrpa/tree/master/OpenRPA.Interfaces/"
    click Img "https://github.com/open-rpa/openrpa/tree/master/OpenRPA.Image/"
    click Web "https://github.com/open-rpa/openrpa/tree/master/OpenRPA.IE/"
    click SAP "https://github.com/open-rpa/openrpa/tree/master/OpenRPA.SAP/"
    click Term "https://github.com/open-rpa/openrpa/tree/master/OpenRPA.TerminalEmulator/"
    click DB "https://github.com/open-rpa/openrpa/tree/master/OpenRPA.Database/"
    click Off "https://github.com/open-rpa/openrpa/tree/master/OpenRPA.Office/"
    click Script "https://github.com/open-rpa/openrpa/tree/master/OpenRPA.Script/"
    click OFDB "https://github.com/open-rpa/openrpa/tree/master/OpenRPA.OpenFlowDB/"
    click NP "https://github.com/open-rpa/openrpa/tree/master/OpenRPA.NamedPipeWrapper/"
    click NM "https://github.com/open-rpa/openrpa/tree/master/OpenRPA.NativeMessagingHost/"
    click JB "https://github.com/open-rpa/openrpa/tree/master/OpenRPA.JavaBridge/"
    click SB "https://github.com/open-rpa/openrpa/tree/master/OpenRPA.SAPBridge/"
    click RDsvc "https://github.com/open-rpa/openrpa/tree/master/OpenRPA.RDService/"
    click RDmon "https://github.com/open-rpa/openrpa/tree/master/OpenRPA.RDServiceMonitor/"
    click RDplug "https://github.com/open-rpa/openrpa/tree/master/OpenRPA.RDServicePlugin/"
    click Net "https://github.com/open-rpa/openrpa/tree/master/OpenRPA.Net/"
    click FS "https://github.com/open-rpa/openrpa/tree/master/OpenRPA.Storage.Filesystem/"
    click LB "https://github.com/open-rpa/openrpa/tree/master/OpenRPA.Storage.LiteDB/"
    click WiX "https://github.com/open-rpa/openrpa/tree/master/OpenRPA.SetupProject/"
    click Actions "https://github.com/open-rpa/openrpa/tree/master/OpenRPA.SetupActions/"
    click PS "https://github.com/open-rpa/openrpa/tree/master/OpenRPA.PS/"

    classDef ui fill:#D0E6FA,stroke:#4A90E2,color:#000;
    classDef plugins fill:#E8F6E8,stroke:#3CB371,color:#000;
    classDef hosts fill:#FFEFD5,stroke:#FFA500,color:#000;
    classDef storage fill:#F3E8FF,stroke:#800080,color:#000;
```
