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 ¶
type RunRepository ¶
type RunRepository interface {
CreateWorkflowRun(WorkflowRun) (WorkflowRun, error)
UpdateWorkflowRun(WorkflowRun) (WorkflowRun, error)
GetWorkflowRun(string) (WorkflowRun, error)
}
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 WorkflowType ¶
type WorkflowType string
Click to show internal directories.
Click to hide internal directories.