workflow

package
v0.46.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const MaxExecutionLimit = sdkworkflow.MaxExecutionLimit

MaxExecutionLimit is the most executions one listing returns.

Variables

This section is empty.

Functions

This section is empty.

Types

type Execution

type Execution struct {
	ID          string     `json:"id" table:"ID"`
	Workflow    string     `json:"workflow" table:"WORKFLOW"`
	Title       string     `json:"title" table:"TITLE"`
	State       string     `json:"state" table:"STATE"`
	StateInfo   *string    `json:"stateInfo,omitempty" table:"-"`
	StartedAt   time.Time  `json:"startedAt" table:"STARTED"`
	EndedAt     *time.Time `json:"endedAt,omitempty" table:"-"`
	Runtime     int        `json:"runtime,omitempty" table:"RUNTIME"`
	Trigger     *string    `json:"trigger,omitempty" table:"-"`
	TriggerType string     `json:"triggerType,omitempty" table:"TRIGGER"`
	User        *string    `json:"user,omitempty" table:"-"`
	Actor       string     `json:"actor,omitempty" table:"-"`
	Input       any        `json:"input,omitempty" table:"-"`
	Params      any        `json:"params,omitempty" table:"-"`
	Result      any        `json:"result,omitempty" table:"-"`
}

Execution represents a workflow execution (CLI version with table tags).

type ExecutionFilters

type ExecutionFilters = sdkworkflow.ExecutionFilters

Re-export SDK type so callers don't need to import the SDK directly.

type ExecutionHandler

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

ExecutionHandler handles execution resources. It delegates to the SDK handler and adds CLI-specific convenience methods.

func NewExecutionHandler

func NewExecutionHandler(c *client.Client) *ExecutionHandler

NewExecutionHandler creates a new execution handler

func (*ExecutionHandler) Cancel

func (h *ExecutionHandler) Cancel(id string) error

Cancel cancels an active execution

func (*ExecutionHandler) Get

func (h *ExecutionHandler) Get(id string) (*Execution, error)

Get retrieves a specific execution

func (*ExecutionHandler) GetCompleteExecutionLog

func (h *ExecutionHandler) GetCompleteExecutionLog(executionID string) (string, error)

GetCompleteExecutionLog retrieves both the workflow execution log and all task logs

func (*ExecutionHandler) GetExecutionLog

func (h *ExecutionHandler) GetExecutionLog(executionID string) (string, error)

GetExecutionLog retrieves the combined log output of all tasks in an execution

func (*ExecutionHandler) GetFullExecutionLog

func (h *ExecutionHandler) GetFullExecutionLog(executionID string) (string, error)

GetFullExecutionLog retrieves logs for all tasks in an execution, formatted with headers.

A task log that cannot be fetched is marked inline and the remaining tasks are still fetched. The text is then returned together with a *TaskLogError if any fetch failed for a reason other than 404, or if no task log could be fetched at all. A lone 404 is not reported as an error: the text already says the log is missing, and a task that has no log is not a failure.

func (*ExecutionHandler) GetTaskLog

func (h *ExecutionHandler) GetTaskLog(executionID, taskName string) (string, error)

GetTaskLog retrieves the log output of a specific task execution

func (*ExecutionHandler) GetTaskResult

func (h *ExecutionHandler) GetTaskResult(executionID, taskName string) (any, error)

GetTaskResult retrieves the structured return value of a specific task execution

func (*ExecutionHandler) List

func (h *ExecutionHandler) List(filters ExecutionFilters, limit int64) (*ExecutionList, error)

List retrieves executions with optional filters.

func (*ExecutionHandler) ListTasks

func (h *ExecutionHandler) ListTasks(executionID string) ([]TaskExecution, error)

ListTasks retrieves all task executions for a workflow execution

type ExecutionList

type ExecutionList struct {
	Count   int         `json:"count"`
	Results []Execution `json:"results"`
}

ExecutionList represents a list of executions.

type Handler

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

Handler handles workflow resources. It delegates to the SDK handler and adds CLI-specific convenience methods.

func NewHandler

func NewHandler(c *client.Client) *Handler

NewHandler creates a new workflow handler

func (*Handler) Create

func (h *Handler) Create(data []byte) (*Workflow, error)

Create creates a new workflow

func (*Handler) Delete

func (h *Handler) Delete(id string) error

Delete deletes a workflow

func (*Handler) Get

func (h *Handler) Get(id string) (*Workflow, error)

Get retrieves a specific workflow

func (*Handler) GetHistoryRecord

func (h *Handler) GetHistoryRecord(workflowID string, version int) (*Workflow, error)

GetHistoryRecord retrieves a specific version of a workflow

func (*Handler) GetRaw

func (h *Handler) GetRaw(id string) ([]byte, error)

GetRaw retrieves a workflow as raw JSON (for editing)

func (*Handler) List

func (h *Handler) List(filters WorkflowFilters, chunkSize, limit int64) (*WorkflowList, error)

List retrieves workflows with optional filters. chunkSize controls page size (0 = first page only); limit caps total results (0 = unlimited).

func (*Handler) ListHistory

func (h *Handler) ListHistory(workflowID string) (*HistoryList, error)

ListHistory retrieves version history for a workflow

func (*Handler) RestoreHistory

func (h *Handler) RestoreHistory(workflowID string, version int) (*Workflow, error)

RestoreHistory restores a workflow to a specific version

func (*Handler) Update

func (h *Handler) Update(id string, data []byte) (*Workflow, error)

Update updates a workflow

type HistoryList

type HistoryList struct {
	Count   int             `json:"count"`
	Results []HistoryRecord `json:"results"`
}

HistoryList represents a paginated list of history records.

type HistoryRecord

type HistoryRecord struct {
	Version     int    `json:"version" table:"VERSION"`
	User        string `json:"user" table:"USER"`
	DateCreated string `json:"dateCreated" table:"CREATED"`
}

HistoryRecord represents a workflow version history record (CLI version with table tags).

type TaskExecution

type TaskExecution struct {
	ID        string     `json:"id" table:"ID"`
	Name      string     `json:"name" table:"NAME"`
	State     string     `json:"state" table:"STATE"`
	StartedAt *time.Time `json:"startedAt,omitempty" table:"STARTED"`
	EndedAt   *time.Time `json:"endedAt,omitempty" table:"-"`
	Runtime   int        `json:"runtime,omitempty" table:"RUNTIME"`
	StateInfo *string    `json:"stateInfo,omitempty" table:"-"`
	Input     any        `json:"input,omitempty" table:"-"`
	Result    any        `json:"result,omitempty" table:"-"`
}

TaskExecution represents a task execution within a workflow execution (CLI version with table tags).

type TaskExecutionMap

type TaskExecutionMap = sdkworkflow.TaskExecutionMap

Re-export SDK types that have no table tags.

type TaskLogError

type TaskLogError struct {
	ExecutionID string
	Total       int
	Failed      []TaskLogFailure
}

TaskLogError reports task logs that could not be fetched. It is returned together with the log text, which still holds every log that was fetched and an inline marker for each one that was not.

func (*TaskLogError) Error

func (e *TaskLogError) Error() string

func (*TaskLogError) Unwrap

func (e *TaskLogError) Unwrap() []error

Unwrap exposes the per-task errors to errors.Is and errors.As.

type TaskLogFailure

type TaskLogFailure struct {
	Task string
	Err  error
}

TaskLogFailure is one task whose log could not be fetched.

type Workflow

type Workflow struct {
	ID                   string                 `json:"id" yaml:"id" table:"ID"`
	Title                string                 `json:"title" yaml:"title" table:"TITLE"`
	IsDeployed           bool                   `json:"isDeployed" yaml:"isDeployed" table:"DEPLOYED"`
	Description          string                 `json:"description,omitempty" yaml:"description,omitempty" table:"DESCRIPTION,wide"`
	Actor                string                 `json:"actor,omitempty" yaml:"actor,omitempty" table:"-"`
	Owner                string                 `json:"owner,omitempty" yaml:"owner,omitempty" table:"-"`
	OwnerType            string                 `json:"ownerType,omitempty" yaml:"ownerType,omitempty" table:"-"`
	Private              bool                   `json:"isPrivate" yaml:"isPrivate" table:"-"`
	SchemaVersion        int                    `json:"schemaVersion,omitempty" yaml:"schemaVersion,omitempty" table:"-"`
	Trigger              map[string]interface{} `json:"trigger,omitempty" yaml:"trigger,omitempty" table:"-"`
	TriggerType          string                 `json:"triggerType,omitempty" yaml:"triggerType,omitempty" table:"TRIGGER"`
	Result               *string                `json:"result,omitempty" yaml:"result,omitempty" table:"-"`
	Type                 string                 `json:"type,omitempty" yaml:"type,omitempty" table:"TYPE"`
	Input                map[string]interface{} `json:"input,omitempty" yaml:"input,omitempty" table:"-"`
	HourlyExecutionLimit *int                   `json:"hourlyExecutionLimit,omitempty" yaml:"hourlyExecutionLimit,omitempty" table:"-"`
	Guide                *string                `json:"guide,omitempty" yaml:"guide,omitempty" table:"-"`
	Tasks                map[string]interface{} `json:"tasks,omitempty" yaml:"tasks,omitempty" table:"-"`
}

Workflow represents a workflow resource (CLI version with table tags).

type WorkflowFilters

type WorkflowFilters = sdkworkflow.WorkflowFilters

Re-export SDK types that have no table tags.

type WorkflowList

type WorkflowList struct {
	Count   int        `json:"count"`
	Results []Workflow `json:"results"`
}

WorkflowList represents a list of workflows.

Jump to

Keyboard shortcuts

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