workflows

package
v0.0.0-...-3024e77 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WorkflowTypeVision   WorkflowType = "vision"
	WorkflowTypeResearch WorkflowType = "research"
	WorkflowTypePlanning WorkflowType = "planning"
	WorkflowTypeApproval WorkflowType = "approval"

	StatusRunning   RunStatus = "running"
	StatusCompleted RunStatus = "completed"
	StatusFailed    RunStatus = "failed"
	StatusRejected  RunStatus = "rejected"
)

Variables

This section is empty.

Functions

func ExecuteSteps

func ExecuteSteps(run *WorkflowRun, db *sql.DB) error

ExecuteSteps iterates over run.Steps, executes each one via the dispatcher, and persists state after each step. If a step fails the workflow is marked as failed.

Types

type Registry

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

func NewRegistry

func NewRegistry(repo RunRepository) *Registry

func NewRegistryWithDB

func NewRegistryWithDB(repo RunRepository, db *sql.DB) *Registry

func (*Registry) ExecuteWorkflow

func (r *Registry) ExecuteWorkflow(typ WorkflowType) (WorkflowRun, error)

func (*Registry) GetWorkflow

func (r *Registry) GetWorkflow(typ WorkflowType) (Workflow, error)

func (*Registry) RegisterWorkflow

func (r *Registry) RegisterWorkflow(workflow Workflow) error

type RunRepository

type RunRepository interface {
	CreateWorkflowRun(WorkflowRun) (WorkflowRun, error)
	UpdateWorkflowRun(WorkflowRun) (WorkflowRun, error)
	GetWorkflowRun(string) (WorkflowRun, error)
}

type RunStatus

type RunStatus string

type Step

type Step struct {
	Name        string     `json:"name"`
	Status      RunStatus  `json:"status"`
	Error       string     `json:"error,omitempty"`
	Output      string     `json:"output,omitempty"`
	CompletedAt *time.Time `json:"completed_at,omitempty"`
}

type StepExecutor

type StepExecutor func(run *WorkflowRun, stepName string, db *sql.DB) error

type Workflow

type Workflow struct {
	Type  WorkflowType
	Name  string
	Steps []string
}

func ApprovalWorkflow

func ApprovalWorkflow() Workflow

func PlanningWorkflow

func PlanningWorkflow() Workflow

func ResearchWorkflow

func ResearchWorkflow() Workflow

func VisionWorkflow

func VisionWorkflow() Workflow

type WorkflowRun

type WorkflowRun struct {
	ID           string
	WorkflowType WorkflowType
	Status       RunStatus
	Steps        []Step
	StartedAt    time.Time
	FinishedAt   time.Time
}

type WorkflowType

type WorkflowType string

Jump to

Keyboard shortcuts

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