Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WorkflowEngine ¶
type WorkflowEngine struct {
// contains filtered or unexported fields
}
WorkflowEngine manages the lifecycle of multiple execution workflows.
func NewWorkflowEngine ¶
func NewWorkflowEngine(executor execution.SkillExecutor, logger execution.ExecutionLogger) *WorkflowEngine
NewWorkflowEngine creates a new workflow engine.
func (*WorkflowEngine) GetWorkflow ¶
func (e *WorkflowEngine) GetWorkflow(id string) (*WorkflowState, bool)
GetWorkflow retrieves the state of a workflow by ID.
func (*WorkflowEngine) StartWorkflow ¶
func (e *WorkflowEngine) StartWorkflow(ctx context.Context, assistantID string, plan *execution.ExecutionPlan) (string, error)
StartWorkflow initiates a new execution from a plan.
type WorkflowRunner ¶
type WorkflowRunner struct {
// contains filtered or unexported fields
}
WorkflowRunner manages the execution of a single workflow.
func NewWorkflowRunner ¶
func NewWorkflowRunner(executor execution.SkillExecutor, logger execution.ExecutionLogger) *WorkflowRunner
NewWorkflowRunner creates a new workflow runner.
func (*WorkflowRunner) Run ¶
func (wr *WorkflowRunner) Run(ctx context.Context, state *WorkflowState) error
Run executes a full plan and updates the workflow state.
type WorkflowState ¶
type WorkflowState struct {
ID string
AssistantID string
Status WorkflowStatus
StartTime time.Time
EndTime time.Time
Context *execution.ExecutionContext
Plan *execution.ExecutionPlan
Error error
// contains filtered or unexported fields
}
WorkflowState tracks the lifecycle and execution data of a workflow.
func NewWorkflowState ¶
func NewWorkflowState(id, assistantID string, plan *execution.ExecutionPlan) *WorkflowState
NewWorkflowState creates a new state tracker for a workflow.
func (*WorkflowState) Complete ¶
func (s *WorkflowState) Complete()
Complete marks the workflow as successful.
func (*WorkflowState) Fail ¶
func (s *WorkflowState) Fail(err error)
Fail marks the workflow as failed with an error.
type WorkflowStatus ¶
type WorkflowStatus string
WorkflowStatus represents the current state of a workflow.
const ( StatusPending WorkflowStatus = "pending" StatusRunning WorkflowStatus = "running" StatusCompleted WorkflowStatus = "completed" StatusFailed WorkflowStatus = "failed" StatusCancelled WorkflowStatus = "cancelled" )