# rambuildsdev/synchive architecture

> Architecture diagram of the GitHub repository rambuildsdev/synchive, 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/rambuildsdev/synchive
- Repository: https://github.com/rambuildsdev/synchive

## Overview

SyncHive is a self-hosted visual workflow automation platform. Users build and activate workflows in the web editor; the gateway stores workflow definitions and queues manual or webhook-triggered executions; workers evaluate the DAG and run integrations; execution events return to the gateway for live monitoring. Scheduled triggers and the editor, execution history, and integrations pages are additional documented capabilities. The README and source index establish the service boundaries, but unsampled files limit detail on some UI, scheduler, and persistence relationships.

Main entry points: [`apps/api-gateway/src/app.ts`](https://github.com/rambuildsdev/synchive/blob/main/apps/api-gateway/src/app.ts) (API gateway), [`packages/db/src/connection.ts`](https://github.com/rambuildsdev/synchive/blob/main/packages/db/src/connection.ts) (PostgreSQL data), [`packages/queue/src/connection.ts`](https://github.com/rambuildsdev/synchive/blob/main/packages/queue/src/connection.ts) (BullMQ and Redis), [`apps/web/src/App.tsx`](https://github.com/rambuildsdev/synchive/blob/main/apps/web/src/App.tsx) (Web app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_web["Web app<br/>[App.tsx]"]
  node_editor["Visual editor<br/>[EditorPage.tsx]"]
  node_monitoring["Execution monitoring<br/>[ExecutionsPage.tsx]"]
end

subgraph group_gateway["API gateway"]
  node_gateway["API gateway<br/>[app.ts]"]
  node_auth["Authentication<br/>[auth.service.ts]"]
  node_workflow_api["Workflow management<br/>[workflow.routes.ts]"]
  node_webhook_api["Webhook receiver<br/>[webhook.routes.ts]"]
  node_execution_api["Execution API and SSE"]
  node_scheduler_api["Schedule management"]
end

subgraph group_execution["Workflow execution"]
  node_worker["Queue worker<br/>[index.ts]"]
  node_workflow_executor["Workflow orchestrator"]
  node_dag["DAG execution plan<br/>[dag.ts]"]
  node_node_executor["Node execution<br/>[node-executor.ts]"]
  node_integrations["External actions<br/>[openai.ts]"]
end

subgraph group_scheduling["Scheduling"]
  node_scheduler["Cron manager<br/>[scheduler.ts]"]
end

subgraph group_shared["Shared infrastructure"]
  node_database[("PostgreSQL data<br/>[connection.ts]")]
  node_queue["BullMQ and Redis<br/>[connection.ts]"]
  node_pubsub["Execution event pub/sub<br/>[pubsub.ts]"]
  node_schema["Workflow and execution schema<br/>[workflows.ts]"]
end

node_user(("Workflow user"))

node_user -->|"uses"| node_web
node_web -->|"opens editor"| node_editor
node_web -->|"opens history"| node_monitoring
node_web -->|"REST and SSE"| node_gateway
node_gateway -->|"routes authentication"| node_auth
node_gateway -->|"routes workflows"| node_workflow_api
node_gateway -->|"routes webhooks"| node_webhook_api
node_gateway -->|"routes executions"| node_execution_api
node_gateway -->|"routes schedules"| node_scheduler_api
node_workflow_api -->|"reads and writes"| node_database
node_workflow_api -->|"enqueues runs"| node_queue
node_webhook_api -->|"loads workflow"| node_database
node_webhook_api -->|"enqueues run"| node_queue
node_execution_api -->|"reads executions"| node_database
node_execution_api -->|"enqueues retry"| node_queue
node_execution_api -->|"subscribes to events"| node_pubsub
node_scheduler_api -->|"manages schedules"| node_database
node_scheduler -->|"loads schedules"| node_database
node_scheduler -->|"queues scheduled runs"| node_queue
node_queue -->|"delivers jobs"| node_worker
node_worker -->|"runs workflow"| node_workflow_executor
node_workflow_executor -->|"builds execution plan"| node_dag
node_workflow_executor -->|"executes nodes"| node_node_executor
node_node_executor -->|"calls actions"| node_integrations
node_workflow_executor -->|"publishes events"| node_pubsub
node_pubsub -->|"uses Redis"| node_queue
node_database -->|"loads schema"| node_schema

click node_web "https://github.com/rambuildsdev/synchive/blob/main/apps/web/src/App.tsx"
click node_editor "https://github.com/rambuildsdev/synchive/blob/main/apps/web/src/pages/EditorPage.tsx"
click node_monitoring "https://github.com/rambuildsdev/synchive/blob/main/apps/web/src/pages/ExecutionsPage.tsx"
click node_gateway "https://github.com/rambuildsdev/synchive/blob/main/apps/api-gateway/src/app.ts"
click node_auth "https://github.com/rambuildsdev/synchive/blob/main/apps/api-gateway/src/services/auth.service.ts"
click node_workflow_api "https://github.com/rambuildsdev/synchive/blob/main/apps/api-gateway/src/routes/workflow.routes.ts"
click node_webhook_api "https://github.com/rambuildsdev/synchive/blob/main/apps/api-gateway/src/routes/webhook.routes.ts"
click node_execution_api "https://github.com/rambuildsdev/synchive/blob/main/apps/api-gateway/src/routes/execution.routes.ts"
click node_scheduler_api "https://github.com/rambuildsdev/synchive/blob/main/apps/api-gateway/src/routes/scheduler.routes.ts"
click node_scheduler "https://github.com/rambuildsdev/synchive/blob/main/apps/Scheduler/src/scheduler.ts"
click node_worker "https://github.com/rambuildsdev/synchive/blob/main/apps/workflow-engine/src/workers/index.ts"
click node_workflow_executor "https://github.com/rambuildsdev/synchive/blob/main/apps/workflow-engine/src/executor/workflow-executor.ts"
click node_dag "https://github.com/rambuildsdev/synchive/blob/main/apps/workflow-engine/src/executor/dag.ts"
click node_node_executor "https://github.com/rambuildsdev/synchive/blob/main/apps/workflow-engine/src/executor/node-executor.ts"
click node_integrations "https://github.com/rambuildsdev/synchive/blob/main/apps/workflow-engine/src/executor/integrations/openai.ts"
click node_database "https://github.com/rambuildsdev/synchive/blob/main/packages/db/src/connection.ts"
click node_queue "https://github.com/rambuildsdev/synchive/blob/main/packages/queue/src/connection.ts"
click node_pubsub "https://github.com/rambuildsdev/synchive/blob/main/packages/queue/src/pubsub.ts"
click node_schema "https://github.com/rambuildsdev/synchive/blob/main/packages/db/src/schema/workflows.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_editor,node_monitoring,node_user toneBlue
class node_gateway,node_auth,node_workflow_api,node_webhook_api,node_execution_api,node_scheduler_api toneAmber
class node_worker,node_workflow_executor,node_dag,node_node_executor,node_integrations toneMint
class node_scheduler toneRose
class node_database,node_queue,node_pubsub,node_schema toneIndigo
```

## Components

### Web application

- [Web app](https://github.com/rambuildsdev/synchive/blob/main/apps/web/src/App.tsx): `apps/web/src/App.tsx`
- [Visual editor](https://github.com/rambuildsdev/synchive/blob/main/apps/web/src/pages/EditorPage.tsx): `apps/web/src/pages/EditorPage.tsx`
- [Execution monitoring](https://github.com/rambuildsdev/synchive/blob/main/apps/web/src/pages/ExecutionsPage.tsx): `apps/web/src/pages/ExecutionsPage.tsx`

### API gateway

- [API gateway](https://github.com/rambuildsdev/synchive/blob/main/apps/api-gateway/src/app.ts): `apps/api-gateway/src/app.ts`
- [Authentication](https://github.com/rambuildsdev/synchive/blob/main/apps/api-gateway/src/services/auth.service.ts): `apps/api-gateway/src/services/auth.service.ts`
- [Workflow management](https://github.com/rambuildsdev/synchive/blob/main/apps/api-gateway/src/routes/workflow.routes.ts): `apps/api-gateway/src/routes/workflow.routes.ts`
- [Webhook receiver](https://github.com/rambuildsdev/synchive/blob/main/apps/api-gateway/src/routes/webhook.routes.ts): `apps/api-gateway/src/routes/webhook.routes.ts`
- [Execution API and SSE](https://github.com/rambuildsdev/synchive/blob/main/apps/api-gateway/src/routes/execution.routes.ts): `apps/api-gateway/src/routes/execution.routes.ts`
- [Schedule management](https://github.com/rambuildsdev/synchive/blob/main/apps/api-gateway/src/routes/scheduler.routes.ts): `apps/api-gateway/src/routes/scheduler.routes.ts`

### Workflow execution

- [Queue worker](https://github.com/rambuildsdev/synchive/blob/main/apps/workflow-engine/src/workers/index.ts): `apps/workflow-engine/src/workers/index.ts`
- [Workflow orchestrator](https://github.com/rambuildsdev/synchive/blob/main/apps/workflow-engine/src/executor/workflow-executor.ts): `apps/workflow-engine/src/executor/workflow-executor.ts`
- [DAG execution plan](https://github.com/rambuildsdev/synchive/blob/main/apps/workflow-engine/src/executor/dag.ts): `apps/workflow-engine/src/executor/dag.ts`
- [Node execution](https://github.com/rambuildsdev/synchive/blob/main/apps/workflow-engine/src/executor/node-executor.ts): `apps/workflow-engine/src/executor/node-executor.ts`
- [External actions](https://github.com/rambuildsdev/synchive/blob/main/apps/workflow-engine/src/executor/integrations/openai.ts): `apps/workflow-engine/src/executor/integrations/openai.ts`

### Scheduling

- [Cron manager](https://github.com/rambuildsdev/synchive/blob/main/apps/Scheduler/src/scheduler.ts): `apps/Scheduler/src/scheduler.ts`

### Shared infrastructure

- [PostgreSQL data](https://github.com/rambuildsdev/synchive/blob/main/packages/db/src/connection.ts): `packages/db/src/connection.ts`
- [BullMQ and Redis](https://github.com/rambuildsdev/synchive/blob/main/packages/queue/src/connection.ts): `packages/queue/src/connection.ts`
- [Execution event pub/sub](https://github.com/rambuildsdev/synchive/blob/main/packages/queue/src/pubsub.ts): `packages/queue/src/pubsub.ts`
- [Workflow and execution schema](https://github.com/rambuildsdev/synchive/blob/main/packages/db/src/schema/workflows.ts): `packages/db/src/schema/workflows.ts`

### Other components

- **Workflow user**

## Connections

- Workflow user → Web app: uses (evidence: `README.md`)
- Web app → Visual editor: opens editor (evidence: `apps/web/src/App.tsx`)
- Web app → Execution monitoring: opens history (evidence: `apps/web/src/App.tsx`)
- Web app → API gateway: REST and SSE (evidence: `README.md`)
- API gateway → Authentication: routes authentication
- API gateway → Workflow management: routes workflows (evidence: `apps/api-gateway/src/app.ts`)
- API gateway → Webhook receiver: routes webhooks (evidence: `apps/api-gateway/src/app.ts`)
- API gateway → Execution API and SSE: routes executions (evidence: `apps/api-gateway/src/app.ts`)
- API gateway → Schedule management: routes schedules (evidence: `apps/api-gateway/src/app.ts`)
- Workflow management → PostgreSQL data: reads and writes (evidence: `apps/api-gateway/src/routes/workflow.routes.ts`)
- Workflow management → BullMQ and Redis: enqueues runs (evidence: `apps/api-gateway/src/routes/workflow.routes.ts`)
- Webhook receiver → PostgreSQL data: loads workflow (evidence: `apps/api-gateway/src/routes/webhook.routes.ts`)
- Webhook receiver → BullMQ and Redis: enqueues run (evidence: `apps/api-gateway/src/routes/webhook.routes.ts`)
- Execution API and SSE → PostgreSQL data: reads executions (evidence: `apps/api-gateway/src/routes/execution.routes.ts`)
- Execution API and SSE → BullMQ and Redis: enqueues retry (evidence: `apps/api-gateway/src/routes/execution.routes.ts`)
- Execution API and SSE → Execution event pub/sub: subscribes to events (evidence: `apps/api-gateway/src/routes/execution.routes.ts`)
- Schedule management → PostgreSQL data: manages schedules (evidence: `apps/api-gateway/src/routes/scheduler.routes.ts`)
- Cron manager → PostgreSQL data: loads schedules (evidence: `apps/Scheduler/src/scheduler.ts`)
- Cron manager → BullMQ and Redis: queues scheduled runs (evidence: `apps/Scheduler/src/scheduler.ts`)
- BullMQ and Redis → Queue worker: delivers jobs (evidence: `README.md`)
- Queue worker → Workflow orchestrator: runs workflow (evidence: `apps/workflow-engine/src/workers/index.ts`)
- Workflow orchestrator → DAG execution plan: builds execution plan (evidence: `apps/workflow-engine/src/executor/workflow-executor.ts`)
- Workflow orchestrator → Node execution: executes nodes (evidence: `apps/workflow-engine/src/executor/workflow-executor.ts`)
- Node execution → External actions: calls actions (evidence: `apps/workflow-engine/src/executor/node-executor.ts`)
- Workflow orchestrator → Execution event pub/sub: publishes events (evidence: `apps/workflow-engine/src/executor/workflow-executor.ts`)
- Execution event pub/sub → BullMQ and Redis: uses Redis (evidence: `packages/queue/src/pubsub.ts`)
- PostgreSQL data → Workflow and execution schema: loads schema (evidence: `packages/db/src/connection.ts`)
