# ibharatsaini/automiq-workflow architecture

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

- Interactive diagram: https://gitdiagram.com/ibharatsaini/automiq-workflow
- Repository: https://github.com/ibharatsaini/automiq-workflow

## Overview

Automiq is a project-scoped workflow automation platform. Users authenticate and work in a project workspace, create visual workflows, activate webhook or schedule triggers, and inspect recorded executions. The backend separates HTTP routing, workflow lifecycle and execution orchestration, node implementations, and persistence. The README documents regular inline and optional queued execution, plus team invitations and role-aware access. Some frontend and backend subsystems are represented from README capabilities and the source index; their implementation details were not sampled, so uncertain links are omitted.

Main entry points: [`src/services/WorkflowExecutionService.ts`](https://github.com/ibharatsaini/automiq-workflow/blob/main/src/services/WorkflowExecutionService.ts) (Execution orchestration), [`src/routes/WorkflowsRouter.ts`](https://github.com/ibharatsaini/automiq-workflow/blob/main/src/routes/WorkflowsRouter.ts) (Workflow routes), [`src/services/ActiveWorkflowManager.ts`](https://github.com/ibharatsaini/automiq-workflow/blob/main/src/services/ActiveWorkflowManager.ts) (Trigger registration), [`client/src/App.tsx`](https://github.com/ibharatsaini/automiq-workflow/blob/main/client/src/App.tsx) (React application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Workspace client"]
  node_web["React application<br/>[App.tsx]"]
  node_authpages["Sign-in pages<br/>[LoginPage.tsx]"]
  node_workflowui["Workflow editor"]
  node_executionui["Execution views<br/>[ExecutionsPage.tsx]"]
  node_authapi["Authentication API<br/>[auth.api.ts]"]
  node_workflowapi["Workflow API<br/>[workflows.api.ts]"]
  node_executionapi["Execution API<br/>[executions.api.ts]"]
end

subgraph group_identity["Identity and projects"]
  node_authrouter["Auth routes<br/>[AuthRouter.ts]"]
  node_authservice["Authentication service<br/>[AuthService.ts]"]
  node_authmiddleware["JWT and role checks<br/>[AuthMiddleware.ts]"]
  node_projectroutes["Project routes<br/>[ProjectsRouter.ts]"]
  node_projectservice["Project and membership<br/>[ProjectService.ts]"]
  node_email["Invitation email<br/>[EmailService.ts]"]
end

subgraph group_workflow["Workflow lifecycle"]
  node_workflowroutes["Workflow routes<br/>[WorkflowsRouter.ts]"]
  node_webhookroutes["Webhook routes<br/>[WebhookRouter.ts]"]
  node_active["Trigger registration"]
end

subgraph group_runtime["Execution runtime"]
  node_webhooknode["Webhook trigger<br/>[WebhookNode.ts]"]
  node_registry["Node type registry<br/>[NodeTypes.ts]"]
  node_engine["Workflow execution engine<br/>[WorkfowExecute.ts]"]
  node_executionservice["Execution orchestration"]
  node_scaling["Queue scaling<br/>[ScalingService.ts]"]
end

subgraph group_persistence["Persistence"]
  node_workflowrepo["Workflow repository"]
  node_executionrepo["Execution repository"]
  node_database[("PostgreSQL")]
end

node_user(("Workspace user"))

node_user -->|"uses"| node_web
node_web -->|"shows"| node_authpages
node_web -->|"shows"| node_workflowui
node_web -->|"shows"| node_executionui
node_authpages -.->|"submits credentials"| node_authapi
node_authapi -->|"HTTP requests"| node_authrouter
node_workflowui -.->|"edits workflows"| node_workflowapi
node_workflowapi -->|"HTTP requests"| node_workflowroutes
node_executionui -.->|"loads executions"| node_executionapi
node_executionapi -.->|"HTTP requests"| node_workflowroutes
node_authrouter -->|"calls"| node_authservice
node_authrouter -->|"calls"| node_projectservice
node_authmiddleware -->|"verifies token"| node_authservice
node_projectroutes -->|"calls"| node_projectservice
node_projectservice -->|"sends invitations"| node_email
node_workflowroutes -->|"reads and writes"| node_workflowrepo
node_workflowroutes -->|"activates workflows"| node_active
node_workflowroutes -->|"starts runs"| node_executionservice
node_webhookroutes -->|"finds trigger"| node_active
node_webhookroutes -->|"builds trigger data"| node_webhooknode
node_webhookroutes -->|"starts runs"| node_executionservice
node_active -->|"loads workflow"| node_workflowrepo
node_active -->|"resolves trigger"| node_registry
node_active -->|"runs scheduled workflow"| node_executionservice
node_registry -->|"registers type"| node_webhooknode
node_executionservice -->|"records execution"| node_executionrepo
node_executionservice -->|"runs inline"| node_engine
node_executionservice -->|"enqueues optional run"| node_scaling
node_executionrepo -.->|"reads and writes"| node_database
node_workflowrepo -.->|"reads and writes"| node_database

click node_web "https://github.com/ibharatsaini/automiq-workflow/blob/main/client/src/App.tsx"
click node_authpages "https://github.com/ibharatsaini/automiq-workflow/blob/main/client/src/features/auth/LoginPage.tsx"
click node_workflowui "https://github.com/ibharatsaini/automiq-workflow/blob/main/client/src/features/workflows/WorkflowDetailPage.tsx"
click node_executionui "https://github.com/ibharatsaini/automiq-workflow/blob/main/client/src/features/executions/ExecutionsPage.tsx"
click node_authapi "https://github.com/ibharatsaini/automiq-workflow/blob/main/client/src/api/auth.api.ts"
click node_workflowapi "https://github.com/ibharatsaini/automiq-workflow/blob/main/client/src/api/workflows.api.ts"
click node_executionapi "https://github.com/ibharatsaini/automiq-workflow/blob/main/client/src/api/executions.api.ts"
click node_authrouter "https://github.com/ibharatsaini/automiq-workflow/blob/main/src/routes/AuthRouter.ts"
click node_authservice "https://github.com/ibharatsaini/automiq-workflow/blob/main/src/services/AuthService.ts"
click node_authmiddleware "https://github.com/ibharatsaini/automiq-workflow/blob/main/src/middleware/AuthMiddleware.ts"
click node_projectroutes "https://github.com/ibharatsaini/automiq-workflow/blob/main/src/routes/ProjectsRouter.ts"
click node_projectservice "https://github.com/ibharatsaini/automiq-workflow/blob/main/src/services/ProjectService.ts"
click node_email "https://github.com/ibharatsaini/automiq-workflow/blob/main/src/services/EmailService.ts"
click node_workflowroutes "https://github.com/ibharatsaini/automiq-workflow/blob/main/src/routes/WorkflowsRouter.ts"
click node_webhookroutes "https://github.com/ibharatsaini/automiq-workflow/blob/main/src/routes/WebhookRouter.ts"
click node_active "https://github.com/ibharatsaini/automiq-workflow/blob/main/src/services/ActiveWorkflowManager.ts"
click node_workflowrepo "https://github.com/ibharatsaini/automiq-workflow/blob/main/src/repositories/WorkflowRepository.ts"
click node_webhooknode "https://github.com/ibharatsaini/automiq-workflow/blob/main/src/node-types/WebhookNode.ts"
click node_registry "https://github.com/ibharatsaini/automiq-workflow/blob/main/src/node-types/NodeTypes.ts"
click node_engine "https://github.com/ibharatsaini/automiq-workflow/blob/main/src/services/WorkfowExecute.ts"
click node_executionservice "https://github.com/ibharatsaini/automiq-workflow/blob/main/src/services/WorkflowExecutionService.ts"
click node_scaling "https://github.com/ibharatsaini/automiq-workflow/blob/main/src/scaling/ScalingService.ts"
click node_executionrepo "https://github.com/ibharatsaini/automiq-workflow/blob/main/src/repositories/ExecutionRepository.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_web,node_authpages,node_workflowui,node_executionui,node_authapi,node_workflowapi,node_executionapi,node_user toneBlue
class node_authrouter,node_authservice,node_authmiddleware,node_projectroutes,node_projectservice,node_email toneAmber
class node_workflowroutes,node_webhookroutes,node_active toneMint
class node_webhooknode,node_registry,node_engine,node_executionservice,node_scaling toneRose
class node_workflowrepo,node_executionrepo,node_database toneIndigo
```

## Components

### Workspace client

- [React application](https://github.com/ibharatsaini/automiq-workflow/blob/main/client/src/App.tsx): `client/src/App.tsx`
- [Sign-in pages](https://github.com/ibharatsaini/automiq-workflow/blob/main/client/src/features/auth/LoginPage.tsx): `client/src/features/auth/LoginPage.tsx`
- [Workflow editor](https://github.com/ibharatsaini/automiq-workflow/blob/main/client/src/features/workflows/WorkflowDetailPage.tsx): `client/src/features/workflows/WorkflowDetailPage.tsx`
- [Execution views](https://github.com/ibharatsaini/automiq-workflow/blob/main/client/src/features/executions/ExecutionsPage.tsx): `client/src/features/executions/ExecutionsPage.tsx`
- [Authentication API](https://github.com/ibharatsaini/automiq-workflow/blob/main/client/src/api/auth.api.ts): `client/src/api/auth.api.ts`
- [Workflow API](https://github.com/ibharatsaini/automiq-workflow/blob/main/client/src/api/workflows.api.ts): `client/src/api/workflows.api.ts`
- [Execution API](https://github.com/ibharatsaini/automiq-workflow/blob/main/client/src/api/executions.api.ts): `client/src/api/executions.api.ts`

### Identity and projects

- [Auth routes](https://github.com/ibharatsaini/automiq-workflow/blob/main/src/routes/AuthRouter.ts): `src/routes/AuthRouter.ts`
- [Authentication service](https://github.com/ibharatsaini/automiq-workflow/blob/main/src/services/AuthService.ts): `src/services/AuthService.ts`
- [JWT and role checks](https://github.com/ibharatsaini/automiq-workflow/blob/main/src/middleware/AuthMiddleware.ts): `src/middleware/AuthMiddleware.ts`
- [Project routes](https://github.com/ibharatsaini/automiq-workflow/blob/main/src/routes/ProjectsRouter.ts): `src/routes/ProjectsRouter.ts`
- [Project and membership](https://github.com/ibharatsaini/automiq-workflow/blob/main/src/services/ProjectService.ts): `src/services/ProjectService.ts`
- [Invitation email](https://github.com/ibharatsaini/automiq-workflow/blob/main/src/services/EmailService.ts): `src/services/EmailService.ts`

### Workflow lifecycle

- [Workflow routes](https://github.com/ibharatsaini/automiq-workflow/blob/main/src/routes/WorkflowsRouter.ts): `src/routes/WorkflowsRouter.ts`
- [Webhook routes](https://github.com/ibharatsaini/automiq-workflow/blob/main/src/routes/WebhookRouter.ts): `src/routes/WebhookRouter.ts`
- [Trigger registration](https://github.com/ibharatsaini/automiq-workflow/blob/main/src/services/ActiveWorkflowManager.ts): `src/services/ActiveWorkflowManager.ts`

### Execution runtime

- [Webhook trigger](https://github.com/ibharatsaini/automiq-workflow/blob/main/src/node-types/WebhookNode.ts): `src/node-types/WebhookNode.ts`
- [Node type registry](https://github.com/ibharatsaini/automiq-workflow/blob/main/src/node-types/NodeTypes.ts): `src/node-types/NodeTypes.ts`
- [Workflow execution engine](https://github.com/ibharatsaini/automiq-workflow/blob/main/src/services/WorkfowExecute.ts): `src/services/WorkfowExecute.ts`
- [Execution orchestration](https://github.com/ibharatsaini/automiq-workflow/blob/main/src/services/WorkflowExecutionService.ts): `src/services/WorkflowExecutionService.ts`
- [Queue scaling](https://github.com/ibharatsaini/automiq-workflow/blob/main/src/scaling/ScalingService.ts): `src/scaling/ScalingService.ts`

### Persistence

- [Workflow repository](https://github.com/ibharatsaini/automiq-workflow/blob/main/src/repositories/WorkflowRepository.ts): `src/repositories/WorkflowRepository.ts`
- [Execution repository](https://github.com/ibharatsaini/automiq-workflow/blob/main/src/repositories/ExecutionRepository.ts): `src/repositories/ExecutionRepository.ts`
- **PostgreSQL**

### Other components

- **Workspace user**

## Connections

- Workspace user → React application: uses
- React application → Sign-in pages: shows
- React application → Workflow editor: shows
- React application → Execution views: shows
- Sign-in pages → Authentication API: submits credentials
- Authentication API → Auth routes: HTTP requests
- Workflow editor → Workflow API: edits workflows
- Workflow API → Workflow routes: HTTP requests
- Execution views → Execution API: loads executions
- Execution API → Workflow routes: HTTP requests
- Auth routes → Authentication service: calls (evidence: `src/routes/AuthRouter.ts`)
- Auth routes → Project and membership: calls (evidence: `src/routes/AuthRouter.ts`)
- JWT and role checks → Authentication service: verifies token (evidence: `src/middleware/AuthMiddleware.ts`)
- Project routes → Project and membership: calls (evidence: `src/routes/ProjectsRouter.ts`)
- Project and membership → Invitation email: sends invitations (evidence: `src/services/ProjectService.ts`)
- Workflow routes → Workflow repository: reads and writes (evidence: `src/routes/WorkflowsRouter.ts`)
- Workflow routes → Trigger registration: activates workflows (evidence: `src/routes/WorkflowsRouter.ts`)
- Workflow routes → Execution orchestration: starts runs (evidence: `src/routes/WorkflowsRouter.ts`)
- Webhook routes → Trigger registration: finds trigger (evidence: `src/routes/WebhookRouter.ts`)
- Webhook routes → Webhook trigger: builds trigger data (evidence: `src/routes/WebhookRouter.ts`)
- Webhook routes → Execution orchestration: starts runs (evidence: `src/routes/WebhookRouter.ts`)
- Trigger registration → Workflow repository: loads workflow (evidence: `src/services/ActiveWorkflowManager.ts`)
- Trigger registration → Node type registry: resolves trigger (evidence: `src/services/ActiveWorkflowManager.ts`)
- Trigger registration → Execution orchestration: runs scheduled workflow (evidence: `src/services/ActiveWorkflowManager.ts`)
- Node type registry → Webhook trigger: registers type (evidence: `src/node-types/NodeTypes.ts`)
- Execution orchestration → Execution repository: records execution (evidence: `src/services/WorkflowExecutionService.ts`)
- Execution orchestration → Workflow execution engine: runs inline (evidence: `src/services/WorkflowExecutionService.ts`)
- Execution orchestration → Queue scaling: enqueues optional run (evidence: `src/services/WorkflowExecutionService.ts`)
- Execution repository → PostgreSQL: reads and writes
- Workflow repository → PostgreSQL: reads and writes
