# rohitt-prog/workflowos architecture

> Architecture diagram of the GitHub repository rohitt-prog/workflowos, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rohitt-prog/workflowos
- Repository: https://github.com/rohitt-prog/workflowos

## Overview

WorkFlowOS turns observed desktop or structured application activity into approved, executable workflows: collect and sanitize events, persist them, discover repeated sequences, interpret and plan them, then execute through integrations or browser automation. Execution outcomes are evaluated and update strategy scores. The graph also preserves the operator UI and application integrations. Some route-to-service wiring and frontend API calls are unsampled; those connections are omitted rather than inferred.

Main entry points: [`agent/service.py`](https://github.com/rohitt-prog/workflowos/blob/main/agent/service.py) (Desktop Agent), [`automation/service.py`](https://github.com/rohitt-prog/workflowos/blob/main/automation/service.py) (Automation Service), [`discovery/service.py`](https://github.com/rohitt-prog/workflowos/blob/main/discovery/service.py) (Discovery Service), [`automation/engine.py`](https://github.com/rohitt-prog/workflowos/blob/main/automation/engine.py) (Execution Engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User Experience"]
  node_dashboard["WorkFlowOS UI<br/>[page.tsx]"]
  node_workflow_views["Workflow Views"]
  node_api_routes["Backend API"]
end

subgraph group_observation["Activity &amp; Privacy"]
  node_desktop_agent["Desktop Agent<br/>[service.py]"]
  node_collector["Activity Collector<br/>[collector.py]"]
  node_normalizer["Event Normalizer<br/>[normalizer.py]"]
  node_event_client["Event Client<br/>[client.py]"]
  node_privacy["Privacy Controls<br/>[service.py]"]
  node_redaction["Sensitive Data Redaction<br/>[redaction.py]"]
  node_event_service["Event Ingestion<br/>[event_service.py]"]
  node_database[("MongoDB<br/>[database.py]")]
end

subgraph group_discovery["Workflow Discovery"]
  node_discovery_service["Discovery Service<br/>[service.py]"]
  node_sequence["Session Sequences<br/>[sequence.py]"]
  node_detector["Pattern Detector<br/>[detector.py]"]
end

subgraph group_execution["Planning &amp; Execution"]
  node_ai_understanding["AI Workflow Understanding<br/>[gemini_service.py]"]
  node_planner["Strategy Planner<br/>[planner.py]"]
  node_automation_service["Automation Service<br/>[service.py]"]
  node_engine["Execution Engine<br/>[engine.py]"]
  node_executors["Execution Strategies<br/>[executor.py]"]
  node_browser_executor["Browser Automation"]
  node_integration_registry["Integration Registry<br/>[registry.py]"]
  node_adapters["App Integrations"]
end

subgraph group_learning["Outcomes &amp; Adaptation"]
  node_outcome["Outcome Evaluation<br/>[outcome.py]"]
  node_learning_service["Learning Service<br/>[service.py]"]
  node_scorer["Strategy Scoring<br/>[scorer.py]"]
end

node_operator(("Operator"))

node_operator -->|"creates activity"| node_desktop_agent
node_desktop_agent -->|"collects from"| node_collector
node_desktop_agent -->|"normalizes events"| node_normalizer
node_desktop_agent -->|"streams events"| node_event_client
node_desktop_agent -->|"checks collection"| node_privacy
node_desktop_agent -->|"sanitizes events"| node_redaction
node_event_client -.->|"posts events"| node_api_routes
node_api_routes -.->|"ingests events"| node_event_service
node_event_service -->|"redacts data"| node_redaction
node_event_service -->|"persists events"| node_database
node_database -->|"supplies activity"| node_discovery_service
node_discovery_service -->|"builds sequences"| node_sequence
node_discovery_service -->|"detects patterns"| node_detector
node_discovery_service -->|"interprets workflows"| node_ai_understanding
node_ai_understanding -->|"informs plans"| node_planner
node_operator -->|"approves actions"| node_automation_service
node_api_routes -.->|"requests automation"| node_automation_service
node_automation_service -->|"executes workflow"| node_engine
node_automation_service -.->|"plans strategies"| node_planner
node_engine -->|"runs actions"| node_executors
node_engine -->|"resolves adapters"| node_integration_registry
node_engine -.->|"uses browser fallback"| node_browser_executor
node_integration_registry -->|"dispatches actions"| node_adapters
node_automation_service -->|"records outcomes"| node_learning_service
node_learning_service -->|"evaluates receipts"| node_outcome
node_learning_service -->|"stores learning state"| node_database
node_planner -->|"scores strategies"| node_scorer
node_learning_service -.->|"updates evidence"| node_scorer
node_operator -.->|"uses interface"| node_dashboard
node_dashboard -.->|"presents workflows"| node_workflow_views

click node_dashboard "https://github.com/rohitt-prog/workflowos/blob/main/frontend/src/app/page.tsx"
click node_workflow_views "https://github.com/rohitt-prog/workflowos/tree/main/frontend/src/components/views"
click node_api_routes "https://github.com/rohitt-prog/workflowos/tree/main/backend/routes"
click node_desktop_agent "https://github.com/rohitt-prog/workflowos/blob/main/agent/service.py"
click node_collector "https://github.com/rohitt-prog/workflowos/blob/main/agent/collector.py"
click node_normalizer "https://github.com/rohitt-prog/workflowos/blob/main/agent/normalizer.py"
click node_event_client "https://github.com/rohitt-prog/workflowos/blob/main/agent/client.py"
click node_privacy "https://github.com/rohitt-prog/workflowos/blob/main/backend/privacy/service.py"
click node_redaction "https://github.com/rohitt-prog/workflowos/blob/main/backend/privacy/redaction.py"
click node_event_service "https://github.com/rohitt-prog/workflowos/blob/main/backend/services/event_service.py"
click node_database "https://github.com/rohitt-prog/workflowos/blob/main/backend/database.py"
click node_discovery_service "https://github.com/rohitt-prog/workflowos/blob/main/discovery/service.py"
click node_sequence "https://github.com/rohitt-prog/workflowos/blob/main/discovery/sequence.py"
click node_detector "https://github.com/rohitt-prog/workflowos/blob/main/discovery/detector.py"
click node_ai_understanding "https://github.com/rohitt-prog/workflowos/blob/main/ai/gemini_service.py"
click node_planner "https://github.com/rohitt-prog/workflowos/blob/main/automation/planner/planner.py"
click node_automation_service "https://github.com/rohitt-prog/workflowos/blob/main/automation/service.py"
click node_engine "https://github.com/rohitt-prog/workflowos/blob/main/automation/engine.py"
click node_executors "https://github.com/rohitt-prog/workflowos/blob/main/automation/executor.py"
click node_browser_executor "https://github.com/rohitt-prog/workflowos/blob/main/automation/playwright_executor.py"
click node_integration_registry "https://github.com/rohitt-prog/workflowos/blob/main/integrations/registry.py"
click node_adapters "https://github.com/rohitt-prog/workflowos/tree/main/integrations"
click node_outcome "https://github.com/rohitt-prog/workflowos/blob/main/backend/learning/outcome.py"
click node_learning_service "https://github.com/rohitt-prog/workflowos/blob/main/backend/learning/service.py"
click node_scorer "https://github.com/rohitt-prog/workflowos/blob/main/automation/planner/scorer.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_dashboard,node_workflow_views,node_api_routes toneBlue
class node_desktop_agent,node_collector,node_normalizer,node_event_client,node_privacy,node_redaction,node_event_service,node_database toneAmber
class node_discovery_service,node_sequence,node_detector toneMint
class node_ai_understanding,node_planner,node_automation_service,node_engine,node_executors,node_browser_executor,node_integration_registry,node_adapters toneRose
class node_outcome,node_learning_service,node_scorer,node_operator toneIndigo
```

## Components

### User Experience

- [WorkFlowOS UI](https://github.com/rohitt-prog/workflowos/blob/main/frontend/src/app/page.tsx): `frontend/src/app/page.tsx`
- [Workflow Views](https://github.com/rohitt-prog/workflowos/tree/main/frontend/src/components/views): `frontend/src/components/views`
- [Backend API](https://github.com/rohitt-prog/workflowos/tree/main/backend/routes): `backend/routes`

### Activity & Privacy

- [Desktop Agent](https://github.com/rohitt-prog/workflowos/blob/main/agent/service.py): `agent/service.py`
- [Activity Collector](https://github.com/rohitt-prog/workflowos/blob/main/agent/collector.py): `agent/collector.py`
- [Event Normalizer](https://github.com/rohitt-prog/workflowos/blob/main/agent/normalizer.py): `agent/normalizer.py`
- [Event Client](https://github.com/rohitt-prog/workflowos/blob/main/agent/client.py): `agent/client.py`
- [Privacy Controls](https://github.com/rohitt-prog/workflowos/blob/main/backend/privacy/service.py): `backend/privacy/service.py`
- [Sensitive Data Redaction](https://github.com/rohitt-prog/workflowos/blob/main/backend/privacy/redaction.py): `backend/privacy/redaction.py`
- [Event Ingestion](https://github.com/rohitt-prog/workflowos/blob/main/backend/services/event_service.py): `backend/services/event_service.py`
- [MongoDB](https://github.com/rohitt-prog/workflowos/blob/main/backend/database.py): `backend/database.py`

### Workflow Discovery

- [Discovery Service](https://github.com/rohitt-prog/workflowos/blob/main/discovery/service.py): `discovery/service.py`
- [Session Sequences](https://github.com/rohitt-prog/workflowos/blob/main/discovery/sequence.py): `discovery/sequence.py`
- [Pattern Detector](https://github.com/rohitt-prog/workflowos/blob/main/discovery/detector.py): `discovery/detector.py`

### Planning & Execution

- [AI Workflow Understanding](https://github.com/rohitt-prog/workflowos/blob/main/ai/gemini_service.py): `ai/gemini_service.py`
- [Strategy Planner](https://github.com/rohitt-prog/workflowos/blob/main/automation/planner/planner.py): `automation/planner/planner.py`
- [Automation Service](https://github.com/rohitt-prog/workflowos/blob/main/automation/service.py): `automation/service.py`
- [Execution Engine](https://github.com/rohitt-prog/workflowos/blob/main/automation/engine.py): `automation/engine.py`
- [Execution Strategies](https://github.com/rohitt-prog/workflowos/blob/main/automation/executor.py): `automation/executor.py`
- [Browser Automation](https://github.com/rohitt-prog/workflowos/blob/main/automation/playwright_executor.py): `automation/playwright_executor.py`
- [Integration Registry](https://github.com/rohitt-prog/workflowos/blob/main/integrations/registry.py): `integrations/registry.py`
- [App Integrations](https://github.com/rohitt-prog/workflowos/tree/main/integrations): `integrations`

### Outcomes & Adaptation

- [Outcome Evaluation](https://github.com/rohitt-prog/workflowos/blob/main/backend/learning/outcome.py): `backend/learning/outcome.py`
- [Learning Service](https://github.com/rohitt-prog/workflowos/blob/main/backend/learning/service.py): `backend/learning/service.py`
- [Strategy Scoring](https://github.com/rohitt-prog/workflowos/blob/main/automation/planner/scorer.py): `automation/planner/scorer.py`

### Other components

- **Operator**

## Connections

- Operator → Desktop Agent: creates activity (evidence: `README.md`)
- Desktop Agent → Activity Collector: collects from (evidence: `agent/service.py`)
- Desktop Agent → Event Normalizer: normalizes events (evidence: `agent/service.py`)
- Desktop Agent → Event Client: streams events (evidence: `agent/service.py`)
- Desktop Agent → Privacy Controls: checks collection (evidence: `agent/service.py`)
- Desktop Agent → Sensitive Data Redaction: sanitizes events (evidence: `agent/service.py`)
- Event Client → Backend API: posts events
- Backend API → Event Ingestion: ingests events
- Event Ingestion → Sensitive Data Redaction: redacts data (evidence: `backend/services/event_service.py`)
- Event Ingestion → MongoDB: persists events (evidence: `backend/services/event_service.py`)
- MongoDB → Discovery Service: supplies activity (evidence: `README.md`)
- Discovery Service → Session Sequences: builds sequences (evidence: `discovery/service.py`)
- Discovery Service → Pattern Detector: detects patterns (evidence: `discovery/service.py`)
- Discovery Service → AI Workflow Understanding: interprets workflows (evidence: `README.md`)
- AI Workflow Understanding → Strategy Planner: informs plans (evidence: `README.md`)
- Operator → Automation Service: approves actions (evidence: `README.md`)
- Backend API → Automation Service: requests automation
- Automation Service → Execution Engine: executes workflow (evidence: `automation/service.py`)
- Automation Service → Strategy Planner: plans strategies (evidence: `automation/planner/planner.py`)
- Execution Engine → Execution Strategies: runs actions (evidence: `automation/engine.py`)
- Execution Engine → Integration Registry: resolves adapters (evidence: `automation/engine.py`)
- Execution Engine → Browser Automation: uses browser fallback
- Integration Registry → App Integrations: dispatches actions (evidence: `integrations/registry.py`)
- Automation Service → Learning Service: records outcomes (evidence: `automation/service.py`)
- Learning Service → Outcome Evaluation: evaluates receipts (evidence: `backend/learning/service.py`)
- Learning Service → MongoDB: stores learning state (evidence: `backend/learning/service.py`)
- Strategy Planner → Strategy Scoring: scores strategies (evidence: `automation/planner/planner.py`)
- Learning Service → Strategy Scoring: updates evidence
- Operator → WorkFlowOS UI: uses interface
- WorkFlowOS UI → Workflow Views: presents workflows
