Help us shape the future of Go! Take the 2026 Go Developer Survey

worker

package
v0.112.15 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 31 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func At deprecated

func At(t ...time.Time) scheduled

Deprecated: At is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func Cron deprecated

func Cron(c string) cron

Deprecated: Cron is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func Crons deprecated

func Crons(c ...string) cronArr

Deprecated: Crons is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func Event deprecated

func Event(e string) event

Deprecated: Event is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func Events deprecated

func Events(events ...string) eventsArr

Deprecated: Events is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func IsNonRetryableError deprecated

func IsNonRetryableError(err error) bool

Deprecated: use hatchet.IsNonRetryableError from github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func NewNonRetryableError deprecated

func NewNonRetryableError(err error) error

Deprecated: use hatchet.NewNonRetryableError from github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func NewRetryAfterError deprecated added in v0.110.23

func NewRetryAfterError(after time.Duration, err error) error

Deprecated: use hatchet.NewRetryAfterError from github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func NoTrigger deprecated

func NoTrigger() noTrigger

Deprecated: NoTrigger is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func SetContextDurableHooks added in v0.83.58

func SetContextDurableHooks(ctx HatchetContext, hook DurableEvictionHook, listener *client.DurableTaskListener, supportsEviction bool)

SetContextDurableHooks attaches eviction and durable-task infrastructure to ctx. Pass nil hook and nil listener to clear. Intended for internal SDK use only.

Types

type Action deprecated

type Action interface {
	// Name returns the name of the action
	Name() string

	// Run runs the action
	Run(args ...any) []any

	MethodFn() any

	ConcurrencyFn() GetWorkflowConcurrencyGroupFn

	// Service returns the service that the action belongs to
	Service() string

	Compute() *compute.Compute
}

Deprecated: Action is an internal interface used by the new Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead of using this directly. Migration guide: https://docs.hatchet.run/home/migration-guide-go

type ActionMap deprecated

type ActionMap map[string]ActionWithCompute

Deprecated: ActionMap is an internal type used by the new Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead of using this directly. Migration guide: https://docs.hatchet.run/home/migration-guide-go

type ActionRegistry deprecated

type ActionRegistry map[string]Action

Deprecated: ActionRegistry is an internal type used by the new Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead of using this directly. Migration guide: https://docs.hatchet.run/home/migration-guide-go

type ActionWithCompute deprecated

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

Deprecated: ActionWithCompute is an internal type used by the new Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead of using this directly. Migration guide: https://docs.hatchet.run/home/migration-guide-go

type DurableEvictionHook added in v0.83.58

type DurableEvictionHook interface {
	// MarkWaiting signals that the run identified by key has entered a waiting state.
	// waitKind describes what the run is waiting on; resourceID is an opaque identifier
	// (e.g. signal key, event key, child workflow name) useful for logging.
	MarkWaiting(key, waitKind, resourceID string)

	// MarkActive signals that the run identified by key has exited a waiting state.
	// It is reference-counted against MarkWaiting calls with the same key.
	MarkActive(key string)
}

DurableEvictionHook observes waiting state transitions for a durable run so an eviction manager can decide when to evict a waiting run. Implementations must be safe for concurrent use. Kinds used by the SDK: "wait_for", "sleep", "wait_for_event", "spawn_child".

type DurableHatchetContext

type DurableHatchetContext interface {
	HatchetContext

	// SleepFor pauses execution for the specified duration and returns after that time has elapsed.
	// Duration is "global" meaning it will wait in real time regardless of transient failures
	// like worker restarts.
	SleepFor(duration time.Duration) (*SingleWaitResult, error)

	// WaitForEvent pauses execution until the specified user event is received.
	// Options such as condition.WithEventScope and condition.WithConsiderEventsSince
	// can be used to scope the wait and match events pushed before the wait started.
	WaitForEvent(eventKey, expression string, opts ...condition.UserEventConditionOpt) (*SingleWaitResult, error)

	// WaitFor pauses execution until the specified conditions are met.
	// Conditions are "global" meaning they will wait in real time regardless of transient failures
	// like worker restarts.
	WaitFor(conditions condition.Condition) (*WaitResult, error)

	// Memo executes fn, JSON-serializes the result, and persists it via the engine's
	// durable event log. On replay, the cached payload is returned without re-executing
	// fn. Callers should json.Unmarshal the returned bytes into their concrete type.
	// If the engine does not support durable memoization, fn is executed and the result
	// is cached in process only (it will not survive replay).
	// The key must be unique within the task.
	Memo(key string, fn func() (any, error)) (json.RawMessage, error)

	// Now returns the current time, memoized via Memo so replays return the same value.
	Now() (time.Time, error)

	// InvocationCount returns the current invocation count for this durable task.
	// Increments each time the task is started (including after eviction/restore).
	InvocationCount() int32

	// SleepUntil sleeps until the specified absolute time. Combines Now() with SleepFor.
	SleepUntil(t time.Time) (*SingleWaitResult, error)
}

DurableHatchetContext extends HatchetContext with methods for durable tasks.

func NewDurableHatchetContext deprecated

func NewDurableHatchetContext(ctx HatchetContext) DurableHatchetContext

Deprecated: NewDurableHatchetContext is an internal function used by the new Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead of calling this directly. Migration guide: https://docs.hatchet.run/home/migration-guide-go

type ErrMarshalKeyNotFound

type ErrMarshalKeyNotFound struct {
	Key string
}

func (ErrMarshalKeyNotFound) Error

func (e ErrMarshalKeyNotFound) Error() string

type GetWorkflowConcurrencyGroupFn deprecated

type GetWorkflowConcurrencyGroupFn func(ctx HatchetContext) (string, error)

Deprecated: GetWorkflowConcurrencyGroupFn is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

type HatchetContext

type HatchetContext interface {
	context.Context

	// SetContext replaces the underlying context.Context, for example to attach a deadline.
	SetContext(ctx context.Context)

	// GetContext returns the underlying context.Context.
	GetContext() context.Context

	// Worker returns the worker executing the task, which exposes its ID, labels, and
	// registered workflows.
	Worker() HatchetWorkerContext

	// StepOutput decodes the output of the named upstream step into target, which must
	// be a pointer. Prefer ParentOutput, which takes a task reference instead of a name.
	StepOutput(step string, target interface{}) error

	// TriggerDataKeys lists the keys available to TriggerData.
	TriggerDataKeys() []string

	// TriggerData decodes the payload of a matched trigger condition (such as a wait-for
	// event) into target, which must be a pointer.
	TriggerData(key string, target interface{}) error

	// StepRunErrors returns the errors of upstream task runs, keyed by task name.
	// Intended for use in an on-failure task.
	StepRunErrors() map[string]string

	// TriggeredByEvent reports whether the current run was triggered by an event.
	TriggeredByEvent() bool

	// WorkflowInput decodes the workflow input into target, which must be a pointer.
	// Prefer the typed input argument passed to the task function.
	WorkflowInput(target interface{}) error

	// BatchInputInto decodes the buffered items of a batch task's START_BATCH action into
	// target, which must be a pointer. The decoded value is a map keyed by each buffered
	// item's task run external id.
	BatchInputInto(target interface{}) error

	// UserData decodes the user data attached to the step into target, which must be a
	// pointer.
	UserData(target interface{}) error

	// AdditionalMetadata returns the additional metadata sent with the current run.
	AdditionalMetadata() map[string]string

	// StepName returns the name of the currently running task.
	StepName() string

	// StepRunId returns the ID of the current task run.
	StepRunId() string

	// StepId returns the ID of the step (the task declaration, not the run).
	StepId() string

	// WorkflowRunId returns the ID of the current workflow run.
	WorkflowRunId() string

	// WorkflowId returns the ID of the workflow this task belongs to, or nil if unknown.
	WorkflowId() *string

	// WorkflowVersionId returns the ID of the workflow version this task belongs to, or
	// nil if unknown.
	WorkflowVersionId() *string

	// Log sends a log line to the Hatchet API for the current task run.
	Log(message string)

	// StreamEvent sends a raw stream event for the current task run, which separate
	// consumers can subscribe to.
	StreamEvent(message []byte)

	// PutStream sends a stream event for the current task run, which separate consumers
	// can subscribe to.
	PutStream(message string)

	// SpawnWorkflow triggers a child workflow run from within the current task. Prefer
	// passing this context to a workflow's Run method, which spawns a child run
	// automatically.
	SpawnWorkflow(workflowName string, input any, opts *SpawnWorkflowOpts) (*client.Workflow, error)

	// SpawnWorkflows triggers multiple child workflow runs from within the current task.
	SpawnWorkflows(childWorkflows []*SpawnWorkflowsOpts) ([]*client.Workflow, error)

	// ReleaseSlot manually releases the worker slot held by the current task run to free
	// up capacity. Advanced feature; use with caution.
	ReleaseSlot() error

	// RefreshTimeout extends the execution timeout of the current task run by the given
	// duration string, such as "5m".
	RefreshTimeout(incrementTimeoutBy string) error

	// RetryCount returns the number of times the current task run has been retried.
	RetryCount() int

	// ParentOutput decodes the output of a parent task into output, which must be a
	// pointer. Pass the task reference returned by NewTask.
	ParentOutput(parent create.NamedTask, output interface{}) error

	// WasSkipped reports whether the given parent task was skipped.
	WasSkipped(parent create.NamedTask) bool

	// TenantId returns the ID of the tenant the run is executing in.
	TenantId() string

	// WorkerId returns the ID of the worker executing the task.
	WorkerId() string

	// ActionId returns the action ID of the currently running task.
	ActionId() string

	// DurableTaskInvocationCount returns the invocation count for durable task replay tracking.
	// Returns 0 if not set (non-durable tasks).
	DurableTaskInvocationCount() int32

	// CurChildIndex returns the index that will be assigned to the next spawned child
	// workflow. For internal use by the SDK's child workflow bookkeeping.
	CurChildIndex() int
	// IncChildIndex increments the child workflow index. For internal use by the SDK's
	// child workflow bookkeeping.
	IncChildIndex()

	// Priority returns the priority the current run was triggered with.
	Priority() int32

	// FilterPayload returns the payload of the event filter that matched, if the run was
	// triggered through a filter.
	FilterPayload() map[string]interface{}

	// ParentWorkflowRunId returns the workflow run ID of the parent run, if this run was
	// spawned as a child workflow.
	ParentWorkflowRunId() *string

	// ChildIndex returns the index of this run among its parent's child workflow runs,
	// if applicable.
	ChildIndex() *int32

	// ChildKey returns the deduplication key this run was spawned with, if applicable.
	ChildKey() *string

	// TriggeringEventId returns the ID of the event that triggered this run, if it was
	// triggered by an event.
	TriggeringEventId() *string

	// TriggeringEventKey returns the key of the event that triggered this run, if it was
	// triggered by an event.
	TriggeringEventKey() *string
	// contains filtered or unexported methods
}

type HatchetWorkerContext

type HatchetWorkerContext interface {
	context.Context

	SetContext(ctx context.Context)

	GetContext() context.Context

	ID() string

	GetLabels() map[string]interface{}

	UpsertLabels(labels map[string]interface{}) error

	HasWorkflow(workflowName string) bool
}

type JobRunLookupData deprecated

type JobRunLookupData struct {
	Input       map[string]interface{} `json:"input"`
	TriggeredBy TriggeredBy            `json:"triggered_by"`
	Steps       map[string]StepData    `json:"steps,omitempty"`
}

Deprecated: JobRunLookupData is an internal type used by the new Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead of using this directly. Migration guide: https://docs.hatchet.run/home/migration-guide-go

type ManagedCompute deprecated

type ManagedCompute struct {
	ActionRegistry  *ActionRegistry
	Client          client.Client
	MaxRuns         int
	RuntimeConfigs  []rest.CreateManagedWorkerRuntimeConfigRequest
	CloudRegisterID *string
	Logger          *zerolog.Logger
}

Deprecated: ManagedCompute is an internal type used by the new Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead of using this directly. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func NewManagedCompute deprecated

func NewManagedCompute(actionRegistry *ActionRegistry, client client.Client, maxRuns int) *ManagedCompute

Deprecated: NewManagedCompute is an internal function used by the new Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead of calling this directly. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func (*ManagedCompute) CloudRegister deprecated

func (mc *ManagedCompute) CloudRegister(ctx context.Context)

Deprecated: CloudRegister is an internal method used by the new Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead of calling this directly. Migration guide: https://docs.hatchet.run/home/migration-guide-go

type MiddlewareFunc deprecated

type MiddlewareFunc func(ctx HatchetContext, next func(HatchetContext) error) error

Deprecated: use hatchet.MiddlewareFunc from github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

type NonRetryableError deprecated

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

Deprecated: use hatchet.NonRetryableError from github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func (*NonRetryableError) Error

func (e *NonRetryableError) Error() string

type RateLimit deprecated

type RateLimit struct {
	// Key is the rate limit key
	Key     string  `yaml:"key,omitempty"`
	KeyExpr *string `yaml:"keyExpr,omitempty"`

	// Units is the amount of units this step consumes
	Units          *int    `yaml:"units,omitempty"`
	UnitsExpr      *string `yaml:"unitsExpr,omitempty"`
	LimitValueExpr *string `yaml:"limitValueExpr,omitempty"`

	// Duration is the duration of the rate limit
	Duration *types.RateLimitDuration `yaml:"duration,omitempty"`
}

Deprecated: RateLimit is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

type RegisterActionOpt deprecated

type RegisterActionOpt func(*registerActionOpts)

Deprecated: RegisterActionOpt is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func WithActionName deprecated

func WithActionName(name string) RegisterActionOpt

Deprecated: WithActionName is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func WithCompute deprecated

func WithCompute(compute *compute.Compute) RegisterActionOpt

Deprecated: WithCompute is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

type RetryAfterError deprecated added in v0.110.23

type RetryAfterError struct {
	After time.Duration
	// contains filtered or unexported fields
}

Deprecated: use hatchet.RetryAfterError from github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func AsRetryAfterError deprecated added in v0.110.23

func AsRetryAfterError(err error) (*RetryAfterError, bool)

Deprecated: use hatchet.AsRetryAfterError from github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func (*RetryAfterError) Error added in v0.110.23

func (e *RetryAfterError) Error() string

func (*RetryAfterError) Unwrap added in v0.110.23

func (e *RetryAfterError) Unwrap() error

type Service deprecated

type Service struct {
	Name string
	// contains filtered or unexported fields
}

Deprecated: Service is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func (*Service) Call deprecated

func (s *Service) Call(verb string) *WorkflowStep

Deprecated: Call is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func (*Service) On deprecated

func (s *Service) On(t triggerConverter, workflow workflowConverter) error

Deprecated: On is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func (*Service) RegisterAction deprecated

func (s *Service) RegisterAction(fn any, opts ...RegisterActionOpt) error

Deprecated: RegisterAction is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func (*Service) RegisterWorkflow deprecated

func (s *Service) RegisterWorkflow(workflow workflowConverter) error

Deprecated: RegisterWorkflow is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func (*Service) Use deprecated

func (s *Service) Use(mws ...MiddlewareFunc)

Deprecated: Use is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

type SingleWaitResult

type SingleWaitResult struct {
	*WaitResult
	// contains filtered or unexported fields
}

func (*SingleWaitResult) Unmarshal

func (w *SingleWaitResult) Unmarshal(in interface{}) error

Unmarshal decodes the matched event or condition payload into in, which must be a pointer. hatchet.EventInto is a convenience wrapper around it.

type SpawnWorkflowOpts deprecated

type SpawnWorkflowOpts struct {
	Key                 *string
	Sticky              *bool
	AdditionalMetadata  *map[string]string
	Priority            *int32
	DesiredWorkerLabels map[string]*types.DesiredWorkerLabel
}

Deprecated: SpawnWorkflowOpts is an internal type used by the new Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead of using this directly. Migration guide: https://docs.hatchet.run/home/migration-guide-go

type SpawnWorkflowsOpts deprecated

type SpawnWorkflowsOpts struct {
	WorkflowName        string
	Input               any
	Key                 *string
	Sticky              *bool
	Priority            *int32
	AdditionalMetadata  *map[string]string
	DesiredWorkerLabels map[string]*types.DesiredWorkerLabel
}

Deprecated: SpawnWorkflowsOpts is an internal type used by the new Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead of using this directly. Migration guide: https://docs.hatchet.run/home/migration-guide-go

type Step deprecated

type Step struct {
	Id string

	// non-ctx input is not optional
	NonCtxInput reflect.Type

	// non-err output is optional
	NonErrOutput *reflect.Type

	APIStep types.WorkflowStep
}

Deprecated: Step is an internal type used by the new Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead of using this directly. Migration guide: https://docs.hatchet.run/home/migration-guide-go

type StepData deprecated

type StepData map[string]interface{}

Deprecated: StepData is an internal type used by the new Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead of using this directly. Migration guide: https://docs.hatchet.run/home/migration-guide-go

type StepRunData deprecated

type StepRunData struct {
	Input              map[string]interface{}            `json:"input"`
	TriggeredBy        TriggeredBy                       `json:"triggered_by"`
	Parents            map[string]StepData               `json:"parents"`
	Triggers           map[string]map[string]interface{} `json:"triggers,omitempty"`
	AdditionalMetadata map[string]string                 `json:"additional_metadata"`
	UserData           map[string]interface{}            `json:"user_data"`
	StepRunErrors      map[string]string                 `json:"step_run_errors,omitempty"`
}

Deprecated: StepRunData is an internal type used by the new Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead of using this directly. Migration guide: https://docs.hatchet.run/home/migration-guide-go

type TriggeredBy deprecated

type TriggeredBy string

Deprecated: TriggeredBy is an internal type used by the new Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead of using this directly. Migration guide: https://docs.hatchet.run/home/migration-guide-go

const (
	TriggeredByEvent    TriggeredBy = "event"
	TriggeredByCron     TriggeredBy = "cron"
	TriggeredBySchedule TriggeredBy = "schedule"
)

Deprecated: These constants are part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

type WaitResult

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

func (*WaitResult) Keys

func (w *WaitResult) Keys() []string

Keys returns the readable keys of the conditions that produced this result, such as user event keys and "sleep:<duration>" entries.

func (*WaitResult) Unmarshal

func (w *WaitResult) Unmarshal(key string, in interface{}) error

Unmarshal decodes the payload matched for the given condition key into in, which must be a pointer.

type Worker deprecated

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

Deprecated: Worker is an internal type used by the new Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead of using this directly. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func NewWorker deprecated

func NewWorker(fs ...WorkerOpt) (*Worker, error)

Deprecated: NewWorker is an internal function used by the new Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead of calling this directly. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func (*Worker) Call deprecated

func (w *Worker) Call(action string) *WorkflowStep

Deprecated: Call is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func (*Worker) CancelStepRun added in v0.83.58

func (w *Worker) CancelStepRun(stepRunId string)

CancelStepRun cancels a running step by its step run ID. Used by the eviction system to interrupt durable tasks that need to be evicted.

func (*Worker) ID deprecated

func (w *Worker) ID() *string

Deprecated: ID is an internal method used by the new Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead of calling this directly. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func (*Worker) Logger deprecated

func (w *Worker) Logger() *zerolog.Logger

Deprecated: Logger is an internal method used by the new Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead of calling this directly. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func (*Worker) NewService deprecated

func (w *Worker) NewService(name string) *Service

Deprecated: NewService is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func (*Worker) On deprecated

func (w *Worker) On(t triggerConverter, workflow workflowConverter) error

Deprecated: On is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func (*Worker) RegisterAction deprecated

func (w *Worker) RegisterAction(actionId string, method any) error

Deprecated: RegisterAction is an internal method used by the new Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead of calling this directly. Migration guide: https://docs.hatchet.run/home/migration-guide-go

An action should be of the format <service>:<verb>, for example slack:create-channel.

The method must match the following signatures: - func(ctx context.Context) error - func(ctx context.Context, input *Input) error - func(ctx context.Context, input *Input) (*Output, error) - func(ctx context.Context) (*Output, error)

func (*Worker) RegisterWorkflow deprecated

func (w *Worker) RegisterWorkflow(workflow workflowConverter) error

Deprecated: RegisterWorkflow is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func (*Worker) RegisterWorkflowV1 deprecated

func (w *Worker) RegisterWorkflowV1(workflow *contracts.CreateWorkflowVersionRequest) error

Deprecated: RegisterWorkflowV1 is an internal method used by the new Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead of calling this directly. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func (*Worker) Run deprecated

func (w *Worker) Run(ctx context.Context) error

Deprecated: Run is an internal method used by the new Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead of calling this directly. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func (*Worker) SetPanicHandler deprecated added in v0.73.0

func (w *Worker) SetPanicHandler(panicHandler func(ctx HatchetContext, recovered any))

Deprecated: SetPanicHandler is an internal method used by the new Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead of calling this directly. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func (*Worker) Start deprecated

func (w *Worker) Start() (func() error, error)

Deprecated: Start is an internal method used by the new Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead of calling this directly. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func (*Worker) Use deprecated

func (w *Worker) Use(mws ...MiddlewareFunc)

Deprecated: Use is an internal method used by the new Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead of calling this directly. Migration guide: https://docs.hatchet.run/home/migration-guide-go

type WorkerOpt deprecated

type WorkerOpt func(*WorkerOpts)

Deprecated: WorkerOpt is an internal type used by the new Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead of using this directly. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func WithClient deprecated

func WithClient(client client.Client) WorkerOpt

Deprecated: WithClient is an internal function used by the new Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead of calling this directly. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func WithDurableSlots deprecated added in v0.78.27

func WithDurableSlots(durableSlots int) WorkerOpt

Deprecated: WithSlots is an internal function used by the new Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead of calling this directly. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func WithErrorAlerter deprecated

func WithErrorAlerter(alerter errors.Alerter) WorkerOpt

Deprecated: WithErrorAlerter is an internal function used by the new Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead of calling this directly. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func WithIntegration deprecated

func WithIntegration(integration integrations.Integration) WorkerOpt

Deprecated: WithIntegration is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func WithInternalData deprecated

func WithInternalData(actions []string) WorkerOpt

Deprecated: WithInternalData is an internal function used by the new Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead of calling this directly. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func WithLabels deprecated

func WithLabels(labels map[string]interface{}) WorkerOpt

Deprecated: WithLabels is an internal function used by the new Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead of calling this directly. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func WithLegacySlots added in v0.78.27

func WithLegacySlots(slots int32) WorkerOpt

WithLegacySlots configures the worker to register using the deprecated `slots` proto field instead of `slot_config`. This is for backward compatibility with engines that do not support multiple slot types.

func WithLogLevel deprecated

func WithLogLevel(lvl string) WorkerOpt

Deprecated: WithLogLevel is an internal function used by the new Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead of calling this directly. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func WithLogger deprecated

func WithLogger(l *zerolog.Logger) WorkerOpt

Deprecated: WithLogger is an internal function used by the new Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead of calling this directly. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func WithMaxRuns deprecated

func WithMaxRuns(maxRuns int) WorkerOpt

Deprecated: WithMaxRuns is an internal function used by the new Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead of calling this directly. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func WithName deprecated

func WithName(name string) WorkerOpt

Deprecated: WithName is an internal function used by the new Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead of calling this directly. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func WithSlotConfig deprecated added in v0.78.27

func WithSlotConfig(slotConfig map[string]int32) WorkerOpt

Deprecated: WithSlots is an internal function used by the new Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead of calling this directly. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func WithSlots deprecated added in v0.78.13

func WithSlots(slots int) WorkerOpt

Deprecated: WithSlots is an internal function used by the new Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead of calling this directly. Migration guide: https://docs.hatchet.run/home/migration-guide-go

type WorkerOpts deprecated

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

Deprecated: WorkerOpts is an internal type used by the new Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead of using this directly. Migration guide: https://docs.hatchet.run/home/migration-guide-go

type Workflow deprecated

type Workflow struct {
	Jobs []WorkflowJob
}

Deprecated: Workflow is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

type WorkflowConcurrency deprecated

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

Deprecated: WorkflowConcurrency is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func Concurrency deprecated

Deprecated: Concurrency is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func Expression deprecated

func Expression(expr string) *WorkflowConcurrency

Deprecated: Expression is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func (*WorkflowConcurrency) LimitStrategy deprecated

Deprecated: LimitStrategy is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func (*WorkflowConcurrency) MaxRuns deprecated

func (c *WorkflowConcurrency) MaxRuns(maxRuns int32) *WorkflowConcurrency

Deprecated: MaxRuns is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

type WorkflowJob deprecated

type WorkflowJob struct {
	// The name of the job
	Name string

	Description string

	On triggerConverter

	Concurrency *WorkflowConcurrency

	// The steps that are run in the job
	Steps []*WorkflowStep

	OnFailure *WorkflowJob

	ScheduleTimeout string

	StickyStrategy *types.StickyStrategy
}

Deprecated: WorkflowJob is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func (*WorkflowJob) ToActionMap deprecated

func (j *WorkflowJob) ToActionMap(svcName string) ActionMap

Deprecated: ToActionMap is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func (*WorkflowJob) ToWorkflow deprecated

func (j *WorkflowJob) ToWorkflow(svcName string, namespace string) types.Workflow

Deprecated: ToWorkflow is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func (*WorkflowJob) ToWorkflowJob deprecated

func (j *WorkflowJob) ToWorkflowJob(svcName string, namespace string) (*types.WorkflowJob, error)

Deprecated: ToWorkflowJob is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func (*WorkflowJob) ToWorkflowTrigger deprecated

func (j *WorkflowJob) ToWorkflowTrigger() triggerConverter

Deprecated: ToWorkflowTrigger is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

type WorkflowStep deprecated

type WorkflowStep struct {
	// The step timeout
	Timeout string

	// The executed function
	Function any

	// The step id/name. If not set, one will be generated from the function name
	Name string

	// The ids of the parents
	Parents []string

	Retries int

	RetryBackoffFactor *float32

	RetryMaxBackoffSeconds *int32

	RateLimit []RateLimit

	DesiredLabels map[string]*types.DesiredWorkerLabel

	Compute *compute.Compute
}

Deprecated: WorkflowStep is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func Fn deprecated

func Fn(f any) *WorkflowStep

Deprecated: Fn is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func (*WorkflowStep) AddParents deprecated

func (w *WorkflowStep) AddParents(parents ...string) *WorkflowStep

Deprecated: AddParents is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func (*WorkflowStep) GetActionId deprecated

func (w *WorkflowStep) GetActionId(svcName string, index int) string

Deprecated: GetActionId is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func (*WorkflowStep) GetStepId deprecated

func (w *WorkflowStep) GetStepId(index int) string

Deprecated: GetStepId is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func (*WorkflowStep) SetCompute deprecated

func (w *WorkflowStep) SetCompute(compute *compute.Compute) *WorkflowStep

Deprecated: SetCompute is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func (*WorkflowStep) SetDesiredLabels deprecated

func (w *WorkflowStep) SetDesiredLabels(labels map[string]*types.DesiredWorkerLabel) *WorkflowStep

Deprecated: SetDesiredLabels is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func (*WorkflowStep) SetName deprecated

func (w *WorkflowStep) SetName(name string) *WorkflowStep

Deprecated: SetName is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func (*WorkflowStep) SetRateLimit deprecated

func (w *WorkflowStep) SetRateLimit(rateLimit RateLimit) *WorkflowStep

Deprecated: SetRateLimit is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func (*WorkflowStep) SetRetries deprecated

func (w *WorkflowStep) SetRetries(retries int) *WorkflowStep

Deprecated: SetRetries is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func (*WorkflowStep) SetRetryBackoffFactor deprecated

func (w *WorkflowStep) SetRetryBackoffFactor(retryBackoffFactor float32) *WorkflowStep

Deprecated: SetRetryBackoffFactor is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func (*WorkflowStep) SetRetryMaxBackoffSeconds deprecated

func (w *WorkflowStep) SetRetryMaxBackoffSeconds(retryMaxBackoffSeconds int32) *WorkflowStep

Deprecated: SetRetryMaxBackoffSeconds is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func (*WorkflowStep) SetTimeout deprecated

func (w *WorkflowStep) SetTimeout(timeout string) *WorkflowStep

Deprecated: SetTimeout is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func (*WorkflowStep) ToActionMap deprecated

func (w *WorkflowStep) ToActionMap(svcName string) ActionMap

Deprecated: ToActionMap is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func (*WorkflowStep) ToWorkflow deprecated

func (w *WorkflowStep) ToWorkflow(svcName string, namespace string) types.Workflow

Deprecated: ToWorkflow is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func (*WorkflowStep) ToWorkflowStep deprecated

func (w *WorkflowStep) ToWorkflowStep(svcName string, index int, namespace string) (*Step, error)

Deprecated: ToWorkflowStep is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func (*WorkflowStep) ToWorkflowTrigger deprecated

func (w *WorkflowStep) ToWorkflowTrigger() triggerConverter

Deprecated: ToWorkflowTrigger is part of the legacy v0 workflow definition system. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

Directories

Path Synopsis
Deprecated: This package is part of the legacy v0 workflow definition system.
Deprecated: This package is part of the legacy v0 workflow definition system.

Jump to

Keyboard shortcuts

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