workerdebug

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package workerdebug 定义控制台向业务服务发起 workflow 调试的轻量协议。

调试必须在业务服务内执行,因为只有业务服务注册了真实业务节点。 admin 控制面只负责保存 workflow、发起请求和展示结果,不应该本地执行业务 workflow。

Index

Constants

View Source
const (
	// DebugPath 是控制台发起 workflow 调试时访问业务服务的标准路径。
	DebugPath = "/worker/v1/workflow-debug"
	// NodeManifestPath 是控制台读取当前业务进程可执行节点清单的标准路径。
	NodeManifestPath = "/worker/v1/node-manifest"
	// DebugTokenHeader 是业务服务保护调试入口时使用的轻量认证头。
	DebugTokenHeader = "X-FlowLink-Debug-Token"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DebugRequest

type DebugRequest struct {
	Workflow *core.Workflow `json:"workflow"`
	Envelope *core.Envelope `json:"envelope"`
}

DebugRequest 是业务服务调试入口接收的请求。

Workflow 来自控制台当前编辑内容或版本定义,业务服务必须使用自己注册的节点执行它。 Envelope 只承载本次调试入参和可选 traceId/parentRunId,执行身份由 Workflow 决定。

type DebugResponse

type DebugResponse struct {
	TraceID string                  `json:"traceId"`
	RunID   string                  `json:"runId"`
	Success bool                    `json:"success"`
	Output  map[string]interface{}  `json:"output"`
	Error   string                  `json:"error,omitempty"`
	Plan    *PlanSummary            `json:"plan,omitempty"`
	Events  []*event.Event          `json:"events,omitempty"`
	Stats   *runtime.ExecutionStats `json:"stats,omitempty"`
}

DebugResponse 是业务服务调试入口返回给控制台的执行结果。

它保持和 admin 控制台已有调试面板兼容的扁平结构;Plan 只返回摘要, 完整节点执行细节通过 Events 和 WorkflowResult.Output 按开关查看。

type NodeManifestResponse

type NodeManifestResponse struct {
	Nodes          []node.Metadata `json:"nodes"`
	ContainerKinds []string        `json:"containerKinds"`
}

NodeManifestResponse 描述当前业务进程实际支持的执行节点和容器类型。

Nodes 只包含已经注册到当前 Assembly 的节点,并由业务进程统一提供配置 schema。

type PlanSummary

type PlanSummary struct {
	NodeCount  int       `json:"nodeCount"`
	RootNodeID string    `json:"rootNodeId,omitempty"`
	BuiltAt    time.Time `json:"builtAt,omitempty"`
}

PlanSummary 是调试响应中的执行计划摘要。

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL