Files
common_agent/docs/后端实现文档/4.Workflow编排模块后端实现.md

40 lines
922 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Workflow 编排模块后端实现
## 1. 包建议
后续实现建议新增 `com.bruce.workflow`
- `controller`
- `dto/request`
- `dto/response`
- `entity`
- `enums`
- `mapper`
- `service`
- `runner`
## 2. Controller 草案
- `WorkflowDefinitionController`
- `WorkflowVersionController`
- `WorkflowRunController`
## 3. Service 草案
| Service | 职责 |
|---------|------|
| `IWorkflowDefinitionService` | 定义 CRUD、绑定 Agent |
| `IWorkflowVersionService` | 草稿保存、发布快照 |
| `IWorkflowRunService` | 运行测试、运行记录查询 |
| `IWorkflowRunner` | 按图执行节点并写入步骤日志 |
## 4. 校验规则
- Workflow 编码唯一。
- 发布版本号不可重复。
- 运行时必须使用确定的版本快照。
- 节点类型必须来自枚举。
- LLM 节点必须配置任务类型。
- Knowledge Retrieval 节点必须配置知识库或继承项目默认知识库。