# ajharshal45/ai-agent-workflow-scheduler architecture

> Architecture diagram of the GitHub repository ajharshal45/ai-agent-workflow-scheduler, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ajharshal45/ai-agent-workflow-scheduler
- Repository: https://github.com/ajharshal45/ai-agent-workflow-scheduler

## Overview

This is a C++17 precedence-constrained workflow scheduler with a React interface and a separate live multi-agent execution arena. The main user flow is to create or load a workflow, inspect and validate its dependency graph, request scheduling or analysis through the REST API, and view the returned schedules and metrics. The README documents the algorithm and UI capabilities; some source excerpts are partial, so unshown internal links are omitted. The arena’s dispatcher-to-LLM interaction is represented as unverified.

Main entry points: [`src/server.cpp`](https://github.com/ajharshal45/ai-agent-workflow-scheduler/blob/main/src/server.cpp) (HTTP API), [`frontend/src/App.jsx`](https://github.com/ajharshal45/ai-agent-workflow-scheduler/blob/main/frontend/src/App.jsx) (App coordinator), [`src/bnb.cpp`](https://github.com/ajharshal45/ai-agent-workflow-scheduler/blob/main/src/bnb.cpp) (Branch and bound), [`agent_harness/src/main.cpp`](https://github.com/ajharshal45/ai-agent-workflow-scheduler/blob/main/agent_harness/src/main.cpp) (Arena runner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["React Interface"]
  node_app["App coordinator<br/>[App.jsx]"]
  node_builder["Workflow builder"]
  node_views["Analysis views"]
  node_benchview["Benchmark view<br/>[BenchmarkView.jsx]"]
  node_about["Algorithm guide"]
  node_liveview["Live arena view"]
  node_api["REST client<br/>[api.js]"]
end

subgraph group_service["REST Service"]
  node_server["HTTP API<br/>[server.cpp]"]
end

subgraph group_engine["Scheduling Engine"]
  node_workflow["Workflow graph<br/>[dag.cpp]"]
  node_validation["Validation and cycles<br/>[validator.cpp]"]
  node_topology["Topological ordering<br/>[topo_sort.cpp]"]
  node_cpm["Critical path analysis<br/>[critical_path.cpp]"]
  node_greedy["Greedy scheduling<br/>[greedy.cpp]"]
  node_exact["Exact backtracking<br/>[backtrack.cpp]"]
  node_bnb["Branch and bound<br/>[bnb.cpp]"]
  node_serial["Serial SGS<br/>[serial_sgs.cpp]"]
  node_random["Random DAG generator<br/>[random_dag.cpp]"]
end

subgraph group_arena["Agent Arena"]
  node_arena_main["Arena runner<br/>[main.cpp]"]
  node_dispatcher["Concurrent dispatcher"]
  node_llm["LLM clients<br/>[llm_client.cpp]"]
end

node_user(("Scheduler user"))

node_user -->|"uses"| node_app
node_app -->|"renders"| node_builder
node_app -->|"renders"| node_views
node_app -->|"renders"| node_benchview
node_app -->|"renders"| node_about
node_app -->|"renders"| node_liveview
node_app -->|"requests"| node_api
node_api -->|"sends REST requests"| node_server
node_server -->|"validates"| node_validation
node_server -->|"parses workflows"| node_workflow
node_server -->|"requests sorting"| node_topology
node_server -->|"requests analysis"| node_cpm
node_server -->|"requests schedules"| node_greedy
node_server -->|"requests search"| node_exact
node_server -->|"requests optimization"| node_bnb
node_server -->|"generates workflows"| node_random
node_bnb -->|"warm starts"| node_greedy
node_bnb -->|"uses schedule generation"| node_serial
node_arena_main -->|"runs execution"| node_dispatcher
node_arena_main -->|"plans with"| node_greedy
node_arena_main -->|"plans with"| node_bnb
node_dispatcher -.->|"dispatches tasks"| node_llm
node_liveview -->|"uses arena API"| node_server

click node_app "https://github.com/ajharshal45/ai-agent-workflow-scheduler/blob/main/frontend/src/App.jsx"
click node_builder "https://github.com/ajharshal45/ai-agent-workflow-scheduler/blob/main/frontend/src/components/WorkflowBuilderView.jsx"
click node_views "https://github.com/ajharshal45/ai-agent-workflow-scheduler/tree/main/frontend/src/components"
click node_benchview "https://github.com/ajharshal45/ai-agent-workflow-scheduler/blob/main/frontend/src/components/BenchmarkView.jsx"
click node_about "https://github.com/ajharshal45/ai-agent-workflow-scheduler/blob/main/frontend/src/components/AboutAlgorithmsView.jsx"
click node_liveview "https://github.com/ajharshal45/ai-agent-workflow-scheduler/blob/main/frontend/src/components/LiveAgentDispatcherView.jsx"
click node_api "https://github.com/ajharshal45/ai-agent-workflow-scheduler/blob/main/frontend/src/api.js"
click node_server "https://github.com/ajharshal45/ai-agent-workflow-scheduler/blob/main/src/server.cpp"
click node_workflow "https://github.com/ajharshal45/ai-agent-workflow-scheduler/blob/main/src/dag.cpp"
click node_validation "https://github.com/ajharshal45/ai-agent-workflow-scheduler/blob/main/src/validator.cpp"
click node_topology "https://github.com/ajharshal45/ai-agent-workflow-scheduler/blob/main/src/topo_sort.cpp"
click node_cpm "https://github.com/ajharshal45/ai-agent-workflow-scheduler/blob/main/src/critical_path.cpp"
click node_greedy "https://github.com/ajharshal45/ai-agent-workflow-scheduler/blob/main/src/greedy.cpp"
click node_exact "https://github.com/ajharshal45/ai-agent-workflow-scheduler/blob/main/src/backtrack.cpp"
click node_bnb "https://github.com/ajharshal45/ai-agent-workflow-scheduler/blob/main/src/bnb.cpp"
click node_serial "https://github.com/ajharshal45/ai-agent-workflow-scheduler/blob/main/src/serial_sgs.cpp"
click node_random "https://github.com/ajharshal45/ai-agent-workflow-scheduler/blob/main/src/random_dag.cpp"
click node_arena_main "https://github.com/ajharshal45/ai-agent-workflow-scheduler/blob/main/agent_harness/src/main.cpp"
click node_dispatcher "https://github.com/ajharshal45/ai-agent-workflow-scheduler/blob/main/agent_harness/src/agent_dispatcher.cpp"
click node_llm "https://github.com/ajharshal45/ai-agent-workflow-scheduler/blob/main/agent_harness/src/llm_client.cpp"

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_app,node_builder,node_views,node_benchview,node_about,node_liveview,node_api toneBlue
class node_server toneAmber
class node_workflow,node_validation,node_topology,node_cpm,node_greedy,node_exact,node_bnb,node_serial,node_random toneMint
class node_arena_main,node_dispatcher,node_llm,node_user toneRose
```

## Components

### React Interface

- [App coordinator](https://github.com/ajharshal45/ai-agent-workflow-scheduler/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Workflow builder](https://github.com/ajharshal45/ai-agent-workflow-scheduler/blob/main/frontend/src/components/WorkflowBuilderView.jsx): `frontend/src/components/WorkflowBuilderView.jsx`
- [Analysis views](https://github.com/ajharshal45/ai-agent-workflow-scheduler/tree/main/frontend/src/components): `frontend/src/components`
- [Benchmark view](https://github.com/ajharshal45/ai-agent-workflow-scheduler/blob/main/frontend/src/components/BenchmarkView.jsx): `frontend/src/components/BenchmarkView.jsx`
- [Algorithm guide](https://github.com/ajharshal45/ai-agent-workflow-scheduler/blob/main/frontend/src/components/AboutAlgorithmsView.jsx): `frontend/src/components/AboutAlgorithmsView.jsx`
- [Live arena view](https://github.com/ajharshal45/ai-agent-workflow-scheduler/blob/main/frontend/src/components/LiveAgentDispatcherView.jsx): `frontend/src/components/LiveAgentDispatcherView.jsx`
- [REST client](https://github.com/ajharshal45/ai-agent-workflow-scheduler/blob/main/frontend/src/api.js): `frontend/src/api.js`

### REST Service

- [HTTP API](https://github.com/ajharshal45/ai-agent-workflow-scheduler/blob/main/src/server.cpp): `src/server.cpp`

### Scheduling Engine

- [Workflow graph](https://github.com/ajharshal45/ai-agent-workflow-scheduler/blob/main/src/dag.cpp): `src/dag.cpp`
- [Validation and cycles](https://github.com/ajharshal45/ai-agent-workflow-scheduler/blob/main/src/validator.cpp): `src/validator.cpp`
- [Topological ordering](https://github.com/ajharshal45/ai-agent-workflow-scheduler/blob/main/src/topo_sort.cpp): `src/topo_sort.cpp`
- [Critical path analysis](https://github.com/ajharshal45/ai-agent-workflow-scheduler/blob/main/src/critical_path.cpp): `src/critical_path.cpp`
- [Greedy scheduling](https://github.com/ajharshal45/ai-agent-workflow-scheduler/blob/main/src/greedy.cpp): `src/greedy.cpp`
- [Exact backtracking](https://github.com/ajharshal45/ai-agent-workflow-scheduler/blob/main/src/backtrack.cpp): `src/backtrack.cpp`
- [Branch and bound](https://github.com/ajharshal45/ai-agent-workflow-scheduler/blob/main/src/bnb.cpp): `src/bnb.cpp`
- [Serial SGS](https://github.com/ajharshal45/ai-agent-workflow-scheduler/blob/main/src/serial_sgs.cpp): `src/serial_sgs.cpp`
- [Random DAG generator](https://github.com/ajharshal45/ai-agent-workflow-scheduler/blob/main/src/random_dag.cpp): `src/random_dag.cpp`

### Agent Arena

- [Arena runner](https://github.com/ajharshal45/ai-agent-workflow-scheduler/blob/main/agent_harness/src/main.cpp): `agent_harness/src/main.cpp`
- [Concurrent dispatcher](https://github.com/ajharshal45/ai-agent-workflow-scheduler/blob/main/agent_harness/src/agent_dispatcher.cpp): `agent_harness/src/agent_dispatcher.cpp`
- [LLM clients](https://github.com/ajharshal45/ai-agent-workflow-scheduler/blob/main/agent_harness/src/llm_client.cpp): `agent_harness/src/llm_client.cpp`

### Other components

- **Scheduler user**

## Connections

- Scheduler user → App coordinator: uses
- App coordinator → Workflow builder: renders (evidence: `frontend/src/App.jsx`)
- App coordinator → Analysis views: renders (evidence: `frontend/src/App.jsx`)
- App coordinator → Benchmark view: renders (evidence: `frontend/src/App.jsx`)
- App coordinator → Algorithm guide: renders (evidence: `frontend/src/App.jsx`)
- App coordinator → Live arena view: renders (evidence: `frontend/src/App.jsx`)
- App coordinator → REST client: requests (evidence: `frontend/src/App.jsx`)
- REST client → HTTP API: sends REST requests
- HTTP API → Validation and cycles: validates (evidence: `src/server.cpp`)
- HTTP API → Workflow graph: parses workflows (evidence: `src/server.cpp`)
- HTTP API → Topological ordering: requests sorting (evidence: `src/server.cpp`)
- HTTP API → Critical path analysis: requests analysis (evidence: `src/server.cpp`)
- HTTP API → Greedy scheduling: requests schedules (evidence: `src/server.cpp`)
- HTTP API → Exact backtracking: requests search
- HTTP API → Branch and bound: requests optimization (evidence: `src/server.cpp`)
- HTTP API → Random DAG generator: generates workflows (evidence: `src/server.cpp`)
- Branch and bound → Greedy scheduling: warm starts (evidence: `src/bnb.cpp`)
- Branch and bound → Serial SGS: uses schedule generation (evidence: `src/bnb.cpp`)
- Arena runner → Concurrent dispatcher: runs execution (evidence: `agent_harness/src/main.cpp`)
- Arena runner → Greedy scheduling: plans with (evidence: `agent_harness/src/main.cpp`)
- Arena runner → Branch and bound: plans with (evidence: `agent_harness/src/main.cpp`)
- Concurrent dispatcher → LLM clients: dispatches tasks
- Live arena view → HTTP API: uses arena API
