workflow

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StepType

type StepType string
const (
	StepShell    StepType = "shell"
	StepLLM      StepType = "llm" // <-- add this
	StepLocalLLM StepType = "local_llm"
)

type Workflow

type Workflow struct {
	Name  string         `yaml:"name"`
	Steps []WorkflowStep `yaml:"steps"`
}

func LoadWorkflows

func LoadWorkflows(path string) ([]Workflow, error)

LoadWorkflows loads one or more workflows from a YAML file. Supports files containing multiple YAML documents separated by `---`. Empty documents are ignored. Returns parsed workflows.

func (*Workflow) Validate

func (wf *Workflow) Validate() error

type WorkflowStep

type WorkflowStep struct {
	Name      string   `yaml:"name"`
	Type      StepType `yaml:"type"`
	Command   string   `yaml:"command,omitempty"` // for shell
	Prompt    string   `yaml:"prompt,omitempty"`  // for LLM
	Model     string   `yaml:"model,omitempty"`   // for LLM
	MaxTokens int      `yaml:"max_tokens,omitempty"`
	Output    string   `yaml:"output,omitempty"`
	If        string
	// WaitFor optionally specifies another workflow step to wait on before
	// executing this step. Format: "workflowName.stepName". When the
	// producer step completes and has an `output`, its value will be sent on
	// a coordination channel under that key and the waiting step will receive
	// it and store it into its local context under the same key.
	WaitFor string `yaml:"wait_for,omitempty"`
	// Optional timeout in seconds to wait for the producer. 0 means block
	// indefinitely.
	WaitTimeout int `yaml:"wait_timeout,omitempty"`
}

Jump to

Keyboard shortcuts

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