feat(web): 工作流列表实时运行状态与运行控制 - #121
Merged
Merged
Conversation
列表页从纯管理页升级为运行入口:每张卡片实时显示 LIVE 进度、当前节点与 最近终态,可直接启动(Schema-aware 输入表单 + JSON 兜底)、逐 run 取消 并发运行、查看运行详情(复用 inspectedRunId 查看路径)。 后端(orchestrator): - GET /wf1/api/workflows 每个工作流附 liveRuns/lastRun 运行概览, 口径与 runProgressOf 一致(排除 notify),workspace 隔离 - 新增 POST /wf1/api/workflows/run 列表专用启动:只按 workflowId 使用持久化图/变量/输入 Schema,source='workflow-list' - 新增 lib/workflow-inputs.js 统一命名工作流输入校验 (required/defaultValue/类型/enum/未知字段),startWorkflowRun 与 /wf1/api/run 的 workflowId 分支共用;修复后者 persisted 变量 作用域缺陷 - run-start 事件附业务节点数 nodeCount 前端(web): - App 复用唯一 SSE 连接,经 workflow-list-state.js 纯函数把运行事件 归并进列表模型;终态后迟到 node-status/agent-progress 不复活 run - WorkflowList 改造:运行摘要区、多 live run 独立查看/取消、 RunWorkflowModal 输入弹窗;删除/重命名/复制补 HTTP 错误处理 - shouldFollowRunStart 排除 workflow-list 来源:列表启动不抢占画布 - RunSwitcher 增加「列表启动」来源图标与标签 验证:orchestrator 17 套 + web 全套 + 全量 npm test 通过; build-web.sh 双 base 构建通过;新增 HTTP 列表概览/启动集成测试。
chumingjun
force-pushed
the
feat/workflow-list-runtime-controls-clean
branch
from
September 2, 2026 16:44
ef5e651 to
b29c4a5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
Closes #118。工作流列表页原来只有元数据管理(搜索/新建/复制/导入导出/重命名/删除),看不到运行中工作流的实时状态,也没有启动、取消等运行控制入口。
方案
列表页升级为运行入口,同时保持多运行并发、
inspectedRunId单一事实源、定时/Webhook 不抢占画布等既有约束:后端(orchestrator)
GET /wf1/api/workflows运行概览:每个已保存工作流附liveRuns[](内存实时态,多并发 run 各自一条)与lastRun(最新 live 与最近持久化终态按开始时间取新)。进度口径与runProgressOf一致(排除 notify),只暴露状态/进度/当前节点/时间,不带输出正文,workspace 隔离。POST /wf1/api/workflows/run:列表专用启动,只按workflowId使用持久化图/变量/输入 Schema(不收前端图覆盖),source='workflow-list',与画布运行/助手工具共享startWorkflowRun()的 lint、安全与 Schema 校验。lib/workflow-inputs.js(required/defaultValue/类型/enum/未知字段,空 schema 允许任意 JSON 对象),startWorkflowRun()与/wf1/api/run的workflowId分支共用;顺带修复后者persisted变量作用域缺陷。run-start事件附nodeCount(业务节点数):前端列表进度总数与后端口径一致。前端(web)
workflow-list-state.js纯函数把run-start/node-status/agent-progress/run-end/run-error/snapshot归并进列表模型;终态后迟到的node-status/agent-progress不会复活已结束 run;runList拉取升为limit=100。WorkflowList改造:卡片运行摘要区(LIVE 进度/当前节点/开始时间、最近终态)、同一工作流多个 live run 独立「查看/取消」、启动按钮打开RunWorkflowModal;删除/重命名/复制等操作补齐 HTTP 错误处理(原来无视失败)。RunWorkflowModal:inputSchema.fields渲染 schema-aware 表单(string/number/boolean/enum/string[]/JSON),无 schema 时 JSON 对象兜底;前端即时校验,失败保留输入。shouldFollowRunStart排除workflow-list:列表启动不抢占当前画布视图;RunSwitcher 增加「列表启动」来源图标与标签。openWorkflow()+selectRunForView()同一条路径。验证
npm test通过build-web.sh双 base 构建通过;git diff --check干净workflow-inputs.js,不依赖未合并的subworkflow.js)后续(不在本 PR)