# harshjha872/ai-workflow-builder architecture

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

- Interactive diagram: https://gitdiagram.com/harshjha872/ai-workflow-builder
- Repository: https://github.com/harshjha872/ai-workflow-builder

## Overview

This is a visual workflow authoring and execution application. Users create and configure connected trigger, LLM, HTTP, condition, transform, and output nodes; save workflows; then submit inputs and watch execution events. The frontend editor and API lead to backend workflow persistence and execution, where queued node work updates shared context and streams progress. The graph reflects the sampled routes, worker, and UI; some engine and storage relationships are supported only by the source index, and no README product details were provided.

Main entry points: [`backend/src/queue/worker.ts`](https://github.com/harshjha872/ai-workflow-builder/blob/master/backend/src/queue/worker.ts) (Execution worker), [`frontend/src/pages/EditorPage.tsx`](https://github.com/harshjha872/ai-workflow-builder/blob/master/frontend/src/pages/EditorPage.tsx) (Workflow editor), [`backend/src/routes/executions.ts`](https://github.com/harshjha872/ai-workflow-builder/blob/master/backend/src/routes/executions.ts) (Execution routes), [`backend/src/queue/queue.ts`](https://github.com/harshjha872/ai-workflow-builder/blob/master/backend/src/queue/queue.ts) (Execution queue)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_authoring["Workflow authoring"]
  node_home["Workflow home<br/>[HomePage.tsx]"]
  node_editor["Workflow editor<br/>[EditorPage.tsx]"]
  node_canvas["Graph canvas<br/>[Canvas.tsx]"]
  node_config["Node configuration<br/>[ConfigPanel.tsx]"]
  node_workflow_state["Workflow state<br/>[workflowSlice.ts]"]
  node_execution_state["Execution state<br/>[executionSlice.ts]"]
  node_workflow_api["Workflow API client<br/>[workflows.ts]"]
  node_execution_api["Execution API client<br/>[executions.ts]"]
end

subgraph group_api["API and persistence"]
  node_workflow_routes["Workflow routes<br/>[workflows.ts]"]
  node_execution_routes["Execution routes<br/>[executions.ts]"]
  node_workflow_queries["Workflow persistence<br/>[workflows.ts]"]
  node_execution_queries["Execution persistence<br/>[executions.ts]"]
  node_sqlite[("SQLite database<br/>[client.ts]")]
end

subgraph group_runtime["Workflow runtime"]
  node_executor["Workflow executor<br/>[executor.ts]"]
  node_dag["DAG validation<br/>[dag.ts]"]
  node_worker["Execution worker<br/>[worker.ts]"]
  node_queue["Execution queue<br/>[queue.ts]"]
  node_context["Execution context<br/>[context.ts]"]
  node_interpolate["Variable interpolation<br/>[interpolate.ts]"]
  node_trigger["Trigger node<br/>[trigger.ts]"]
  node_llm_node["LLM node<br/>[llmCall.ts]"]
  node_http_node["HTTP node<br/>[httpRequest.ts]"]
  node_condition["Condition node<br/>[condition.ts]"]
  node_transform["Transform node<br/>[transform.ts]"]
  node_output["Output node<br/>[output.ts]"]
  node_sse["Event streaming<br/>[sseManager.ts]"]
end

subgraph group_integrations["External integrations"]
  node_redis[("Redis<br/>[redis.ts]")]
  node_llm_providers["LLM providers"]
  node_http_service["HTTP endpoint"]
end

node_user(("Workflow user"))

node_user -.->|"opens"| node_home
node_user -.->|"edits"| node_editor
node_home -.->|"loads workflows"| node_workflow_api
node_editor -->|"renders"| node_canvas
node_editor -->|"renders"| node_config
node_canvas -->|"updates graph"| node_workflow_state
node_editor -->|"loads workflow"| node_workflow_state
node_editor -->|"loads workflow"| node_workflow_api
node_editor -.->|"starts execution"| node_execution_api
node_editor -->|"dispatches status"| node_execution_state
node_editor -->|"opens event stream"| node_sse
node_workflow_api -.->|"HTTP requests"| node_workflow_routes
node_execution_api -.->|"HTTP requests"| node_execution_routes
node_workflow_routes -->|"reads and writes"| node_workflow_queries
node_workflow_queries -->|"queries"| node_sqlite
node_execution_routes -->|"loads workflow"| node_workflow_queries
node_execution_routes -->|"records execution"| node_execution_queries
node_execution_queries -->|"queries"| node_sqlite
node_execution_routes -->|"checks cycles"| node_dag
node_execution_routes -->|"starts workflow"| node_executor
node_executor -.->|"enqueues node work"| node_queue
node_queue -.->|"dispatches jobs"| node_worker
node_worker -->|"enqueues next node"| node_queue
node_worker -->|"updates data"| node_context
node_worker -->|"resolves config"| node_interpolate
node_worker -->|"dispatches"| node_trigger
node_worker -->|"dispatches"| node_llm_node
node_worker -->|"dispatches"| node_http_node
node_worker -->|"dispatches"| node_condition
node_worker -->|"dispatches"| node_transform
node_worker -->|"dispatches"| node_output
node_worker -->|"emits events"| node_sse
node_execution_routes -->|"registers stream"| node_sse
node_llm_node -->|"calls provider"| node_llm_providers
node_http_node -.->|"makes request"| node_http_service
node_worker -->|"uses connection"| node_redis
node_queue -->|"uses connection"| node_redis

click node_home "https://github.com/harshjha872/ai-workflow-builder/blob/master/frontend/src/pages/HomePage.tsx"
click node_editor "https://github.com/harshjha872/ai-workflow-builder/blob/master/frontend/src/pages/EditorPage.tsx"
click node_canvas "https://github.com/harshjha872/ai-workflow-builder/blob/master/frontend/src/components/canvas/Canvas.tsx"
click node_config "https://github.com/harshjha872/ai-workflow-builder/blob/master/frontend/src/components/config/ConfigPanel.tsx"
click node_workflow_state "https://github.com/harshjha872/ai-workflow-builder/blob/master/frontend/src/store/workflowSlice.ts"
click node_execution_state "https://github.com/harshjha872/ai-workflow-builder/blob/master/frontend/src/store/executionSlice.ts"
click node_workflow_api "https://github.com/harshjha872/ai-workflow-builder/blob/master/frontend/src/api/workflows.ts"
click node_execution_api "https://github.com/harshjha872/ai-workflow-builder/blob/master/frontend/src/api/executions.ts"
click node_workflow_routes "https://github.com/harshjha872/ai-workflow-builder/blob/master/backend/src/routes/workflows.ts"
click node_execution_routes "https://github.com/harshjha872/ai-workflow-builder/blob/master/backend/src/routes/executions.ts"
click node_workflow_queries "https://github.com/harshjha872/ai-workflow-builder/blob/master/backend/src/db/queries/workflows.ts"
click node_execution_queries "https://github.com/harshjha872/ai-workflow-builder/blob/master/backend/src/db/queries/executions.ts"
click node_sqlite "https://github.com/harshjha872/ai-workflow-builder/blob/master/backend/src/db/client.ts"
click node_executor "https://github.com/harshjha872/ai-workflow-builder/blob/master/backend/src/engine/executor.ts"
click node_dag "https://github.com/harshjha872/ai-workflow-builder/blob/master/backend/src/engine/dag.ts"
click node_worker "https://github.com/harshjha872/ai-workflow-builder/blob/master/backend/src/queue/worker.ts"
click node_queue "https://github.com/harshjha872/ai-workflow-builder/blob/master/backend/src/queue/queue.ts"
click node_context "https://github.com/harshjha872/ai-workflow-builder/blob/master/backend/src/engine/context.ts"
click node_interpolate "https://github.com/harshjha872/ai-workflow-builder/blob/master/backend/src/engine/interpolate.ts"
click node_trigger "https://github.com/harshjha872/ai-workflow-builder/blob/master/backend/src/engine/nodes/trigger.ts"
click node_llm_node "https://github.com/harshjha872/ai-workflow-builder/blob/master/backend/src/engine/nodes/llmCall.ts"
click node_http_node "https://github.com/harshjha872/ai-workflow-builder/blob/master/backend/src/engine/nodes/httpRequest.ts"
click node_condition "https://github.com/harshjha872/ai-workflow-builder/blob/master/backend/src/engine/nodes/condition.ts"
click node_transform "https://github.com/harshjha872/ai-workflow-builder/blob/master/backend/src/engine/nodes/transform.ts"
click node_output "https://github.com/harshjha872/ai-workflow-builder/blob/master/backend/src/engine/nodes/output.ts"
click node_sse "https://github.com/harshjha872/ai-workflow-builder/blob/master/backend/src/sse/sseManager.ts"
click node_redis "https://github.com/harshjha872/ai-workflow-builder/blob/master/backend/src/config/redis.ts"

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_home,node_editor,node_canvas,node_config,node_workflow_state,node_execution_state,node_workflow_api,node_execution_api,node_user toneBlue
class node_workflow_routes,node_execution_routes,node_workflow_queries,node_execution_queries,node_sqlite toneAmber
class node_executor,node_dag,node_worker,node_queue,node_context,node_interpolate,node_trigger,node_llm_node,node_http_node,node_condition,node_transform,node_output,node_sse toneMint
class node_redis,node_llm_providers,node_http_service toneRose
```

## Components

### Workflow authoring

- [Workflow home](https://github.com/harshjha872/ai-workflow-builder/blob/master/frontend/src/pages/HomePage.tsx): `frontend/src/pages/HomePage.tsx`
- [Workflow editor](https://github.com/harshjha872/ai-workflow-builder/blob/master/frontend/src/pages/EditorPage.tsx): `frontend/src/pages/EditorPage.tsx`
- [Graph canvas](https://github.com/harshjha872/ai-workflow-builder/blob/master/frontend/src/components/canvas/Canvas.tsx): `frontend/src/components/canvas/Canvas.tsx`
- [Node configuration](https://github.com/harshjha872/ai-workflow-builder/blob/master/frontend/src/components/config/ConfigPanel.tsx): `frontend/src/components/config/ConfigPanel.tsx`
- [Workflow state](https://github.com/harshjha872/ai-workflow-builder/blob/master/frontend/src/store/workflowSlice.ts): `frontend/src/store/workflowSlice.ts`
- [Execution state](https://github.com/harshjha872/ai-workflow-builder/blob/master/frontend/src/store/executionSlice.ts): `frontend/src/store/executionSlice.ts`
- [Workflow API client](https://github.com/harshjha872/ai-workflow-builder/blob/master/frontend/src/api/workflows.ts): `frontend/src/api/workflows.ts`
- [Execution API client](https://github.com/harshjha872/ai-workflow-builder/blob/master/frontend/src/api/executions.ts): `frontend/src/api/executions.ts`

### API and persistence

- [Workflow routes](https://github.com/harshjha872/ai-workflow-builder/blob/master/backend/src/routes/workflows.ts): `backend/src/routes/workflows.ts`
- [Execution routes](https://github.com/harshjha872/ai-workflow-builder/blob/master/backend/src/routes/executions.ts): `backend/src/routes/executions.ts`
- [Workflow persistence](https://github.com/harshjha872/ai-workflow-builder/blob/master/backend/src/db/queries/workflows.ts): `backend/src/db/queries/workflows.ts`
- [Execution persistence](https://github.com/harshjha872/ai-workflow-builder/blob/master/backend/src/db/queries/executions.ts): `backend/src/db/queries/executions.ts`
- [SQLite database](https://github.com/harshjha872/ai-workflow-builder/blob/master/backend/src/db/client.ts): `backend/src/db/client.ts`

### Workflow runtime

- [Workflow executor](https://github.com/harshjha872/ai-workflow-builder/blob/master/backend/src/engine/executor.ts): `backend/src/engine/executor.ts`
- [DAG validation](https://github.com/harshjha872/ai-workflow-builder/blob/master/backend/src/engine/dag.ts): `backend/src/engine/dag.ts`
- [Execution worker](https://github.com/harshjha872/ai-workflow-builder/blob/master/backend/src/queue/worker.ts): `backend/src/queue/worker.ts`
- [Execution queue](https://github.com/harshjha872/ai-workflow-builder/blob/master/backend/src/queue/queue.ts): `backend/src/queue/queue.ts`
- [Execution context](https://github.com/harshjha872/ai-workflow-builder/blob/master/backend/src/engine/context.ts): `backend/src/engine/context.ts`
- [Variable interpolation](https://github.com/harshjha872/ai-workflow-builder/blob/master/backend/src/engine/interpolate.ts): `backend/src/engine/interpolate.ts`
- [Trigger node](https://github.com/harshjha872/ai-workflow-builder/blob/master/backend/src/engine/nodes/trigger.ts): `backend/src/engine/nodes/trigger.ts`
- [LLM node](https://github.com/harshjha872/ai-workflow-builder/blob/master/backend/src/engine/nodes/llmCall.ts): `backend/src/engine/nodes/llmCall.ts`
- [HTTP node](https://github.com/harshjha872/ai-workflow-builder/blob/master/backend/src/engine/nodes/httpRequest.ts): `backend/src/engine/nodes/httpRequest.ts`
- [Condition node](https://github.com/harshjha872/ai-workflow-builder/blob/master/backend/src/engine/nodes/condition.ts): `backend/src/engine/nodes/condition.ts`
- [Transform node](https://github.com/harshjha872/ai-workflow-builder/blob/master/backend/src/engine/nodes/transform.ts): `backend/src/engine/nodes/transform.ts`
- [Output node](https://github.com/harshjha872/ai-workflow-builder/blob/master/backend/src/engine/nodes/output.ts): `backend/src/engine/nodes/output.ts`
- [Event streaming](https://github.com/harshjha872/ai-workflow-builder/blob/master/backend/src/sse/sseManager.ts): `backend/src/sse/sseManager.ts`

### External integrations

- [Redis](https://github.com/harshjha872/ai-workflow-builder/blob/master/backend/src/config/redis.ts): `backend/src/config/redis.ts`
- **LLM providers**
- **HTTP endpoint**

### Other components

- **Workflow user**

## Connections

- Workflow user → Workflow home: opens
- Workflow user → Workflow editor: edits
- Workflow home → Workflow API client: loads workflows (evidence: `frontend/src/pages/HomePage.tsx`)
- Workflow editor → Graph canvas: renders (evidence: `frontend/src/pages/EditorPage.tsx`)
- Workflow editor → Node configuration: renders (evidence: `frontend/src/pages/EditorPage.tsx`)
- Graph canvas → Workflow state: updates graph (evidence: `frontend/src/components/canvas/Canvas.tsx`)
- Workflow editor → Workflow state: loads workflow (evidence: `frontend/src/pages/EditorPage.tsx`)
- Workflow editor → Workflow API client: loads workflow (evidence: `frontend/src/pages/EditorPage.tsx`)
- Workflow editor → Execution API client: starts execution (evidence: `frontend/src/pages/EditorPage.tsx`)
- Workflow editor → Execution state: dispatches status (evidence: `frontend/src/pages/EditorPage.tsx`)
- Workflow editor → Event streaming: opens event stream
- Workflow API client → Workflow routes: HTTP requests
- Execution API client → Execution routes: HTTP requests
- Workflow routes → Workflow persistence: reads and writes (evidence: `backend/src/routes/workflows.ts`)
- Workflow persistence → SQLite database: queries (evidence: `backend/src/db/queries/workflows.ts`)
- Execution routes → Workflow persistence: loads workflow (evidence: `backend/src/routes/executions.ts`)
- Execution routes → Execution persistence: records execution (evidence: `backend/src/routes/executions.ts`)
- Execution persistence → SQLite database: queries (evidence: `backend/src/db/queries/executions.ts`)
- Execution routes → DAG validation: checks cycles (evidence: `backend/src/routes/executions.ts`)
- Execution routes → Workflow executor: starts workflow (evidence: `backend/src/routes/executions.ts`)
- Workflow executor → Execution queue: enqueues node work
- Execution queue → Execution worker: dispatches jobs (evidence: `backend/src/queue/worker.ts`)
- Execution worker → Execution queue: enqueues next node (evidence: `backend/src/queue/worker.ts`)
- Execution worker → Execution context: updates data (evidence: `backend/src/queue/worker.ts`)
- Execution worker → Variable interpolation: resolves config (evidence: `backend/src/queue/worker.ts`)
- Execution worker → Trigger node: dispatches (evidence: `backend/src/queue/worker.ts`)
- Execution worker → LLM node: dispatches (evidence: `backend/src/queue/worker.ts`)
- Execution worker → HTTP node: dispatches (evidence: `backend/src/queue/worker.ts`)
- Execution worker → Condition node: dispatches (evidence: `backend/src/queue/worker.ts`)
- Execution worker → Transform node: dispatches (evidence: `backend/src/queue/worker.ts`)
- Execution worker → Output node: dispatches (evidence: `backend/src/queue/worker.ts`)
- Execution worker → Event streaming: emits events (evidence: `backend/src/queue/worker.ts`)
- Execution routes → Event streaming: registers stream (evidence: `backend/src/routes/executions.ts`)
- LLM node → LLM providers: calls provider (evidence: `backend/src/engine/nodes/llmCall.ts`)
- HTTP node → HTTP endpoint: makes request
- Execution worker → Redis: uses connection (evidence: `backend/src/queue/worker.ts`)
- Execution queue → Redis: uses connection (evidence: `backend/src/queue/queue.ts`)
