Files
ai-agent/workflow/model/dto/session/exec_workflow_dto.go
T
19904408334 d699f7ce14 feat(workflow): 增加工作流计费与执行生命周期管理
- 新增计费模块:执行开始建单、终态结算/取消/失败处理,支持按条/按秒/按token计费
- 新增执行生命周期跟踪:优雅关停时取消运行中执行并等待落库
- 新增异步任务等待/通知机制(Wait/Notify)
- 重构执行记录落库与进度上报,统一失败分类与重试语义
- 重命名文件:async_task.go→async.go、flow_checkpoint_store.go→exec_checkpoint.go、flow_graph_util.go→exec_record.go
- 更新 .gitignore 与数据库密码配置
2026-09-03 13:22:22 +08:00

35 lines
2.0 KiB
Go

package session
import (
"ai-agent/workflow/consts/flow"
"ai-agent/workflow/model/entity"
)
type CreateWorkflowReq struct {
UserId int64 `json:"userId" description:"执行用户ID(数字,恢复续跑补 X-User-Info 用)"`
SessionId string `json:"sessionId" description:"所属会话ID"`
FlowId int64 `json:"flowId" description:"工作流ID"`
NodeGroupId string `json:"nodeGroupId" description:"节点组ID"`
Status flow.FlowExecutionStatus `json:"status" description:"状态:1-运行中,2-成功,3-失败"`
RequestParams *entity.FlowInfo `json:"requestParams" description:"请求参数"`
ErrorMessage string `json:"errorMessage" description:"错误信息(友好提示)"`
Error string `json:"error" description:"错误明细(原始错误)"`
LastHeartbeat int64 `json:"lastHeartbeat" description:"最后心跳时间(毫秒时间戳)"`
}
type DeleteExecWorkflowReq struct {
Id []int64 `json:"id" v:"required#工作流执行记录ID不能为空"`
}
type UpdateWorkflowReq struct {
Id int64 `json:"id" v:"required#工作流执行记录ID不能为空"`
NodeGroupId string `json:"nodeGroupId" description:"节点组ID"`
Status flow.FlowExecutionStatus `json:"status" description:"状态:1-运行中,2-成功,3-失败"`
Duration int64 `json:"duration" description:"执行时长(秒)"`
TotalTokens int `json:"totalTokens" description:"总token消耗"`
TotalFee float64 `json:"totalFee" description:"总费用"`
ErrorMessage string `json:"errorMessage" description:"错误信息(友好提示)"`
Error string `json:"error" description:"错误明细(原始错误)"`
RequestParams *entity.FlowInfo `json:"requestParams" description:"请求参数"`
}