workflow

package
v0.2.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrWorkflowsNotConfigured     = apierr.New(apierr.KindNotConfigured, "workflows not configured")
	ErrConversationsNotConfigured = apierr.New(apierr.KindNotConfigured, "conversations not configured")
	ErrIssuesNotConfigured        = apierr.New(apierr.KindNotConfigured, "issues not configured")
	ErrTasksNotConfigured         = apierr.New(apierr.KindNotConfigured, "tasks not configured")
	ErrWorkflowNameRequired       = apierr.New(apierr.KindInvalid, "workflow name required")
	ErrWorkflowDefinitionRequired = apierr.New(apierr.KindInvalid, "workflow definition required")
	ErrWorkflowNotFound           = apierr.New(apierr.KindNotFound, "workflow not found")
	ErrWorkflowRunNotFound        = apierr.New(apierr.KindNotFound, "workflow run not found")
	ErrWorkflowRevisionNotFound   = apierr.New(apierr.KindNotFound, "workflow revision not found")
	ErrIssueNotFound              = apierr.New(apierr.KindNotFound, "issue not found")
	ErrIssueWorkflowMismatch      = apierr.New(apierr.KindInvalid, "issue not assigned to workflow")
	ErrInvalidDefinition          = apierr.New(apierr.KindInvalid, "invalid workflow definition")
	ErrInvalidStepType            = apierr.New(apierr.KindInvalid, "invalid workflow step type")
	ErrInvalidStepID              = apierr.New(apierr.KindInvalid, "invalid workflow step_id")
	ErrInvalidTargetAgent         = apierr.New(apierr.KindInvalid, "invalid target agent")
	ErrInvalidWorkflowStatus      = apierr.New(apierr.KindInvalid, "invalid workflow status")
	ErrWorkflowNotPublished       = apierr.New(apierr.KindInvalid, "workflow not published")
	ErrWorkflowArchived           = apierr.New(apierr.KindInvalid, "workflow archived")
)

Functions

This section is empty.

Types

type CreateWorkflowCmd

type CreateWorkflowCmd struct {
	TeamID      string
	UserID      string
	Name        string
	Description string
	Definition  string
}

type RestoreWorkflowRevisionCmd

type RestoreWorkflowRevisionCmd struct {
	TeamID     string
	UserID     string
	WorkflowID string
	Revision   int
}

RestoreWorkflowRevisionCmd restores an earlier revision's content.

type Service

type Service struct {
	Workflows     coreworkflow.Store
	Agents        agentdef.Store
	Issues        coreissue.Store
	Conversations coreconv.Store
	TaskService   *task.Service
}

func (*Service) CreateWorkflow

func (s *Service) CreateWorkflow(ctx context.Context, cmd CreateWorkflowCmd) (*coreworkflow.Workflow, error)

func (*Service) GetWorkflow

func (s *Service) GetWorkflow(ctx context.Context, teamID, workflowID string) (*coreworkflow.Workflow, error)

func (*Service) GetWorkflowRunDetail

func (s *Service) GetWorkflowRunDetail(ctx context.Context, teamID, workflowRunID string) (*coreworkflow.Run, []coreworkflow.StepRun, error)

func (*Service) HandleTaskRunTerminal

func (s *Service) HandleTaskRunTerminal(ctx context.Context, info coretask.RunTerminalInfo) error

func (*Service) ListWorkflowRevisions

func (s *Service) ListWorkflowRevisions(ctx context.Context, teamID, workflowID string, limit, offset int) ([]coreworkflow.Revision, int, error)

func (*Service) ListWorkflowRuns

func (s *Service) ListWorkflowRuns(ctx context.Context, teamID, workflowID string, limit, offset int) ([]coreworkflow.Run, int, error)

func (*Service) ListWorkflows

func (s *Service) ListWorkflows(ctx context.Context, teamID string) ([]coreworkflow.Workflow, error)

func (*Service) PublishedWorkflowsUsingAgent

func (s *Service) PublishedWorkflowsUsingAgent(ctx context.Context, teamID, agentID string) ([]coreworkflow.Workflow, error)

PublishedWorkflowsUsingAgent returns the team's published workflows whose definition names agentID.

It exists so deleting an agent can be refused while a workflow that can still be run depends on it. Draft and archived workflows do not count: neither can start a run, and publishing one revalidates its agents.

A published workflow whose definition no longer parses is skipped rather than treated as a reference. It cannot run either way, and blocking an unrelated delete on it would leave no way forward.

func (*Service) RestoreWorkflowRevision

func (s *Service) RestoreWorkflowRevision(ctx context.Context, cmd RestoreWorkflowRevisionCmd) (*coreworkflow.Workflow, error)

RestoreWorkflowRevision writes an earlier revision's name, description, and definition back to the workflow, which appends a new revision rather than rewinding to the old one.

Status is deliberately not restored. It is lifecycle state, not content: restoring the definition of a draft revision must not unpublish a workflow teams are running, and restoring a published one must not publish a draft without anyone deciding to. The definition is revalidated, so a revision whose agents have since been deleted is refused rather than restored into a plan that cannot run.

func (*Service) StartWorkflowRun

func (s *Service) StartWorkflowRun(ctx context.Context, cmd StartWorkflowRunCmd) (*coreworkflow.Run, []coreworkflow.StepRun, error)

func (*Service) UpdateWorkflow

func (s *Service) UpdateWorkflow(ctx context.Context, cmd UpdateWorkflowCmd) (*coreworkflow.Workflow, error)

type StartWorkflowRunCmd

type StartWorkflowRunCmd struct {
	TeamID     string
	UserID     string
	WorkflowID string
	IssueID    *string
}

type UpdateWorkflowCmd

type UpdateWorkflowCmd struct {
	TeamID      string
	UserID      string
	WorkflowID  string
	Name        *string
	Description *string
	Definition  *string
	Status      *string
}

Jump to

Keyboard shortcuts

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