跳到主要内容

workspace debug-node

Kanban 没有 executor 或 registry,不支持 debug node;服务器会返回静态项目不支持执行的明确错误。

workspace debug-node 调用 Workflow Server 的 debug node API,只运行所选 Workflow entrypoint(Conversation 则为 executor)registry 中注册的单个节点。它适合定位某个解析、LLM 或输出节点的问题。

命令格式

pnpm exec workflow-code workspace debug-node <workflow> <node> [--target draft|latest|version] [--entrypoint <id>] [--] [...args]

参数

参数说明
<workflow>远程 workflow 名称。
<node>executor registry 中注册的节点名。
args发送到 debug node API 的参数数组。
--target <target>调试目标。默认 latest;具体版本号必须是在线版本。
--entrypoint <id>Workflow 入口。省略时使用目标版本默认入口;Conversation 不接受非空值。

Registry 要求

配置说明
entrypoint.registryWorkflow 所选入口必须包含目标 <node>;不会跨入口搜索。Conversation 使用 executor.registry
entry.node指向要调试的 node 或 stream node。
entry.streamstream node 需要标记为 true
entry.createInput可选。未配置时使用所选 entrypoint(Conversation 则为 executor)的 createInput

API

步骤Endpoint
单节点调试POST /api/workflows/{workflow}/debug/nodes/{node}

请求体包含 target、可选 entrypointIdargs,也兼容 entrypoint_id。直接调用 HTTP API 时,也可以用 version 作为具体版本号别名;未提供 target 时 server 会把 version 作为调试目标。未知入口在启动调试前返回 400

输出

情况输出
调试成功server debug API JSON,data 为节点输出。
节点未注册server 返回标准错误,退出码为 1
stream 标记错误server 返回标准错误,退出码为 1

示例

pnpm exec workflow-code workspace debug-node hello output --target draft --entrypoint main -- --message "debug"
pnpm exec workflow-code workspace debug-node hello classifier --entrypoint classify -- --query "退款规则是什么"

排查建议

问题处理
找不到节点先用本地 workflow-code structure 检查 registry。
输入不符合预期检查 registry entry 是否定义了独立 createInput
流式节点报错确认 registry entry 设置了 stream: true