# ali-repos/agentic_ai-flow architecture

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

- Interactive diagram: https://gitdiagram.com/ali-repos/agentic_ai-flow
- Repository: https://github.com/ali-repos/agentic_ai-flow

## Overview

Agentflow_AI turns an operator’s natural-language request into a visual workflow, then saves and runs that graph as a multi-agent automation. The documented execution stages are planning, step execution, output validation, recovery, and monitoring; operators can inspect live timelines and control runs. The README also describes encrypted SaaS integrations, notifications, dashboard metrics, and execution history. The excerpts confirm prompt compilation and orchestration calls; several other subsystem links reflect README capabilities and are shown only where their ownership is documented.

Main entry points: [`server/src/agents/orchestrator.js`](https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/agents/orchestrator.js) (Agent orchestrator), [`server/src/services/integrationService.js`](https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/services/integrationService.js) (Integration service), [`server/src/controllers/workflowController.js`](https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/controllers/workflowController.js) (Workflow controller), [`client/src/pages/workflows/builder.js`](https://github.com/ali-repos/agentic_ai-flow/blob/main/client/src/pages/workflows/builder.js) (Workflow builder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Operator interface"]
  node_workflow_ui["Workflow builder<br/>[builder.js]"]
  node_canvas["Visual editor<br/>[WorkflowCanvas.js]"]
  node_node_tools["Node palette and config<br/>[NodePalette.js]"]
  node_workflow_store["Workflow state<br/>[workflowStore.js]"]
  node_execution_ui["Execution timeline<br/>[&#91;id&#93;.js]"]
  node_api_client["API client<br/>[api.js]"]
  node_socket_client["Live event client<br/>[socket.js]"]
end

subgraph group_api["API and workflow domain"]
  node_server["Express API<br/>[index.js]"]
  node_workflow_routes["Workflow routes<br/>[workflowRoutes.js]"]
  node_workflow_controller["Workflow controller"]
  node_workflow_service["Workflow service<br/>[workflowService.js]"]
  node_ai_service["Prompt compiler<br/>[aiService.js]"]
  node_execution_service["Execution service"]
  node_queue["Execution queue<br/>[executionQueue.js]"]
end

subgraph group_agents["Execution orchestration"]
  node_orchestrator["Agent orchestrator<br/>[orchestrator.js]"]
  node_planner["Planner agent<br/>[plannerAgent.js]"]
  node_executor["Execution agent<br/>[executionAgent.js]"]
  node_validator["Validation agent<br/>[validationAgent.js]"]
  node_recovery["Recovery agent<br/>[recoveryAgent.js]"]
  node_monitor["Monitoring agent<br/>[monitoringAgent.js]"]
end

subgraph group_connectors["Integrations"]
  node_integration_service["Integration service"]
  node_gmail["Gmail connector"]
  node_slack["Slack connector"]
  node_discord["Discord connector"]
  node_sheets["Sheets connector"]
end

subgraph group_state["Persistence and events"]
  node_database[("MongoDB<br/>[db.js]")]
  node_execution_model[("Execution records<br/>[Execution.js]")]
  node_audit_models[("Logs and agent memory<br/>[ExecutionLog.js]")]
  node_notifications["Notification service"]
  node_socket_server["Socket.IO server<br/>[socket.js]"]
end

node_operator(("Operator"))
node_provider{{"AI providers"}}
node_saas{{"SaaS services"}}

node_operator -->|"describe workflow"| node_workflow_ui
node_workflow_ui -->|"submit prompt"| node_api_client
node_workflow_ui -->|"edit graph"| node_canvas
node_node_tools -->|"configure nodes"| node_canvas
node_canvas -->|"update graph"| node_workflow_store
node_api_client -->|"HTTP requests"| node_server
node_server -->|"dispatch routes"| node_workflow_routes
node_workflow_routes -->|"invoke handlers"| node_workflow_controller
node_workflow_controller -->|"generate graph"| node_ai_service
node_workflow_controller -->|"manage workflows"| node_workflow_service
node_workflow_controller -->|"trigger execution"| node_execution_service
node_ai_service -.->|"request generation"| node_provider
node_execution_service -->|"enqueue run"| node_queue
node_queue -->|"dispatch run"| node_orchestrator
node_orchestrator -->|"load and update"| node_execution_model
node_orchestrator -->|"plan graph"| node_planner
node_orchestrator -->|"execute steps"| node_executor
node_orchestrator -->|"validate outputs"| node_validator
node_orchestrator -->|"handle failures"| node_recovery
node_orchestrator -->|"record run events"| node_monitor
node_executor -->|"invoke integrations"| node_integration_service
node_integration_service -->|"dispatch actions"| node_gmail
node_integration_service -->|"dispatch actions"| node_slack
node_integration_service -->|"dispatch actions"| node_discord
node_integration_service -->|"dispatch actions"| node_sheets
node_gmail -->|"call Gmail"| node_saas
node_slack -->|"call Slack"| node_saas
node_discord -->|"call Discord"| node_saas
node_sheets -->|"call Sheets"| node_saas
node_monitor -->|"persist timeline"| node_audit_models
node_monitor -->|"broadcast events"| node_socket_server
node_socket_server -->|"stream events"| node_socket_client
node_socket_client -->|"update timeline"| node_execution_ui
node_orchestrator -->|"create run alerts"| node_notifications
node_workflow_service -->|"read and write workflows"| node_database
node_execution_model -->|"persist executions"| node_database

click node_workflow_ui "https://github.com/ali-repos/agentic_ai-flow/blob/main/client/src/pages/workflows/builder.js"
click node_canvas "https://github.com/ali-repos/agentic_ai-flow/blob/main/client/src/components/WorkflowCanvas/WorkflowCanvas.js"
click node_node_tools "https://github.com/ali-repos/agentic_ai-flow/blob/main/client/src/components/NodePalette/NodePalette.js"
click node_workflow_store "https://github.com/ali-repos/agentic_ai-flow/blob/main/client/src/store/workflowStore.js"
click node_execution_ui "https://github.com/ali-repos/agentic_ai-flow/blob/main/client/src/pages/executions/%5Bid%5D.js"
click node_api_client "https://github.com/ali-repos/agentic_ai-flow/blob/main/client/src/services/api.js"
click node_socket_client "https://github.com/ali-repos/agentic_ai-flow/blob/main/client/src/services/socket.js"
click node_server "https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/index.js"
click node_workflow_routes "https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/routes/workflowRoutes.js"
click node_workflow_controller "https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/controllers/workflowController.js"
click node_workflow_service "https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/services/workflowService.js"
click node_ai_service "https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/services/aiService.js"
click node_execution_service "https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/services/executionService.js"
click node_queue "https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/queues/executionQueue.js"
click node_orchestrator "https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/agents/orchestrator.js"
click node_planner "https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/agents/plannerAgent.js"
click node_executor "https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/agents/executionAgent.js"
click node_validator "https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/agents/validationAgent.js"
click node_recovery "https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/agents/recoveryAgent.js"
click node_monitor "https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/agents/monitoringAgent.js"
click node_integration_service "https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/services/integrationService.js"
click node_gmail "https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/integrations/gmailIntegration.js"
click node_slack "https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/integrations/slackIntegration.js"
click node_discord "https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/integrations/discordIntegration.js"
click node_sheets "https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/integrations/googleSheetsIntegration.js"
click node_database "https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/config/db.js"
click node_execution_model "https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/models/Execution.js"
click node_audit_models "https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/models/ExecutionLog.js"
click node_notifications "https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/services/notificationService.js"
click node_socket_server "https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/config/socket.js"

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_workflow_ui,node_canvas,node_node_tools,node_workflow_store,node_execution_ui,node_api_client,node_socket_client toneBlue
class node_server,node_workflow_routes,node_workflow_controller,node_workflow_service,node_ai_service,node_execution_service,node_queue toneAmber
class node_orchestrator,node_planner,node_executor,node_validator,node_recovery,node_monitor toneMint
class node_integration_service,node_gmail,node_slack,node_discord,node_sheets toneRose
class node_database,node_execution_model,node_audit_models,node_notifications,node_socket_server,node_operator,node_provider,node_saas toneIndigo
```

## Components

### Operator interface

- [Workflow builder](https://github.com/ali-repos/agentic_ai-flow/blob/main/client/src/pages/workflows/builder.js): `client/src/pages/workflows/builder.js`
- [Visual editor](https://github.com/ali-repos/agentic_ai-flow/blob/main/client/src/components/WorkflowCanvas/WorkflowCanvas.js): `client/src/components/WorkflowCanvas/WorkflowCanvas.js`
- [Node palette and config](https://github.com/ali-repos/agentic_ai-flow/blob/main/client/src/components/NodePalette/NodePalette.js): `client/src/components/NodePalette/NodePalette.js`
- [Workflow state](https://github.com/ali-repos/agentic_ai-flow/blob/main/client/src/store/workflowStore.js): `client/src/store/workflowStore.js`
- [Execution timeline](https://github.com/ali-repos/agentic_ai-flow/blob/main/client/src/pages/executions/%5Bid%5D.js): `client/src/pages/executions/[id].js`
- [API client](https://github.com/ali-repos/agentic_ai-flow/blob/main/client/src/services/api.js): `client/src/services/api.js`
- [Live event client](https://github.com/ali-repos/agentic_ai-flow/blob/main/client/src/services/socket.js): `client/src/services/socket.js`

### API and workflow domain

- [Express API](https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/index.js): `server/src/index.js`
- [Workflow routes](https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/routes/workflowRoutes.js): `server/src/routes/workflowRoutes.js`
- [Workflow controller](https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/controllers/workflowController.js): `server/src/controllers/workflowController.js`
- [Workflow service](https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/services/workflowService.js): `server/src/services/workflowService.js`
- [Prompt compiler](https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/services/aiService.js): `server/src/services/aiService.js`
- [Execution service](https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/services/executionService.js): `server/src/services/executionService.js`
- [Execution queue](https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/queues/executionQueue.js): `server/src/queues/executionQueue.js`

### Execution orchestration

- [Agent orchestrator](https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/agents/orchestrator.js): `server/src/agents/orchestrator.js`
- [Planner agent](https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/agents/plannerAgent.js): `server/src/agents/plannerAgent.js`
- [Execution agent](https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/agents/executionAgent.js): `server/src/agents/executionAgent.js`
- [Validation agent](https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/agents/validationAgent.js): `server/src/agents/validationAgent.js`
- [Recovery agent](https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/agents/recoveryAgent.js): `server/src/agents/recoveryAgent.js`
- [Monitoring agent](https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/agents/monitoringAgent.js): `server/src/agents/monitoringAgent.js`

### Integrations

- [Integration service](https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/services/integrationService.js): `server/src/services/integrationService.js`
- [Gmail connector](https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/integrations/gmailIntegration.js): `server/src/integrations/gmailIntegration.js`
- [Slack connector](https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/integrations/slackIntegration.js): `server/src/integrations/slackIntegration.js`
- [Discord connector](https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/integrations/discordIntegration.js): `server/src/integrations/discordIntegration.js`
- [Sheets connector](https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/integrations/googleSheetsIntegration.js): `server/src/integrations/googleSheetsIntegration.js`

### Persistence and events

- [MongoDB](https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/config/db.js): `server/src/config/db.js`
- [Execution records](https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/models/Execution.js): `server/src/models/Execution.js`
- [Logs and agent memory](https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/models/ExecutionLog.js): `server/src/models/ExecutionLog.js`
- [Notification service](https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/services/notificationService.js): `server/src/services/notificationService.js`
- [Socket.IO server](https://github.com/ali-repos/agentic_ai-flow/blob/main/server/src/config/socket.js): `server/src/config/socket.js`

### Other components

- **Operator**
- **AI providers**
- **SaaS services**

## Connections

- Operator → Workflow builder: describe workflow
- Workflow builder → API client: submit prompt
- Workflow builder → Visual editor: edit graph
- Node palette and config → Visual editor: configure nodes
- Visual editor → Workflow state: update graph
- API client → Express API: HTTP requests
- Express API → Workflow routes: dispatch routes
- Workflow routes → Workflow controller: invoke handlers
- Workflow controller → Prompt compiler: generate graph
- Workflow controller → Workflow service: manage workflows
- Workflow controller → Execution service: trigger execution
- Prompt compiler → AI providers: request generation
- Execution service → Execution queue: enqueue run
- Execution queue → Agent orchestrator: dispatch run
- Agent orchestrator → Execution records: load and update
- Agent orchestrator → Planner agent: plan graph
- Agent orchestrator → Execution agent: execute steps
- Agent orchestrator → Validation agent: validate outputs
- Agent orchestrator → Recovery agent: handle failures
- Agent orchestrator → Monitoring agent: record run events
- Execution agent → Integration service: invoke integrations
- Integration service → Gmail connector: dispatch actions
- Integration service → Slack connector: dispatch actions
- Integration service → Discord connector: dispatch actions
- Integration service → Sheets connector: dispatch actions
- Gmail connector → SaaS services: call Gmail
- Slack connector → SaaS services: call Slack
- Discord connector → SaaS services: call Discord
- Sheets connector → SaaS services: call Sheets
- Monitoring agent → Logs and agent memory: persist timeline
- Monitoring agent → Socket.IO server: broadcast events
- Socket.IO server → Live event client: stream events
- Live event client → Execution timeline: update timeline
- Agent orchestrator → Notification service: create run alerts
- Workflow service → MongoDB: read and write workflows
- Execution records → MongoDB: persist executions
