execution

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NodeExecution

type NodeExecution struct {
	bun.BaseModel `bun:"table:node_executions"`

	ID                    uuid.UUID           `bun:",pk,type:uuid" json:"id"`
	WorkflowExecutionID   uuid.UUID           `bun:"type:uuid" json:"workflow_execution_id"`
	ParentNodeExecutionID uuid.UUID           `bun:"type:uuid,nullzero" json:"parent_node_execution_id,omitempty"`
	NodeID                string              `json:"node_id"`
	Kind                  string              `json:"kind"`
	Status                NodeExecutionStatus `json:"status"`
	NodeSnapshot          json.RawMessage     `bun:"type:jsonb" json:"node_snapshot"`
	InputSnapshot         map[string]any      `bun:"type:jsonb,nullzero" json:"input_snapshot,omitempty"`
	OutputSnapshot        map[string]any      `bun:"type:jsonb,nullzero" json:"output_snapshot,omitempty"`
	Trace                 map[string]any      `bun:"type:jsonb,nullzero" json:"trace,omitempty"`
	IterationIndex        *int                `bun:",nullzero" json:"iteration_index,omitempty"`
	BranchName            string              `json:"branch_name,omitempty"`
	StartedAt             *time.Time          `bun:",nullzero" json:"started_at,omitempty"`
	FinishedAt            *time.Time          `bun:",nullzero" json:"finished_at,omitempty"`
	Metadata              map[string]any      `bun:"type:jsonb,nullzero" json:"metadata,omitempty"`
	CreatedAt             time.Time           `json:"created_at"`
}

func GetNodeExecutionByID

func GetNodeExecutionByID(ctx context.Context, db bun.IDB, id uuid.UUID) (*NodeExecution, error)

func (*NodeExecution) Delete

func (n *NodeExecution) Delete(ctx context.Context, db bun.IDB) error

func (NodeExecution) GetCursor

func (n NodeExecution) GetCursor() string

func (NodeExecution) GetSortField

func (n NodeExecution) GetSortField() string

func (NodeExecution) GetSortValue

func (n NodeExecution) GetSortValue() interface{}

func (NodeExecution) GetUniqueField

func (n NodeExecution) GetUniqueField() string

func (NodeExecution) GetUniqueValue

func (n NodeExecution) GetUniqueValue() interface{}

func (*NodeExecution) Insert

func (n *NodeExecution) Insert(ctx context.Context, db bun.IDB) error

func (*NodeExecution) Update

func (n *NodeExecution) Update(ctx context.Context, db bun.IDB) error

func (*NodeExecution) Validate

func (n *NodeExecution) Validate() error

type NodeExecutionStatus

type NodeExecutionStatus string
const (
	NodeExecutionStatusQueued    NodeExecutionStatus = "queued"
	NodeExecutionStatusRunning   NodeExecutionStatus = "running"
	NodeExecutionStatusSucceeded NodeExecutionStatus = "succeeded"
	NodeExecutionStatusFailed    NodeExecutionStatus = "failed"
	NodeExecutionStatusCanceled  NodeExecutionStatus = "canceled"
	NodeExecutionStatusBlocked   NodeExecutionStatus = "blocked"
)

func (NodeExecutionStatus) MarshalJSON

func (s NodeExecutionStatus) MarshalJSON() ([]byte, error)

func (*NodeExecutionStatus) UnmarshalJSON

func (s *NodeExecutionStatus) UnmarshalJSON(b []byte) error

func (NodeExecutionStatus) Validate

func (s NodeExecutionStatus) Validate() error

type WorkflowExecution

type WorkflowExecution struct {
	bun.BaseModel `bun:"table:workflow_executions"`

	ID           uuid.UUID `bun:",pk,type:uuid" json:"id"`
	WorkflowSlug string    `json:"workflow_slug"`
	// WorkflowID is the workflow's permanent identity — the slug can
	// be renamed, this cannot.
	WorkflowID       uuid.UUID               `bun:"type:uuid,nullzero" json:"workflow_id,omitempty"`
	WorkflowVersion  string                  `json:"workflow_version"`
	WorkflowSnapshot json.RawMessage         `bun:"type:jsonb" json:"workflow_snapshot"`
	InputSnapshot    map[string]any          `bun:"type:jsonb,nullzero" json:"input_snapshot,omitempty"`
	OutputSnapshot   map[string]any          `bun:"type:jsonb,nullzero" json:"output_snapshot,omitempty"`
	Status           WorkflowExecutionStatus `json:"status"`
	ProjectDir       string                  `json:"project_dir,omitempty"`
	StartedAt        *time.Time              `bun:",nullzero" json:"started_at,omitempty"`
	FinishedAt       *time.Time              `bun:",nullzero" json:"finished_at,omitempty"`
	Metadata         map[string]any          `bun:"type:jsonb,nullzero" json:"metadata,omitempty"`
	CreatedAt        time.Time               `json:"created_at"`
}

func GetWorkflowExecutionByID

func GetWorkflowExecutionByID(ctx context.Context, db bun.IDB, id uuid.UUID) (*WorkflowExecution, error)

func (*WorkflowExecution) Delete

func (w *WorkflowExecution) Delete(ctx context.Context, db bun.IDB) error

func (WorkflowExecution) GetCursor

func (w WorkflowExecution) GetCursor() string

func (WorkflowExecution) GetSortField

func (w WorkflowExecution) GetSortField() string

func (WorkflowExecution) GetSortValue

func (w WorkflowExecution) GetSortValue() interface{}

func (WorkflowExecution) GetUniqueField

func (w WorkflowExecution) GetUniqueField() string

func (WorkflowExecution) GetUniqueValue

func (w WorkflowExecution) GetUniqueValue() interface{}

func (*WorkflowExecution) Insert

func (w *WorkflowExecution) Insert(ctx context.Context, db bun.IDB) error

func (*WorkflowExecution) Update

func (w *WorkflowExecution) Update(ctx context.Context, db bun.IDB) error

func (*WorkflowExecution) Validate

func (w *WorkflowExecution) Validate() error

type WorkflowExecutionStatus

type WorkflowExecutionStatus string
const (
	WorkflowExecutionStatusQueued    WorkflowExecutionStatus = "queued"
	WorkflowExecutionStatusRunning   WorkflowExecutionStatus = "running"
	WorkflowExecutionStatusSucceeded WorkflowExecutionStatus = "succeeded"
	WorkflowExecutionStatusFailed    WorkflowExecutionStatus = "failed"
	WorkflowExecutionStatusCanceled  WorkflowExecutionStatus = "canceled"
	WorkflowExecutionStatusBlocked   WorkflowExecutionStatus = "blocked"
)

func (WorkflowExecutionStatus) MarshalJSON

func (s WorkflowExecutionStatus) MarshalJSON() ([]byte, error)

func (*WorkflowExecutionStatus) UnmarshalJSON

func (s *WorkflowExecutionStatus) UnmarshalJSON(b []byte) error

func (WorkflowExecutionStatus) Validate

func (s WorkflowExecutionStatus) Validate() error

Jump to

Keyboard shortcuts

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