# tencentblueking/bk-sops architecture

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

- Interactive diagram: https://gitdiagram.com/tencentblueking/bk-sops
- Repository: https://github.com/tencentblueking/bk-sops

## Overview

BlueKing SOPS is a visual operations workflow authoring and execution SaaS. Its principal path is users composing a template, turning it into a task, then controlling and inspecting execution; it also provides reusable plugins, self-service apps, scheduled work, access control, and operational integrations. The graph captures documented capabilities and source-visible calls, while several unsampled subsystems are represented only at their exact enclosing directories. Some relationships are necessarily documented or unverified because the excerpts do not expose their runtime wiring.

Main entry points: [`gcloud/taskflow3/models.py`](https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/gcloud/taskflow3/models.py) (Task orchestration), [`gcloud/template_base/domains/template_manager.py`](https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/gcloud/template_base/domains/template_manager.py) (Template manager), [`frontend/desktop/src/pages/template/TemplateEdit/index.vue`](https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/frontend/desktop/src/pages/template/TemplateEdit/index.vue) (Template editor), [`frontend/desktop/src/pages/task/TaskExecute/index.vue`](https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/frontend/desktop/src/pages/task/TaskExecute/index.vue) (Execution controls)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_authoring["Workflow authoring"]
  node_desktop["SOPS desktop<br/>[App.vue]"]
  node_template_ui["Template editor<br/>[index.vue]"]
  node_canvas["Workflow canvas<br/>[index.vue]"]
  node_template_manager["Template manager"]
  node_template_models[("Template records<br/>[models.py]")]
  node_pipeline_web[("Pipeline representation<br/>[models.py]")]
  node_template_cleaner["Tree validation<br/>[clean.py]"]
end

subgraph group_execution["Task execution"]
  node_task_ui["Task creation<br/>[index.vue]"]
  node_task_models[("Task orchestration<br/>[models.py]")]
  node_engine{{"Workflow engine"}}
  node_task_ui_exec["Execution controls<br/>[index.vue]"]
  node_node_logs["Node log API"]
  node_log_source["Log data source<br/>[node_log.py]"]
  node_periodic[("Scheduled tasks<br/>[models.py]")]
end

subgraph group_platform["Platform services"]
  node_statistics["Usage statistics<br/>[tasks.py]"]
  node_permissions["IAM permissions<br/>[res_factory.py]"]
  node_files[("File handling<br/>[models.py]")]
end

subgraph group_integrations["Plugins and integrations"]
  node_plugin_components["Plugin components<br/>[controller.py]"]
  node_cmdb_picker["CMDB host picker<br/>[query.py]"]
  node_nodeman["NodeMan client<br/>[nodeman.py]"]
  node_external_systems{{"BlueKing services"}}
end

subgraph group_selfservice["Self-service"]
  node_appmaker[("Light applications<br/>[models.py]")]
  node_frontend_appmaker["App maker UI<br/>[index.vue]"]
  node_common_templates[("Shared templates<br/>[models.py]")]
end

node_user(("Operator"))

node_user -->|"uses"| node_desktop
node_desktop -.->|"opens"| node_template_ui
node_template_ui -->|"edits flow"| node_canvas
node_template_manager -->|"cleans tree"| node_template_cleaner
node_template_manager -->|"persists tree"| node_pipeline_web
node_template_manager -.->|"creates template"| node_template_models
node_template_ui -.->|"saves template"| node_template_manager
node_user -->|"creates task"| node_task_ui
node_task_ui -.->|"starts task"| node_task_models
node_task_models -->|"creates instance"| node_engine
node_user -->|"controls run"| node_task_ui_exec
node_task_ui_exec -.->|"operates task"| node_task_models
node_task_models -->|"dispatches actions"| node_engine
node_task_ui_exec -.->|"requests logs"| node_node_logs
node_node_logs -->|"fetches logs"| node_log_source
node_node_logs -->|"authorizes task"| node_permissions
node_user -->|"uses self-service"| node_frontend_appmaker
node_frontend_appmaker -.->|"configures app"| node_appmaker
node_common_templates -.->|"shares workflows"| node_template_manager
node_periodic -.->|"schedules tasks"| node_task_models
node_task_models -.->|"records execution"| node_statistics
node_plugin_components -.->|"calls services"| node_external_systems
node_cmdb_picker -->|"queries hosts"| node_nodeman
node_nodeman -.->|"calls NodeMan"| node_external_systems
node_user -.->|"uploads files"| node_files

click node_desktop "https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/frontend/desktop/src/App.vue"
click node_template_ui "https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/frontend/desktop/src/pages/template/TemplateEdit/index.vue"
click node_canvas "https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/frontend/desktop/src/components/common/TemplateCanvas/index.vue"
click node_template_manager "https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/gcloud/template_base/domains/template_manager.py"
click node_template_models "https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/gcloud/tasktmpl3/models.py"
click node_pipeline_web "https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/pipeline_web/core/models.py"
click node_template_cleaner "https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/pipeline_web/parser/clean.py"
click node_task_ui "https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/frontend/desktop/src/pages/task/TaskCreate/index.vue"
click node_task_models "https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/gcloud/taskflow3/models.py"
click node_task_ui_exec "https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/frontend/desktop/src/pages/task/TaskExecute/index.vue"
click node_node_logs "https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/gcloud/taskflow3/apis/drf/viewsets/engine_v2_node_log.py"
click node_log_source "https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/gcloud/taskflow3/domains/node_log.py"
click node_periodic "https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/gcloud/periodictask/models.py"
click node_statistics "https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/gcloud/analysis_statistics/tasks.py"
click node_permissions "https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/gcloud/iam_auth/res_factory.py"
click node_plugin_components "https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/pipeline_plugins/components/collections/controller.py"
click node_cmdb_picker "https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/pipeline_plugins/cmdb_ip_picker/query.py"
click node_nodeman "https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/api/collections/nodeman.py"
click node_appmaker "https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/gcloud/contrib/appmaker/models.py"
click node_frontend_appmaker "https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/frontend/desktop/src/pages/appmaker/index.vue"
click node_common_templates "https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/gcloud/common_template/models.py"
click node_files "https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/files/models.py"

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_desktop,node_template_ui,node_canvas,node_template_manager,node_template_models,node_pipeline_web,node_template_cleaner toneBlue
class node_task_ui,node_task_models,node_engine,node_task_ui_exec,node_node_logs,node_log_source,node_periodic toneAmber
class node_statistics,node_permissions,node_files toneMint
class node_plugin_components,node_cmdb_picker,node_nodeman,node_external_systems toneRose
class node_appmaker,node_frontend_appmaker,node_common_templates,node_user toneIndigo
```

## Components

### Workflow authoring

- [SOPS desktop](https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/frontend/desktop/src/App.vue): `frontend/desktop/src/App.vue`
- [Template editor](https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/frontend/desktop/src/pages/template/TemplateEdit/index.vue): `frontend/desktop/src/pages/template/TemplateEdit/index.vue`
- [Workflow canvas](https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/frontend/desktop/src/components/common/TemplateCanvas/index.vue): `frontend/desktop/src/components/common/TemplateCanvas/index.vue`
- [Template manager](https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/gcloud/template_base/domains/template_manager.py): `gcloud/template_base/domains/template_manager.py`
- [Template records](https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/gcloud/tasktmpl3/models.py): `gcloud/tasktmpl3/models.py`
- [Pipeline representation](https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/pipeline_web/core/models.py): `pipeline_web/core/models.py`
- [Tree validation](https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/pipeline_web/parser/clean.py): `pipeline_web/parser/clean.py`

### Task execution

- [Task creation](https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/frontend/desktop/src/pages/task/TaskCreate/index.vue): `frontend/desktop/src/pages/task/TaskCreate/index.vue`
- [Task orchestration](https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/gcloud/taskflow3/models.py): `gcloud/taskflow3/models.py`
- **Workflow engine**
- [Execution controls](https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/frontend/desktop/src/pages/task/TaskExecute/index.vue): `frontend/desktop/src/pages/task/TaskExecute/index.vue`
- [Node log API](https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/gcloud/taskflow3/apis/drf/viewsets/engine_v2_node_log.py): `gcloud/taskflow3/apis/drf/viewsets/engine_v2_node_log.py`
- [Log data source](https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/gcloud/taskflow3/domains/node_log.py): `gcloud/taskflow3/domains/node_log.py`
- [Scheduled tasks](https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/gcloud/periodictask/models.py): `gcloud/periodictask/models.py`

### Platform services

- [Usage statistics](https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/gcloud/analysis_statistics/tasks.py): `gcloud/analysis_statistics/tasks.py`
- [IAM permissions](https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/gcloud/iam_auth/res_factory.py): `gcloud/iam_auth/res_factory.py`
- [File handling](https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/files/models.py): `files/models.py`

### Plugins and integrations

- [Plugin components](https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/pipeline_plugins/components/collections/controller.py): `pipeline_plugins/components/collections/controller.py`
- [CMDB host picker](https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/pipeline_plugins/cmdb_ip_picker/query.py): `pipeline_plugins/cmdb_ip_picker/query.py`
- [NodeMan client](https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/api/collections/nodeman.py): `api/collections/nodeman.py`
- **BlueKing services**

### Self-service

- [Light applications](https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/gcloud/contrib/appmaker/models.py): `gcloud/contrib/appmaker/models.py`
- [App maker UI](https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/frontend/desktop/src/pages/appmaker/index.vue): `frontend/desktop/src/pages/appmaker/index.vue`
- [Shared templates](https://github.com/tencentblueking/bk-sops/blob/release_humming_bird/gcloud/common_template/models.py): `gcloud/common_template/models.py`

### Other components

- **Operator**

## Connections

- Operator → SOPS desktop: uses
- SOPS desktop → Template editor: opens
- Template editor → Workflow canvas: edits flow
- Template manager → Tree validation: cleans tree (evidence: `gcloud/template_base/domains/template_manager.py`)
- Template manager → Pipeline representation: persists tree (evidence: `gcloud/template_base/domains/template_manager.py`)
- Template manager → Template records: creates template
- Template editor → Template manager: saves template
- Operator → Task creation: creates task
- Task creation → Task orchestration: starts task
- Task orchestration → Workflow engine: creates instance (evidence: `gcloud/taskflow3/models.py`)
- Operator → Execution controls: controls run
- Execution controls → Task orchestration: operates task
- Task orchestration → Workflow engine: dispatches actions (evidence: `gcloud/taskflow3/models.py`)
- Execution controls → Node log API: requests logs
- Node log API → Log data source: fetches logs (evidence: `gcloud/taskflow3/apis/drf/viewsets/engine_v2_node_log.py`)
- Node log API → IAM permissions: authorizes task (evidence: `gcloud/taskflow3/apis/drf/viewsets/engine_v2_node_log.py`)
- Operator → App maker UI: uses self-service
- App maker UI → Light applications: configures app
- Shared templates → Template manager: shares workflows
- Scheduled tasks → Task orchestration: schedules tasks
- Task orchestration → Usage statistics: records execution
- Plugin components → BlueKing services: calls services
- CMDB host picker → NodeMan client: queries hosts (evidence: `pipeline_plugins/cmdb_ip_picker/query.py`)
- NodeMan client → BlueKing services: calls NodeMan
- Operator → File handling: uploads files
