workflow

package
v0.0.0-...-157f31e Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildOption

type BuildOption func(wb *Builder)

func WithFunction

func WithFunction(name string, fn func(node *nodes.FunctionNode, ctx core.Context) error) BuildOption

func WithServices

func WithServices(services ...nodes.Service) BuildOption

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

Builder 工作流构建器

func NewBuilder

func NewBuilder(options ...BuildOption) *Builder

NewBuilder 创建新的工作流构建器

func (*Builder) AddNode

func (wb *Builder) AddNode(node core.Node) *Builder

AddNode 添加节点到工作流

func (*Builder) AddVariable

func (wb *Builder) AddVariable(node core.Node, variable *core.Variable) *Builder

AddVariable 为节点添加输入变量

func (*Builder) Build

func (wb *Builder) Build() *Workflow

Build 构建工作流

func (*Builder) BuildFromDsl

func (wb *Builder) BuildFromDsl(input io.Reader) (wf *Workflow, err error)

func (*Builder) Connect

func (wb *Builder) Connect(source, target core.Node) *Builder

Connect 连接两个节点

func (*Builder) ConnectByID

func (wb *Builder) ConnectByID(sourceID, targetID string) *Builder

ConnectByID 通过ID连接两个节点

func (*Builder) GetGraph

func (wb *Builder) GetGraph() *graph.DAG

GetGraph 获取当前图(用于调试)

func (*Builder) Validate

func (wb *Builder) Validate() error

Validate 验证工作流图

type Workflow

type Workflow struct {
	// contains filtered or unexported fields
}

Workflow 工作流定义

func NewWorkflow

func NewWorkflow(g core.Graph) *Workflow

NewWorkflow 创建新的工作流

func (*Workflow) Execute

func (w *Workflow) Execute(ctx context.Context, args ...*core.Param) error

Execute 执行工作流

func (*Workflow) GetExecutionStats

func (w *Workflow) GetExecutionStats() *stats.ExecutionStats

GetExecutionStats 获取执行统计信息

func (*Workflow) Graph

func (w *Workflow) Graph() core.Graph

Graph 返回工作流的图

func (*Workflow) ID

func (w *Workflow) ID() string

ID 返回工作流的ID

Jump to

Keyboard shortcuts

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