types

package
v0.109.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToYAML deprecated

func ToYAML(ctx context.Context, workflow *Workflow) ([]byte, error)

Deprecated: ToYAML 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

Types

type Action

type Action struct {
	// Required. The service that this belongs to
	Service string

	// Required. The verb to perform.
	Verb string

	// Optional. A way to unique identify the step.
	Subresource string
}

func ParseActionID

func ParseActionID(actionID string) (Action, error)

ParseActionID parses an action ID into its constituent parts. A semicolon is rejected anywhere in the id: it is the separator the worker action hash frames ids with, so an id carrying one could make two different action sets hash equal within a tenant.

func (Action) IntegrationVerbString

func (o Action) IntegrationVerbString() string

func (Action) String

func (o Action) String() string

type BatchConfig added in v0.98.0

type BatchConfig struct {
	// MaxSize is the maximum number of items buffered before the batch is flushed.
	// Required, must be positive.
	MaxSize int32

	// MaxInterval is the maximum time to wait before flushing a partially-filled batch.
	// Optional; when unset, batches only flush on MaxSize.
	MaxInterval *time.Duration

	// GroupKey is a CEL expression evaluated against each item's input to partition items
	// into independent batches (e.g. "input.group"). Optional; when unset, all items
	// buffered for the task share a single batch.
	GroupKey *string

	// GroupMaxRuns limits the number of concurrent batches per group. Optional.
	GroupMaxRuns *int32

	// BroadcastOutput, when true, means the handler returns a single output value that is
	// broadcast as the result to every member of the batch, instead of a map keyed by
	// batch member id.
	BroadcastOutput bool
}

BatchConfig configures batching behavior for a batch task: concurrent task runs are buffered and dispatched together as a single execution once MaxSize is reached, MaxInterval elapses, or (if GroupKey is set) once GroupMaxRuns concurrent batches per group are exceeded.

type Concurrency

type Concurrency struct {
	Expression     string                            `yaml:"expression,omitempty"`
	MaxRuns        *int32                            `yaml:"maxRuns,omitempty"`
	LimitStrategy  *WorkflowConcurrencyLimitStrategy `yaml:"limitStrategy,omitempty"`
	Name           string                            `yaml:"name,omitempty"`
	IsTenantScoped bool                              `yaml:"isTenantScoped,omitempty"`

	// MaxRunsExpression is a CEL expression over task input computing the max runs for
	// that task's concurrency group; a group's effective limit is the value from its most
	// recently created task. Overrides MaxRuns per group.
	MaxRunsExpression *string `yaml:"maxRunsExpression,omitempty"`
}

Concurrency declares one entry in a concurrency chain; entries are processed in the order they are declared. When IsTenantScoped is set, the entry defines (or updates in place) a strategy shared across workflows, keyed by Name: every task declaring the same name consumes the same concurrency limit. Chains sharing tenant-scoped strategies must order them consistently, or registration is rejected.

type DefaultFilter

type DefaultFilter struct {
	Expression string                 `json:"expression"`
	Scope      string                 `json:"scope"`
	Payload    map[string]interface{} `json:"payload,omitempty"`
}

type DesiredWorkerLabel

type DesiredWorkerLabel struct {
	Value      any                    `yaml:"value,omitempty"`
	Required   bool                   `yaml:"required,omitempty"`
	Weight     int32                  `yaml:"weight,omitempty"`
	Comparator *WorkerLabelComparator `yaml:"comparator,omitempty"`
}

type RandomScheduleOpt

type RandomScheduleOpt string
const (
	Random15Min  RandomScheduleOpt = "random_15_min"
	RandomHourly RandomScheduleOpt = "random_hourly"
	RandomDaily  RandomScheduleOpt = "random_daily"
)

type RateLimit

type RateLimit struct {
	Key            string             `yaml:"key,omitempty"`
	KeyExpr        *string            `yaml:"keyExpr,omitempty"`
	Units          *int               `yaml:"units,omitempty"`
	UnitsExpr      *string            `yaml:"unitsExpr,omitempty"`
	LimitValueExpr *string            `yaml:"limitValueExpr,omitempty"`
	Duration       *RateLimitDuration `yaml:"duration,omitempty"`
}

type RateLimitDuration

type RateLimitDuration string
const (
	Second RateLimitDuration = "second"
	Minute RateLimitDuration = "minute"
	Hour   RateLimitDuration = "hour"
	Day    RateLimitDuration = "day"
	Week   RateLimitDuration = "week"
	Month  RateLimitDuration = "month"
	Year   RateLimitDuration = "year"
)

type RateLimitOpts

type RateLimitOpts struct {
	Max      int
	Duration RateLimitDuration
}

type StickyStrategy

type StickyStrategy int32
const (
	StickyStrategy_SOFT StickyStrategy = 0
	StickyStrategy_HARD StickyStrategy = 1
)

func StickyStrategyPtr

func StickyStrategyPtr(v StickyStrategy) *StickyStrategy

type WorkerLabelComparator

type WorkerLabelComparator int32
const (
	WorkerLabelComparator_EQUAL                 WorkerLabelComparator = 0
	WorkerLabelComparator_NOT_EQUAL             WorkerLabelComparator = 1
	WorkerLabelComparator_GREATER_THAN          WorkerLabelComparator = 2
	WorkerLabelComparator_GREATER_THAN_OR_EQUAL WorkerLabelComparator = 3
	WorkerLabelComparator_LESS_THAN             WorkerLabelComparator = 4
	WorkerLabelComparator_LESS_THAN_OR_EQUAL    WorkerLabelComparator = 5
)

type Workflow deprecated

type Workflow struct {
	Name string `yaml:"name,omitempty"`

	ScheduleTimeout string `yaml:"scheduleTimeout,omitempty"`

	Concurrency *WorkflowConcurrency `yaml:"concurrency,omitempty"`

	Version string `yaml:"version,omitempty"`

	Description string `yaml:"description,omitempty"`

	Triggers WorkflowTriggers `yaml:"triggers"`

	Jobs map[string]WorkflowJob `yaml:"jobs"`

	OnFailureJob *WorkflowJob `yaml:"onFailureJob,omitempty"`

	StickyStrategy *StickyStrategy `yaml:"sticky,omitempty"`
}

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

func DefaultLoader

func DefaultLoader() []*Workflow

func ParseYAML deprecated

func ParseYAML(ctx context.Context, yamlBytes []byte) (Workflow, error)

Deprecated: ParseYAML 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 ReadAllValidFilesInDir

func ReadAllValidFilesInDir(filedir string) ([]*Workflow, error)

func ReadHatchetYAMLFileBytes

func ReadHatchetYAMLFileBytes(filepath string) (*Workflow, error)

ReadHatchetYAMLFileBytes reads a given YAML file from a filepath and return the parsed workflow file

type WorkflowConcurrency

type WorkflowConcurrency struct {
	Expression *string `yaml:"expression,omitempty"`

	MaxRuns int32 `yaml:"maxRuns,omitempty"`

	LimitStrategy WorkflowConcurrencyLimitStrategy `yaml:"limitStrategy,omitempty"`

	ActionID *string `yaml:"action,omitempty"`
}

type WorkflowConcurrencyLimitStrategy

type WorkflowConcurrencyLimitStrategy string
const (
	CancelInProgress         WorkflowConcurrencyLimitStrategy = "CANCEL_IN_PROGRESS"
	CancelNewest             WorkflowConcurrencyLimitStrategy = "CANCEL_NEWEST"
	GroupRoundRobin          WorkflowConcurrencyLimitStrategy = "GROUP_ROUND_ROBIN"
	DropNewest               WorkflowConcurrencyLimitStrategy = "DROP_NEWEST"
	QueueNewest              WorkflowConcurrencyLimitStrategy = "QUEUE_NEWEST"
	CancelQueuedExceptNewest WorkflowConcurrencyLimitStrategy = "CANCEL_QUEUED_EXCEPT_NEWEST"
	CancelQueuedExceptOldest WorkflowConcurrencyLimitStrategy = "CANCEL_QUEUED_EXCEPT_OLDEST"
)

type WorkflowEvent

type WorkflowEvent struct {
	Name string `yaml:"name,omitempty"`
}

type WorkflowJob deprecated

type WorkflowJob struct {
	Description string `yaml:"description,omitempty"`

	Steps []WorkflowStep `yaml:"steps"`
}

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

type WorkflowOnCron

type WorkflowOnCron struct {
	Schedule string `yaml:"schedule,omitempty"`
}

type WorkflowStep deprecated

type WorkflowStep struct {
	Name     string `yaml:"name,omitempty"`
	ID       string `yaml:"id,omitempty"`
	ActionID string `yaml:"action"`
	Timeout  string `yaml:"timeout,omitempty"`

	// Deprecated: this field has no effect and will be removed in a future release.
	With map[string]interface{} `yaml:"with,omitempty"`

	UserData               map[string]interface{}         `yaml:"userData,omitempty"`
	Parents                []string                       `yaml:"parents,omitempty"`
	Retries                int                            `yaml:"retries"`
	RateLimits             []RateLimit                    `yaml:"rateLimits,omitempty"`
	DesiredLabels          map[string]*DesiredWorkerLabel `yaml:"desiredLabels,omitempty"`
	RetryBackoffFactor     *float32                       `yaml:"retryBackoffFactor,omitempty"`
	RetryMaxBackoffSeconds *int32                         `yaml:"retryMaxBackoffSeconds,omitempty"`
}

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

type WorkflowTriggers deprecated

type WorkflowTriggers struct {
	Events    []string    `yaml:"events,omitempty"`
	Cron      []string    `yaml:"crons,omitempty"`
	Schedules []time.Time `yaml:"schedules,omitempty"`
}

Deprecated: WorkflowTriggers 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

Jump to

Keyboard shortcuts

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