Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisteredTaskTypes ¶ added in v1.4.0
func RegisteredTaskTypes() []string
RegisteredTaskTypes returns the string names of all task-dispatched (non-zero TaskType) workflows in registration order, for use in error messages.
Types ¶
type Validator ¶ added in v1.4.0
Validator is a type constraint for pointer types that expose a Validate method. Used by registerTaskWorkflow and unmarshalAndValidate to enforce that the concrete operation-info type can be validated at dispatch time.
type WorkflowDescriptor ¶ added in v1.4.0
type WorkflowDescriptor struct {
// TaskType identifies this workflow for task dispatch via Execute().
// Zero value (IsZero) means this workflow is internal and not dispatched as a task.
TaskType taskcommon.TaskType
// WorkflowName is the Temporal workflow name used in StartWorkflowOptions
// and RegisterWorkflowWithOptions.
WorkflowName string
// WorkflowFunc is the Go workflow function registered with the Temporal worker.
WorkflowFunc any
// Timeout is the maximum wall-clock execution time for this workflow type.
// May be zero for internal workflows where timeout is managed per invocation.
Timeout time.Duration
// Unmarshal deserializes the raw OperationInfo bytes into the typed payload
// that the Temporal workflow function expects as its second argument.
// Nil for internal workflows that are not dispatched via ExecutionRequest.
Unmarshal func(raw json.RawMessage) (any, error)
}
WorkflowDescriptor describes a Temporal workflow. It is a pure data struct — no Temporal client dependency.
func Get ¶ added in v1.4.0
func Get(taskType taskcommon.TaskType) (WorkflowDescriptor, bool)
Get returns the descriptor for a TaskType. ok is false if not registered.
func GetAllWorkflows ¶
func GetAllWorkflows() []WorkflowDescriptor
GetAllWorkflows returns all registered workflows as a snapshot slice in registration order, for Temporal worker registration via RegisterWorkflowWithOptions. Order is stable across calls: it reflects the order in which register() was invoked, not any particular file-processing order.