Documentation
¶
Index ¶
- Constants
- Variables
- type CapabilityExecutionError
- type Client
- func (c *Client) CountExecutions(parent context.Context, workflowUUID string, statuses []ExecutionStatus) (int, error)
- func (c *Client) CreateServiceContextWithTimeout(parent context.Context) (context.Context, context.CancelFunc)
- func (c *Client) FindExecutionByOnChainID(parent context.Context, onChainID string) (*Execution, error)
- func (c *Client) GetExecution(parent context.Context, uuid string) (*Execution, error)
- func (c *Client) GetLatestDeployment(parent context.Context, workflowUUID string, from, to time.Time) (*WorkflowDeploymentRecord, error)
- func (c *Client) GetWorkflowSummary(parent context.Context, uuid string, from time.Time) (*WorkflowSummary, error)
- func (c *Client) ListAll(parent context.Context, pageSize int) ([]Workflow, error)
- func (c *Client) ListExecutionEvents(parent context.Context, in ListEventsInput) ([]ExecutionEvent, error)
- func (c *Client) ListExecutionLogs(parent context.Context, executionUUID string) ([]ExecutionLog, error)
- func (c *Client) ListExecutions(parent context.Context, in ListExecutionsInput) ([]Execution, error)
- func (c *Client) ListWithFilter(parent context.Context, pageSize int, filter ListFilter) ([]Workflow, error)
- func (c *Client) SearchByName(parent context.Context, name string, pageSize int, ownerAddress string) ([]Workflow, error)
- func (c *Client) SetServiceTimeout(timeout time.Duration)
- type Execution
- type ExecutionError
- type ExecutionEvent
- type ExecutionLog
- type ExecutionStatus
- type ListEventsInput
- type ListExecutionsInput
- type ListFilter
- type Workflow
- type WorkflowDeploymentRecord
- type WorkflowSummary
Constants ¶
const DefaultPageSize = 100
Variables ¶
var ValidExecutionStatuses = []ExecutionStatus{ ExecutionStatusTriggered, ExecutionStatusInProgress, ExecutionStatusSuccess, ExecutionStatusFailure, }
ValidExecutionStatuses is the full set of values accepted by the platform.
Functions ¶
This section is empty.
Types ¶
type CapabilityExecutionError ¶ added in v1.24.0
CapabilityExecutionError is an error attached to a capability event.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client fetches workflow data from the CRE platform GraphQL API.
func New ¶
func New(gql *graphqlclient.Client, log *zerolog.Logger) *Client
New creates a WorkflowDataClient backed by the provided GraphQL client.
func (*Client) CountExecutions ¶ added in v1.24.0
func (c *Client) CountExecutions(parent context.Context, workflowUUID string, statuses []ExecutionStatus) (int, error)
CountExecutions returns the total number of executions matching the given filters. It fetches only a single-item page — only the count field is used.
func (*Client) CreateServiceContextWithTimeout ¶ added in v1.17.0
func (*Client) FindExecutionByOnChainID ¶ added in v1.24.0
func (c *Client) FindExecutionByOnChainID(parent context.Context, onChainID string) (*Execution, error)
FindExecutionByOnChainID resolves the platform UUID for an execution given its on-chain hex ID (the identifier shown in the Explorer UI). It uses the platform workflowExecutions search filter, then verifies an exact id match on the result.
func (*Client) GetExecution ¶ added in v1.24.0
GetExecution fetches a single execution by its UUID.
func (*Client) GetLatestDeployment ¶ added in v1.24.0
func (c *Client) GetLatestDeployment(parent context.Context, workflowUUID string, from, to time.Time) (*WorkflowDeploymentRecord, error)
GetLatestDeployment fetches the most recent deployment record for a workflow. from/to mirror what the Explorer UI passes — the backend requires them even though the schema marks them optional.
func (*Client) GetWorkflowSummary ¶ added in v1.24.0
func (c *Client) GetWorkflowSummary(parent context.Context, uuid string, from time.Time) (*WorkflowSummary, error)
GetWorkflowSummary fetches extended workflow details including execution health.
func (*Client) ListExecutionEvents ¶ added in v1.24.0
func (c *Client) ListExecutionEvents(parent context.Context, in ListEventsInput) ([]ExecutionEvent, error)
ListExecutionEvents fetches all node/capability events for an execution.
func (*Client) ListExecutionLogs ¶ added in v1.24.0
func (c *Client) ListExecutionLogs(parent context.Context, executionUUID string) ([]ExecutionLog, error)
ListExecutionLogs fetches all log lines for an execution.
func (*Client) ListExecutions ¶ added in v1.24.0
func (c *Client) ListExecutions(parent context.Context, in ListExecutionsInput) ([]Execution, error)
ListExecutions fetches workflow executions matching the given filters. At most one page of results is returned; Limit controls page size (max 100).
func (*Client) ListWithFilter ¶ added in v1.24.0
func (c *Client) ListWithFilter(parent context.Context, pageSize int, filter ListFilter) ([]Workflow, error)
ListWithFilter pages through the ListWorkflows query with optional search and workflow-owner filters.
func (*Client) SearchByName ¶ added in v1.13.0
func (c *Client) SearchByName(parent context.Context, name string, pageSize int, ownerAddress string) ([]Workflow, error)
SearchByName pages through the ListWorkflows query with the given search filter (server-side contains match on workflow name). When ownerAddress is non-empty, results are scoped to that workflow owner.
func (*Client) SetServiceTimeout ¶ added in v1.17.0
type Execution ¶ added in v1.24.0
type Execution struct {
UUID string
ID string // on-chain execution ID shown in the Explorer UI
WorkflowUUID string
WorkflowID string // on-chain workflow hash (workflowId scalar)
WorkflowName string
Status ExecutionStatus
StartedAt time.Time
FinishedAt *time.Time
CreditUsed *string // CreditAmount scalar serialised as a string
Errors []ExecutionError
}
Execution is a single workflow execution record.
type ExecutionError ¶ added in v1.24.0
ExecutionError is a top-level error on a workflow execution.
type ExecutionEvent ¶ added in v1.24.0
type ExecutionEvent struct {
CapabilityID string
Status string
StartedAt time.Time
FinishedAt *time.Time
Errors []CapabilityExecutionError
Method *string
}
ExecutionEvent is one node/capability event within an execution.
type ExecutionLog ¶ added in v1.24.0
ExecutionLog is a single log line emitted during an execution.
type ExecutionStatus ¶ added in v1.24.0
type ExecutionStatus string
ExecutionStatus mirrors the WorkflowExecutionStatus enum from the platform schema.
const ( ExecutionStatusUnknown ExecutionStatus = "UNKNOWN" ExecutionStatusUnspecified ExecutionStatus = "UNSPECIFIED" ExecutionStatusTriggered ExecutionStatus = "TRIGGERED" ExecutionStatusInProgress ExecutionStatus = "IN_PROGRESS" ExecutionStatusSuccess ExecutionStatus = "SUCCESS" ExecutionStatusFailure ExecutionStatus = "FAILURE" )
type ListEventsInput ¶ added in v1.24.0
ListEventsInput maps to WorkflowExecutionEventsInput on the platform.
type ListExecutionsInput ¶ added in v1.24.0
type ListExecutionsInput struct {
WorkflowUUID *string
Statuses []ExecutionStatus
From *time.Time
To *time.Time
// Search is passed to the platform search filter (e.g. on-chain execution id hex).
Search *string
// Limit is the maximum number of results to return (capped at 100 by the API).
Limit int
}
ListExecutionsInput maps to WorkflowExecutionsInput on the platform.
type ListFilter ¶ added in v1.24.0
ListFilter controls optional server-side filters for ListWorkflows.
type Workflow ¶
type Workflow struct {
UUID string
Name string
WorkflowID string
OwnerAddress string
Status string
WorkflowSource string
}
Workflow is a workflow row returned by the platform list API.
type WorkflowDeploymentRecord ¶ added in v1.24.0
type WorkflowDeploymentRecord struct {
UUID string
WorkflowID string
Status string
DeployedAt time.Time
TxHash *string
BinaryURL *string
ConfigURL *string
ErrorMessage *string
}
WorkflowDeploymentRecord is a single deployment entry.
type WorkflowSummary ¶ added in v1.24.0
type WorkflowSummary struct {
UUID string
Name string
WorkflowID string
OwnerAddress string
Status string
WorkflowSource string
RegisteredAt time.Time
ExecutedAt *time.Time
ExecutionCount int
SuccessCount int
FailureCount int
}
WorkflowSummary is an extended workflow record including execution health fields.