workflow

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptyGraph = errors.New("workflow: graph is empty")

Functions

This section is empty.

Types

type Graph

type Graph map[string]Node

Graph is a simplified DAG keyed by node id.

func (Graph) FindByClassType

func (g Graph) FindByClassType(classType string) []NodeRef

FindByClassType returns all nodes matching the requested class type.

func (Graph) SortedNodeIDs

func (g Graph) SortedNodeIDs() []string

SortedNodeIDs returns graph keys in deterministic order.

func (Graph) Validate

func (g Graph) Validate() error

Validate ensures the graph has the minimum shape expected by the SDK.

type Node

type Node struct {
	ClassType string         `json:"class_type"`
	Inputs    map[string]any `json:"inputs,omitempty"`
}

Node is the simplified ComfyUI-compatible node payload.

func (Node) Input

func (n Node) Input(name string) (any, bool)

Input fetches a raw input value.

func (Node) IntInput

func (n Node) IntInput(name string) (int, bool)

IntInput extracts an integer-like input when present.

func (Node) StringInput

func (n Node) StringInput(name string) (string, bool)

StringInput extracts a string input when present.

type NodeRef

type NodeRef struct {
	ID   string
	Node Node
}

NodeRef preserves both the node id and the node payload.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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