workflow

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: Apache-2.0 Imports: 19 Imported by: 0 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

This section is empty.

Variables

This section is empty.

Functions

func RegisteredTaskTypes

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

type Validator[T any] interface {
	*T
	Validate() error
}

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

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

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.

Jump to

Keyboard shortcuts

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