Documentation
¶
Index ¶
- Constants
- type Execution
- type ExecutionFilters
- type ExecutionHandler
- func (h *ExecutionHandler) Cancel(id string) error
- func (h *ExecutionHandler) Get(id string) (*Execution, error)
- func (h *ExecutionHandler) GetCompleteExecutionLog(executionID string) (string, error)
- func (h *ExecutionHandler) GetExecutionLog(executionID string) (string, error)
- func (h *ExecutionHandler) GetFullExecutionLog(executionID string) (string, error)
- func (h *ExecutionHandler) GetTaskLog(executionID, taskName string) (string, error)
- func (h *ExecutionHandler) GetTaskResult(executionID, taskName string) (any, error)
- func (h *ExecutionHandler) List(filters ExecutionFilters, limit int64) (*ExecutionList, error)
- func (h *ExecutionHandler) ListTasks(executionID string) ([]TaskExecution, error)
- type ExecutionList
- type Handler
- func (h *Handler) Create(data []byte) (*Workflow, error)
- func (h *Handler) Delete(id string) error
- func (h *Handler) Get(id string) (*Workflow, error)
- func (h *Handler) GetHistoryRecord(workflowID string, version int) (*Workflow, error)
- func (h *Handler) GetRaw(id string) ([]byte, error)
- func (h *Handler) List(filters WorkflowFilters, chunkSize, limit int64) (*WorkflowList, error)
- func (h *Handler) ListHistory(workflowID string) (*HistoryList, error)
- func (h *Handler) RestoreHistory(workflowID string, version int) (*Workflow, error)
- func (h *Handler) Update(id string, data []byte) (*Workflow, error)
- type HistoryList
- type HistoryRecord
- type TaskExecution
- type TaskExecutionMap
- type TaskLogError
- type TaskLogFailure
- type Workflow
- type WorkflowFilters
- type WorkflowList
Constants ¶
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 ¶
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 ¶
NewHandler creates a new workflow handler
func (*Handler) GetHistoryRecord ¶
GetHistoryRecord retrieves a specific version of a workflow
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 ¶
RestoreHistory restores a workflow to a specific version
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 ¶
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 ¶
WorkflowList represents a list of workflows.