Versions in this module Expand all Collapse all v0 v0.1.1 Nov 10, 2026 Changes in this version + const LabelSource + const LabelSourceRef + const MaxOutcomeNote + const MaxSourceLen + const MaxSourceRefLen + const MaxStepEventAttrs + const MaxStepEventMessage + const MaxStepEventValue + func HasStepEventSink(ctx context.Context) bool + func RecordEvent(ctx context.Context, msg string, attrs ...slog.Attr) + func RecordEventLevel(ctx context.Context, level slog.Level, msg string, attrs ...slog.Attr) + func SetOutcome(ctx context.Context, o Outcome, note string) error + func ValidateSource(s Source) error + func WithOutcomeSetter(ctx context.Context, s OutcomeSetter) context.Context + func WithStepEventSink(ctx context.Context, s StepEventSink) context.Context + type EventAttr struct + Key string + Value string type Job + func WithSource(job Job, source Source, ref string) Job + type Outcome string + const OutcomeError + const OutcomePartial + const OutcomeSkipped + const OutcomeSuccess + func DefaultOutcome(status Status) Outcome + func Outcomes() []Outcome + func (o Outcome) Valid() bool + type OutcomeFunc func(ctx context.Context, o Outcome, note string) error + func (f OutcomeFunc) SetOutcome(ctx context.Context, o Outcome, note string) error + type OutcomeSetter interface + SetOutcome func(ctx context.Context, o Outcome, note string) error + type Source string + const SourceBatch + const SourceChild + const SourceEvent + const SourceExternal + const SourceSchedule + const SourceScheduleManual + func LibrarySources() []Source + func SourceOf(labels map[string]string) (source Source, ref string) + type StepEvent struct + At time.Time + Attrs []EventAttr + Level slog.Level + Message string + Step StepInfo + type StepEventFunc func(ctx context.Context, e StepEvent) + func (f StepEventFunc) RecordStepEvent(ctx context.Context, e StepEvent) + type StepEventSink interface + RecordStepEvent func(ctx context.Context, e StepEvent) v0.1.0 Nov 10, 2026 Changes in this version + const ChoiceDecideSuffix + const ClosureStep + const ClosureWorkflow + const DefaultAwaitPoll + const DefaultBalanceEvery + const DefaultChildPoll + const DefaultErrorHistory + const DefaultQueue + const DefaultRecycleCheck + const DefaultRetryMax + const DefaultRunsLimit + const FuncStep + const LabelClosure + const LabelParentRun + const LabelParentStep + const LabelPayloadVersion + const LabelPrefixBatch + const LabelPrefixInternal + const LabelPrefixOTel + const LabelSchedule + const LabelScheduleName + const LabelTickAt + const LabelTrigger + const LabelTriggerManual + const MaxChainJobs + const MaxErrorStack + const MaxNextRuns + const MaxProgressData + const MaxRunsLimit + const MaxSnooze + const MisfireGrace + const ScheduleJSONVersion + const TickReasonOverlap + const TickReasonPaused + const TickReasonWhen + const TickReasonWindow + var ErrAlreadyStarted = errors.New("workflow: client already started") + var ErrCancelled = errors.New("workflow: run cancelled") + var ErrDeferredClosed = errors.New("workflow: deferred enqueues already flushed or discarded") + var ErrDiscarded = errors.New("workflow: run discarded") + var ErrDuplicate = errors.New("workflow: duplicate idempotency key") + var ErrDuplicatePlugin = errors.New("workflow: duplicate plugin name") + var ErrForced = errors.New("workflow: run ended by an operator") + var ErrHeartbeatTimeout = errors.New("workflow: heartbeat timed out") + var ErrInvalid = errors.New("workflow: invalid spec") + var ErrLocalCronStarted = errors.New("workflow: local cron already started") + var ErrLoopLimit = errors.New("workflow: loop reached its iteration limit") + var ErrNoJournal = errors.New("workflow: no journal on this context (use the Journal plugin)") + var ErrNoSecretRef = errors.New("workflow: secret reference has no name") + var ErrNotFound = errors.New("workflow: not found") + var ErrNotStarted = errors.New("workflow: client not started") + var ErrOverlap = errors.New("workflow: the schedule's previous run is unfinished") + var ErrPayloadTooLarge = errors.New("workflow: payload too large") + var ErrRecycle = errors.New("workflow: worker recycled") + var ErrRunTimeout = errors.New("workflow: run timed out") + var ErrScheduleJSON = errors.New("workflow: invalid schedule JSON") + var ErrSecretInPayload = fmt.Errorf("%w: job carries a secret; pass a SecretRef instead", ErrInvalid) + var ErrSnoozed = errors.New("workflow: step snoozed") + var ErrStepCancelled = errors.New("workflow: step cancelled") + var ErrStepTimeout = errors.New("workflow: step attempt timed out") + var ErrThrottled = errors.New("workflow: upstream rate limit reached") + var ErrTimeout = errors.New("workflow: deadline missed") + var ErrUnavailable = errors.New("workflow: backend unavailable") + var ErrUnsupported = errors.New("workflow: unsupported by this driver") + var ErrWaitTimeout = errors.New("workflow: wait expired") + var ErrWrongState = errors.New("workflow: run is in the wrong state for this call") + func AllWhen(conds ...func(context.Context, Tick) bool) func(context.Context, Tick) bool + func AllowReservedLabels(ctx context.Context, keys ...string) context.Context + func AllowReservedPrefix(ctx context.Context, prefix string) context.Context + func AppendToChain(ctx context.Context, jobs ...Job) error + func AttachScheduleHooks(c Client, hooks ...ScheduleHooks) error + func AwaitChild(ctx context.Context, client Client, name string, job Job, opts ChildOptions) ([]byte, error) + func AwaitChildren(ctx context.Context, client Client, name string, jobs []Job, opts ChildOptions) ([][]byte, error) + func AwaitResult(ctx context.Context, c Client, ref RunRef, opts AwaitOptions) ([]byte, error) + func CanForceComplete(st Status) bool + func CanForceFail(st Status) bool + func CheckCaps(have Caps, wf Workflow) error + func CheckJob(have Caps, job Job) error + func CheckJobLabels(ctx context.Context, job Job) error + func CheckJobQueue(have Caps, wf Workflow, job Job) error + func CheckPause(have Caps, t PauseTarget) error + func CheckPayload(job Job, limit int, source string) error + func CheckQueueLimits(have Caps, qs []QueueConfig) error + func CheckRunQuery(have Caps, q RunQuery) error + func CheckScheduleCaps(have Caps, s Schedule) error + func DecodePayload[T any](raw []byte) (T, error) + func DefaultNodeID() string + func DeferHTTP(next http.Handler, opts DeferOptions) http.Handler + func DeferSucceeded(status int) bool + func Discard(err error) error + func DiscardedError(step string, err error) error + func DrainContext(ctx context.Context, grace time.Duration) (context.Context, context.CancelFunc) + func DrainOutcome(report DrainReport, ctxErr error) error + func DrainTimeout(ctx context.Context, d Drainer, grace time.Duration) error + func EffectiveQueue(wf Workflow, job Job) string + func FiredLabels(labels map[string]string, id ScheduleID, name string) map[string]string + func FiredLabelsAt(labels map[string]string, id ScheduleID, name string, at time.Time) map[string]string + func ForcedFailure(reason string) error + func HeapObjectBytes() uint64 + func Heartbeat(ctx context.Context, details []byte) error + func InEnvironment(current string, allowed ...string) func(context.Context, Tick) bool + func IsDiscarded(err error) bool + func IsPermanent(err error) bool + func IsRelease(err error) bool + func IsTimeout(err error) bool + func IsUTC(loc *time.Location) bool + func IsUnavailable(err error) bool + func LastTick(src TickSource, from, to time.Time, loc *time.Location) time.Time + func Loop[S any](ctx context.Context, name string, init S, limit int, ...) (S, error) + func MapEach[In, Out any](ctx context.Context, name string, items []In, ...) ([]Out, error) + func MarkDuplicate(ctx context.Context) + func MarkInserted(ctx context.Context) + func Memo[T any](ctx context.Context, name string, fn func(ctx context.Context) (T, error)) (T, error) + func NextActive(s cron.Schedule, after time.Time, loc *time.Location, a Active) time.Time + func OverlapRefusal(id ScheduleID, prev RunRef, st Status) error + func ParseCron(expr string, seconds bool, custom cron.Parser) (cron.Schedule, error) + func PayloadVersionOf(labels map[string]string) (int, error) + func PeriodKey(t time.Time, p Period, loc *time.Location) (string, error) + func Permanent(err error) error + func PickWeighted(weights []int, r float64) int + func PrependToChain(ctx context.Context, jobs ...Job) error + func ProcessChunks(ctx context.Context, name string, opts ChunkOptions, ...) (int64, error) + func RegisterFunc(client Client, f FuncDefinition) error + func ReportProgress(ctx context.Context, p Progress) error + func ReservedLabel(key string) (prefix string, ok bool) + func ReservedLabelPrefixes() []string + func ResolveSecret(ctx context.Context, r SecretResolver, ref SecretRef) ([]byte, error) + func RetryAfter(err error, d time.Duration) error + func RetryAfterDelay(err error, _ int) (time.Duration, bool) + func RunData[T any](ctx context.Context, name string) (T, bool, error) + func RunOutput(wf Workflow, outs map[string][]byte) []byte + func Serve(ctx context.Context, client Client) error + func SetRunData(ctx context.Context, name string, v any) error + func ShutdownHook(d Drainer, grace time.Duration) func(context.Context) error + func ShutdownHookReport(d Drainer, grace time.Duration, ...) func(context.Context) error + func Sinks(wf Workflow) []string + func Snooze(d time.Duration) error + func SnoozeDelay(err error) (time.Duration, bool) + func StackOf(err error) string + func StepInput(payload []byte, parents []string, outs map[string][]byte) []byte + func Supports(c Client, op Op) bool + func TickTime(labels map[string]string) (time.Time, bool) + func TimeoutError(kind error, detail string) error + func TriggeredLabels(labels map[string]string, id ScheduleID, name string) map[string]string + func TriggeredLabelsAt(labels map[string]string, id ScheduleID, name string, at time.Time) map[string]string + func Unavailable(err error) error + func Unsupported(field, reason string) error + func Upcast(raw []byte, from, to int, ups map[int]Upcaster) ([]byte, error) + func Validate(wf Workflow) error + func ValidateCancelQuery(q RunQuery) error + func ValidateClosure(c ClosureJob) error + func ValidateJob(job Job) error + func ValidateLabels(labels map[string]string) error + func ValidatePauseTarget(t PauseTarget) error + func ValidateProgress(p Progress) error + func ValidateQueueName(name string) error + func ValidateQueues(qs []QueueConfig) error + func ValidateRecycle(r Recycle) error + func ValidateRunQuery(q RunQuery) error + func ValidateSchedule(s Schedule) error + func ValidateScheduleTarget(t ScheduleTarget) error + func ValidateTenant(tenant string) error + func WithChainEditor(ctx context.Context, ed ChainEditor) context.Context + func WithDeferred(ctx context.Context, d *Deferred) context.Context + func WithHeartbeater(ctx context.Context, h Heartbeater) context.Context + func WithProgressReporter(ctx context.Context, r ProgressReporter) context.Context + func WithStepInfo(ctx context.Context, info StepInfo) context.Context + type Active struct + From time.Time + Until time.Time + func (a Active) Contains(t time.Time) bool + func (a Active) Ended(after time.Time) bool + func (a Active) IsZero() bool + type AttemptError struct + At time.Time + Attempt int + Error string + Node string + Stack string + Step string + func AppendAttemptError(hist []AttemptError, e AttemptError, max int) []AttemptError + func NewAttemptError(step string, attempt int, err error, at time.Time) AttemptError + type Attempts struct + Errors int + First time.Time + N int + func (a Attempts) Count(err error) Attempts + type AwaitOptions struct + Poll time.Duration + Sleep func(ctx context.Context, d time.Duration) error + type Backoff struct + Factor float64 + Initial time.Duration + Jitter float64 + Max time.Duration + func (b Backoff) Delay(n int) time.Duration + func (b Backoff) JitteredDelay(n int, u float64) time.Duration + type BalanceConfig struct + Bounds map[string]QueueBounds + Default QueueBounds + MaxShift int + Total int + type BalanceLoop struct + Balancer Balancer + Clock clock.Clock + Every time.Duration + Logger *slog.Logger + OnError func(error) + Scaler WorkerScaler + func (l BalanceLoop) Once(ctx context.Context) error + func (l BalanceLoop) Run(ctx context.Context) error + type Balancer interface + Balance func(loads []QueueLoad) map[string]int + func ByDepth(cfg BalanceConfig) Balancer + func ByWait(cfg BalanceConfig) Balancer + func Proportional(cfg BalanceConfig, weight func(QueueLoad) float64) Balancer + type BalancerFunc func(loads []QueueLoad) map[string]int + func (f BalancerFunc) Balance(loads []QueueLoad) map[string]int + type Branch struct + Name string + Retry *RetryPolicy + Run Handler + Timeout time.Duration + type BucketSpec struct + Capacity float64 + LeakPerSecond float64 + type BucketStore interface + Observe func(ctx context.Context, key string, spec BucketSpec, level float64, now time.Time) error + Take func(ctx context.Context, key string, spec BucketSpec, cost float64, now time.Time) (wait time.Duration, err error) + type BulkCanceller interface + CancelAll func(ctx context.Context, q RunQuery) (int, error) + type Caps uint64 + const CapCancel + const CapCancelAll + const CapChain + const CapClosure + const CapConcurrencyKey + const CapCron + const CapCronSeconds + const CapCronZone + const CapDelayedStart + const CapDeleteRun + const CapDiscard + const CapDiscardExhausted + const CapDrain + const CapDrainReport + const CapDueQuery + const CapDurable + const CapDurableSleep + const CapEnqueueOnly + const CapErrorHistory + const CapForceRun + const CapHeartbeat + const CapIdempotencyKey + const CapJobRetry + const CapKeyFIFO + const CapLabelPrefix + const CapMisfireFireAll + const CapMisfireFireOnce + const CapMisfireSkip + const CapNodeIdentity + const CapOverlapSkip + const CapPauseQueue + const CapPauseWorkflow + const CapQueue + const CapQueueLimitGlobal + const CapQueueOverride + const CapRateLimit + const CapResult + const CapRetryDelay + const CapRetryJitter + const CapRetryMaxErrors + const CapRetryRun + const CapRetryUntil + const CapRunFinished + const CapRunQuery + const CapRunStates + const CapRunTimeout + const CapScheduleActive + const CapScheduleHistory + const CapScheduleKeep + const CapScheduleList + const CapSchedulePause + const CapScheduleTrigger + const CapScheduleWhen + const CapScheduleWindow + const CapShutdownRequeue + const CapSnooze + const CapTenant + const CapTickEvents + const CapTickTime + const CapWaitForEvent + const CapWorkerScale + func Requires(wf Workflow) Caps + func RequiresJob(job Job) Caps + func RequiresPause(t PauseTarget) Caps + func RequiresSchedule(s Schedule) Caps + func (c Caps) Has(want Caps) bool + func (c Caps) Missing(required Caps) Caps + func (c Caps) String() string + type ChainEditor interface + Append func(jobs ...Job) error + Prepend func(jobs ...Job) error + func ChainEditorFrom(ctx context.Context) (ChainEditor, bool) + type ChainEdits struct + func NewChainEdits(have Caps, chain []Job) *ChainEdits + func (e *ChainEdits) Append(jobs ...Job) error + func (e *ChainEdits) Apply(chain []Job) []Job + func (e *ChainEdits) Changed() bool + func (e *ChainEdits) Prepend(jobs ...Job) error + type ChildOptions struct + Parent Client + Poll time.Duration + Spawn []SpawnOption + type ChoiceSpec struct + After []string + Branches []Branch + Decide func(ctx context.Context, in []byte) (string, error) + Name string + type ChunkOptions struct + MaxChunks int + Size int64 + Total int64 + type ChunkProgress struct + Done int64 + Total int64 + type Client interface + Cancel func(ctx context.Context, ref RunRef) error + Capabilities func() Caps + Enqueue func(ctx context.Context, job Job) (RunRef, error) + Register func(wf Workflow) error + Schedule func(ctx context.Context, s Schedule) (ScheduleID, error) + Signal func(ctx context.Context, ev Event) error + Start func(ctx context.Context) error + Status func(ctx context.Context, ref RunRef) (Status, error) + Unschedule func(ctx context.Context, id ScheduleID) error + func Use(c Client, plugins ...Plugin) (Client, error) + type ClosureEnqueuer interface + EnqueueClosure func(ctx context.Context, c ClosureJob) (RunRef, error) + type ClosureJob struct + Fn func(ctx context.Context) error + Labels map[string]string + Name string + Priority int + Queue string + Retry *RetryPolicy + RunAt time.Time + Timeout time.Duration + type Concurrency struct + FIFO bool + Key ConcurrencyKey + MaxRuns int + Strategy ConcurrencyStrategy + type ConcurrencyKey struct + Expr string + Func func(Job) string + func KeyExpr(expr string) ConcurrencyKey + func KeyFunc(f func(Job) string) ConcurrencyKey + func (k ConcurrencyKey) IsZero() bool + type ConcurrencyStrategy string + const ConcurrencyCancelInProgress + const ConcurrencyCancelNewest + const ConcurrencyDropNewest + const ConcurrencyQueueNewest + const ConcurrencyRoundRobin + type DeferOptions struct + Logger *slog.Logger + OnError func(r *http.Request, err error) + Succeeded func(status int) bool + type Deferred struct + func DeferredFrom(ctx context.Context) (*Deferred, bool) + func NewDeferred() *Deferred + func (d *Deferred) Add(enqueue EnqueueFunc, job Job) error + func (d *Deferred) Discard() int + func (d *Deferred) Flush(ctx context.Context) ([]RunRef, error) + func (d *Deferred) Len() int + type DrainCut struct + Attempt int + Disposition DrainDisposition + RunID RunID + Step string + Workflow string + type DrainDisposition string + const DrainCancelled + const DrainEngineOwned + const DrainRequeued + type DrainReport struct + Cut []DrainCut + FinishedRuns int + FinishedSteps int + func DrainTimeoutReport(ctx context.Context, d Drainer, grace time.Duration) (report DrainReport, detailed bool, err error) + func (r DrainReport) Clean() bool + func (r DrainReport) CutRuns() int + type DrainTracker struct + func (t *DrainTracker) Begin(a DrainCut) (end func()) + func (t *DrainTracker) Freeze(disposition DrainDisposition) DrainReport + func (t *DrainTracker) RunFinished(id RunID) + func (t *DrainTracker) Seal() DrainReport + func (t *DrainTracker) StartDrain() + type Drainer interface + Done func() <-chan struct{} + Drain func(ctx context.Context) error + type EnqueueFunc func(ctx context.Context, job Job) (RunRef, error) + type EnqueueMiddleware func(next EnqueueFunc) EnqueueFunc + func DeferEnqueue() EnqueueMiddleware + func SecretGuard(d SecretDetector) EnqueueMiddleware + type EnqueueMiddlewareProvider interface + EnqueueMiddleware func() []EnqueueMiddleware + type EnqueueOutcome struct + Duplicate bool + Reported bool + func WithEnqueueOutcome(ctx context.Context) (context.Context, *EnqueueOutcome) + type Event struct + Key string + Name string + Payload []byte + type Failure struct + At time.Time + Attempt int + Err error + Final bool + Labels map[string]string + Ref RunRef + Status Status + Step string + Workflow string + func FailureOf(ev RunEvent, discarded bool, at time.Time) (Failure, bool) + type Forward struct + Inner Client + func (f Forward) CancelAll(ctx context.Context, q RunQuery) (int, error) + func (f Forward) CancelStep(ctx context.Context, ref RunRef, step string) error + func (f Forward) Delete(ctx context.Context, ref RunRef) error + func (f Forward) Done() <-chan struct{} + func (f Forward) Drain(ctx context.Context) error + func (f Forward) DrainWithReport(ctx context.Context) (DrainReport, error) + func (f Forward) EnqueueClosure(ctx context.Context, c ClosureJob) (RunRef, error) + func (f Forward) ForceComplete(ctx context.Context, ref RunRef) error + func (f Forward) ForceFail(ctx context.Context, ref RunRef, reason string) error + func (f Forward) Health(ctx context.Context) HealthReport + func (f Forward) Nodes(ctx context.Context) ([]NodeInfo, error) + func (f Forward) OnLifecycle(fn LifecycleFunc) error + func (f Forward) OnTick(fn TickObserver) error + func (f Forward) Pause(ctx context.Context, t PauseTarget) error + func (f Forward) PauseSchedule(ctx context.Context, t ScheduleTarget) error + func (f Forward) Paused(ctx context.Context) ([]PauseTarget, error) + func (f Forward) PayloadLimit() int + func (f Forward) QueueLoads(ctx context.Context) ([]QueueLoad, error) + func (f Forward) Reschedule(ctx context.Context, ref RunRef, at time.Time) (RunRef, error) + func (f Forward) Result(ctx context.Context, ref RunRef) ([]byte, error) + func (f Forward) Resume(ctx context.Context, t PauseTarget) error + func (f Forward) ResumeSchedule(ctx context.Context, t ScheduleTarget) error + func (f Forward) Retry(ctx context.Context, ref RunRef) (RunRef, error) + func (f Forward) Runs(ctx context.Context, q RunQuery) (RunPage, error) + func (f Forward) Schedules(ctx context.Context) ([]ScheduleInfo, error) + func (f Forward) SetWorkers(ctx context.Context, queue string, n int) error + func (f Forward) StopCause() error + func (f Forward) Supports(op Op) bool + func (f Forward) TriggerSchedule(ctx context.Context, id ScheduleID) (RunRef, error) + type Func struct + func NewFunc[In any](name string, fn func(ctx context.Context, in In) error, opts ...FuncOption) Func[In] + func (f Func[In]) Enqueue(ctx context.Context, client Client, in In) (RunRef, error) + func (f Func[In]) Job(in In) (Job, error) + func (f Func[In]) Name() string + func (f Func[In]) Workflow() Workflow + type FuncConfig struct + Catch func(ctx context.Context, in []byte) error + Queue string + Retry *RetryPolicy + Timeout time.Duration + type FuncDefinition interface + Name func() string + Workflow func() Workflow + type FuncOption func(*FuncConfig) + func FuncCatch[In any](fn func(ctx context.Context, in In) error) FuncOption + func FuncQueue(q string) FuncOption + func FuncRetry(p *RetryPolicy) FuncOption + func FuncTimeout(d time.Duration) FuncOption + type Handler func(ctx context.Context, in []byte) (out []byte, err error) + func DefineVersioned[In, Out any](current int, ups map[int]Upcaster, ...) Handler + func Define[In, Out any](fn func(ctx context.Context, in In) (Out, error)) Handler + func FailureHandler(wf Workflow, err error) Handler + type HealthCheck struct + Detail string + Name string + OK bool + type HealthChecker interface + Health func(ctx context.Context) HealthReport + type HealthReport struct + Checks []HealthCheck + Live bool + Ready bool + func CheckHealth(ctx context.Context, c Client) HealthReport + type HeartbeatFunc func(ctx context.Context, details []byte) error + func (f HeartbeatFunc) Heartbeat(ctx context.Context, details []byte) error + type Heartbeater interface + Heartbeat func(ctx context.Context, details []byte) error + type IdempotencyPolicy string + const IdempotencyOff + const IdempotencyOptional + const IdempotencyRequired + type InlineOption func(*inlineConfig) + func InlineEvents(events ...Event) InlineOption + func InlineMiddleware(mw ...Middleware) InlineOption + func InlineNow(now func() time.Time) InlineOption + func InlineSleep(sleep func(ctx context.Context, d time.Duration) error) InlineOption + type InlineResult struct + Attempts map[string]int + Outputs map[string][]byte + func RunInline(ctx context.Context, wf Workflow, job Job, opts ...InlineOption) (InlineResult, error) + type Job struct + Chain []Job + IdempotencyKey string + Labels map[string]string + Payload []byte + Priority int + Queue string + Retry *RetryPolicy + RunAt time.Time + Tenant string + Workflow string + func CloneJob(j Job) Job + func FuncJob(name string, arg any) (Job, error) + func JobOf[T any](workflow string, v T) (Job, error) + func NextInChain(chain []Job) (Job, bool) + func OncePerPeriod(job Job, scope string, p Period, t time.Time, loc *time.Location) (Job, error) + type JournalOption func(*journalPlugin) + func JournalKeepFailed() JournalOption + type JournalStore interface + Forget func(ctx context.Context, run RunID) error + Load func(ctx context.Context, run RunID, key string) (val []byte, ok bool, err error) + Save func(ctx context.Context, run RunID, key string, val []byte) error + type LifecycleEvent struct + At time.Time + Attempt int + Err error + Kind LifecycleKind + Labels map[string]string + Node string + Progress *Progress + Queue string + Ref RunRef + Status Status + Step string + Tenant string + Workflow string + type LifecycleFunc func(ctx context.Context, ev LifecycleEvent) + type LifecycleKind string + const LifecycleFinished + const LifecycleInserted + const LifecycleProgress + const LifecycleRetrying + const LifecycleSnoozed + const LifecycleStarted + type LifecycleNotifier interface + OnLifecycle func(fn LifecycleFunc) error + type LocalCron struct + func NewLocalCron(opts ...LocalCronOption) *LocalCron + func (l *LocalCron) Add(name, expr string, loc *time.Location, fn LocalCronFunc) error + func (l *LocalCron) Done() <-chan struct{} + func (l *LocalCron) Start(ctx context.Context) error + type LocalCronFunc func(ctx context.Context, at time.Time) error + type LocalCronOption func(*LocalCron) + func WithLocalCronClock(c clock.Clock) LocalCronOption + func WithLocalCronErrors(f func(name string, at time.Time, err error)) LocalCronOption + func WithLocalCronParser(p cron.Parser) LocalCronOption + type MapOption func(*mapConfig) + func MapConcurrency(n int) MapOption + type MemoryBuckets struct + func (m *MemoryBuckets) Observe(_ context.Context, key string, spec BucketSpec, level float64, now time.Time) error + func (m *MemoryBuckets) Take(_ context.Context, key string, spec BucketSpec, cost float64, now time.Time) (time.Duration, error) + type MemoryJournal struct + func NewMemoryJournal() *MemoryJournal + func (m *MemoryJournal) Forget(_ context.Context, run RunID) error + func (m *MemoryJournal) Load(_ context.Context, run RunID, key string) ([]byte, bool, error) + func (m *MemoryJournal) Runs() []RunID + func (m *MemoryJournal) Save(_ context.Context, run RunID, key string, val []byte) error + type Middleware func(next Handler) Handler + func WithJournal(store JournalStore) Middleware + type Misfire struct + Max int + Policy MisfirePolicy + Within time.Duration + func (m Misfire) Due(src TickSource, last, now time.Time, loc *time.Location) []time.Time + func (m Misfire) IsZero() bool + func (m Misfire) Plan(src TickSource, last, now time.Time, loc *time.Location) (fire []time.Time, dropped int) + type MisfirePolicy string + const MisfireFireAll + const MisfireFireOnce + const MisfireSkip + type NextRun struct + Local time.Time + UTC time.Time + func NextRuns(q NextRunsQuery) []NextRun + func (r NextRun) String() string + type NextRunsQuery struct + Active Active + After time.Time + Count int + Location *time.Location + Schedule cron.Schedule + Windows Windows + type NodeInfo struct + ID string + LastSeen time.Time + Mode NodeMode + Queues []string + Running int + StartedAt time.Time + Workers int + type NodeLister interface + Nodes func(ctx context.Context) ([]NodeInfo, error) + type NodeMode string + const NodeEnqueueOnly + const NodeFull + const NodeScheduler + const NodeWorker + type Op string + const OpCancelStep + const OpLifecycle + const OpNodes + const OpReschedule + type OpProber interface + Supports func(op Op) bool + type OverlapPolicy string + const OverlapAllow + const OverlapSkip + func (p OverlapPolicy) Blocks(prev Status) bool + type PauseTarget struct + All bool + Queue string + Workflow string + func PauseAll() PauseTarget + func PauseQueue(name string) PauseTarget + func PauseWorkflow(name string) PauseTarget + func (t PauseTarget) Holds(wf, q string) bool + type Pauser interface + Pause func(ctx context.Context, t PauseTarget) error + Paused func(ctx context.Context) ([]PauseTarget, error) + Resume func(ctx context.Context, t PauseTarget) error + type PayloadLimiter interface + PayloadLimit func() int + type PayloadTooLargeError struct + Limit int + Size int + Source string + Workflow string + func (e *PayloadTooLargeError) Error() string + func (e *PayloadTooLargeError) Is(target error) bool + type Period string + const PeriodDay + const PeriodMonth + const PeriodQuarter + const PeriodWeek + const PeriodYear + type Plugin interface + Name func() string + func Journal(store JournalStore, opts ...JournalOption) Plugin + type Progress struct + At time.Time + Data []byte + Message string + Percent float64 + Step string + func (p Progress) Clone() Progress + type ProgressFunc func(ctx context.Context, p Progress) error + func (f ProgressFunc) ReportProgress(ctx context.Context, p Progress) error + type ProgressReporter interface + ReportProgress func(ctx context.Context, p Progress) error + type QueueBounds struct + Max int + Min int + type QueueConfig struct + Limit int + Name string + Priority int + Weight int + Workers int + type QueueLoad struct + Depth int + OldestWait time.Duration + Queue string + Running int + Workers int + type RateLimit struct + Key ConcurrencyKey + Limit int + Per time.Duration + type Recycle struct + CheckEvery time.Duration + MaxJobs int + MaxMemory uint64 + MaxTime time.Duration + Memory func() uint64 + func (r Recycle) Enabled() bool + type RecycleError struct + Elapsed time.Duration + Jobs int + Memory uint64 + Reason RecycleReason + func (e *RecycleError) Error() string + func (e *RecycleError) Is(target error) bool + type RecycleReason string + const RecycleMaxJobs + const RecycleMaxMemory + const RecycleMaxTime + type RecycleWatch struct + func NewRecycleWatch(r Recycle, started time.Time) *RecycleWatch + func (w *RecycleWatch) Check(now time.Time) *RecycleError + func (w *RecycleWatch) CheckEvery() time.Duration + func (w *RecycleWatch) Deadline() (time.Time, bool) + func (w *RecycleWatch) JobDone(now time.Time) *RecycleError + type Reporter interface + Report func(ctx context.Context, f Failure) + type ReporterFunc func(ctx context.Context, f Failure) + func (fn ReporterFunc) Report(ctx context.Context, f Failure) + type ReportingDrainer interface + DrainWithReport func(ctx context.Context) (DrainReport, error) + type ResultReader interface + Result func(ctx context.Context, ref RunRef) ([]byte, error) + type RetryPolicy struct + Backoff Backoff + DelayFor func(err error, retry int) (time.Duration, bool) + DiscardOnExhaust bool + Max int + MaxErrors int + NoRetryOn func(error) bool + Until time.Duration + func EffectiveRetries(step Step, wf Workflow) RetryPolicy + func EffectiveRetriesFor(step Step, wf Workflow, job Job) RetryPolicy + func RetriesNone() *RetryPolicy + func (p RetryPolicy) ExhaustedError(attempts int, err error) error + func (p RetryPolicy) Next(err error, a Attempts, now time.Time, rnd func() float64) (delay time.Duration, retry bool) + func (p RetryPolicy) NextDelay(err error, retry int, rnd func() float64) time.Duration + func (p RetryPolicy) Retryable(err error, attempts int) bool + type RunDeleter interface + Delete func(ctx context.Context, ref RunRef) error + type RunError struct + Attempt int + Err error + RunID RunID + Step string + Workflow string + func RunErrorOf(err error) (*RunError, bool) + func (e *RunError) Describe() string + func (e *RunError) Error() string + func (e *RunError) Unwrap() error + type RunEvent struct + Err error + FinishedAt time.Time + Labels map[string]string + Ref RunRef + Status Status + Step string + Tenant string + Workflow string + type RunFailedError struct + Err string + Ref RunRef + Status Status + func (e *RunFailedError) Error() string + func (e *RunFailedError) Is(target error) bool + type RunFinishedFunc func(ctx context.Context, ev RunEvent) + type RunFinishedProvider interface + RunFinishedObservers func() []RunFinishedFunc + type RunForcer interface + ForceComplete func(ctx context.Context, ref RunRef) error + ForceFail func(ctx context.Context, ref RunRef, reason string) error + type RunID string + const InlineRunID + func (id RunID) IsZero() bool + func (id RunID) String() string + type RunInfo struct + AttemptedBy []string + Attempts int + EnqueuedAt time.Time + Error string + Errors []AttemptError + FailedStep string + FinishedAt time.Time + Labels map[string]string + NextAttempt int + NextAttemptAt time.Time + Output []byte + Payload []byte + Priority int + Progress *Progress + Queue string + Ref RunRef + RunAt time.Time + StartedAt time.Time + Status Status + Tenant string + Workflow string + func (info RunInfo) Clone() RunInfo + type RunNotifier interface + OnRunFinished func(fn RunFinishedFunc) error + type RunPage struct + Next string + Runs []RunInfo + type RunQuerier interface + Runs func(ctx context.Context, q RunQuery) (RunPage, error) + type RunQuery struct + Cursor string + DueFrom time.Time + DueTo time.Time + From time.Time + LabelPrefixes map[string]string + Labels map[string]string + Limit int + Queue string + Ref RunRef + Statuses []Status + Tenant string + To time.Time + Workflow string + func (q RunQuery) Match(info RunInfo) bool + func (q RunQuery) PageLimit() int + type RunRef struct + RunID RunID + ScheduledID ScheduledID + func EnqueueClosure(ctx context.Context, client Client, c ClosureJob) (RunRef, error) + func Spawn(ctx context.Context, client Client, name string, jobs []Job, ...) ([]RunRef, error) + func (r RunRef) IsZero() bool + type RunRescheduler interface + Reschedule func(ctx context.Context, ref RunRef, at time.Time) (RunRef, error) + type RunRetrier interface + Retry func(ctx context.Context, ref RunRef) (RunRef, error) + type Schedule struct + Active Active + Cron string + Input []byte + KeepRuns int + Labels map[string]string + Location *time.Location + Misfire Misfire + Name string + Overlap OverlapPolicy + Seconds bool + Tenant string + Windows Windows + Workflow string + func UnmarshalSchedule(data []byte, loadZone func(name string) (*time.Location, error)) (Schedule, error) + func (s *Schedule) UnmarshalJSON(data []byte) error + func (s Schedule) MarshalJSON() ([]byte, error) + type ScheduleHooks struct + After func(ctx context.Context, ev RunEvent) + Fired func(ctx context.Context, t Tick) + Name string + OnFailure func(ctx context.Context, ev RunEvent) + OnSuccess func(ctx context.Context, ev RunEvent) + Skipped func(ctx context.Context, t Tick) + Workflow string + type ScheduleID string + func (id ScheduleID) IsZero() bool + func (id ScheduleID) String() string + type ScheduleInfo struct + Active Active + Cron string + Declared bool + ID ScheduleID + KeepRuns int + Labels map[string]string + Last ScheduleLast + Location *time.Location + Misfire Misfire + Name string + Next time.Time + Overlap OverlapPolicy + Paused bool + Seconds bool + Tenant string + Windows Windows + Workflow string + type ScheduleLast struct + Fire time.Time + Run RunRef + Status Status + type ScheduleLister interface + Schedules func(ctx context.Context) ([]ScheduleInfo, error) + type SchedulePauser interface + PauseSchedule func(ctx context.Context, t ScheduleTarget) error + ResumeSchedule func(ctx context.Context, t ScheduleTarget) error + type ScheduleTarget struct + All bool + ID ScheduleID + type ScheduleTriggerer interface + TriggerSchedule func(ctx context.Context, id ScheduleID) (RunRef, error) + type ScheduledID string + func (id ScheduledID) IsZero() bool + func (id ScheduledID) String() string + type SecretDetector interface + Detect func(job Job) []SecretFinding + func NewSecretDetector(r SecretRules) SecretDetector + type SecretFinding struct + Rule string + Where string + type SecretRef struct + Ref string + type SecretResolver interface + ResolveSecret func(ctx context.Context, name string) ([]byte, error) + type SecretRules struct + AllowKeys []string + AllowRules []string + type SpawnOption func(*spawnConfig) + func SpawnAllowDuplicates() SpawnOption + type StackTracer interface + StackTrace func() string + type Status string + const StatusCancelled + const StatusDiscarded + const StatusFailed + const StatusQueued + const StatusRetrying + const StatusRunning + const StatusScheduled + const StatusSucceeded + const StatusWaiting + func Await(ctx context.Context, c Client, ref RunRef, opts AwaitOptions) (Status, error) + func CancelStatuses(q RunQuery) []Status + func EndStatus(have Caps, err error) Status + func (s Status) CanTransitionTo(to Status) bool + func (s Status) IsTerminal() bool + func (s Status) TransitionsFrom() []Transition + func (s Status) Valid() bool + type Step struct + After []string + HeartbeatTimeout time.Duration + Name string + Retry *RetryPolicy + Run Handler + Sleep time.Duration + Timeout time.Duration + Wait *WaitSpec + func Choice(c ChoiceSpec) ([]Step, error) + func (s Step) Kind() StepKind + type StepCanceller interface + CancelStep func(ctx context.Context, ref RunRef, step string) error + type StepInfo struct + Attempt int + Labels map[string]string + Node string + Queue string + ReadyAt time.Time + RunID RunID + Step string + Tenant string + Workflow string + func StepInfoFrom(ctx context.Context) (StepInfo, bool) + func (i StepInfo) TickAt() (time.Time, bool) + type StepKind string + const StepRun + const StepSleep + const StepWait + type StepMiddlewareProvider interface + StepMiddleware func() []Middleware + type StopCauser interface + StopCause func() error + type Tick struct + At time.Time + Declared bool + Err error + Labels map[string]string + Location *time.Location + Manual bool + Missed int + Name string + Outcome TickOutcome + Reason string + Run RunRef + ScheduleID ScheduleID + Workflow string + type TickNotifier interface + OnTick func(fn TickObserver) error + type TickObserver func(ctx context.Context, t Tick) + type TickOutcome string + const TickFired + const TickMisfired + const TickSkipped + type TickSource interface + Between func(from, to time.Time, loc *time.Location, limit int) []time.Time + type Transition struct + From Status + Needs Caps + To Status + Trigger string + func Transitions() []Transition + type UnsupportedError struct + Field string + Missing Caps + Reason string + func (e *UnsupportedError) Error() string + func (e *UnsupportedError) Is(target error) bool + type Upcaster func(raw []byte) ([]byte, error) + type UpstreamLimit struct + func NewUpstreamLimit(store BucketStore, spec BucketSpec, clk clock.Clock) (*UpstreamLimit, error) + func (u *UpstreamLimit) Observe(ctx context.Context, key string, level float64) error + func (u *UpstreamLimit) Take(ctx context.Context, key string, cost float64) error + func (u *UpstreamLimit) TakeOrSnooze(ctx context.Context, key string, cost float64) error + func (u *UpstreamLimit) Wait(ctx context.Context, key string, cost float64) (time.Duration, error) + type WaitSpec struct + Deadline time.Time + Event string + Key string + KeyFrom ConcurrencyKey + Timeout time.Duration + func (w WaitSpec) ResolveKey(job Job) (string, error) + type Window struct + From string + To string + type Windows struct + Between []Window + Unless []Window + func (w Windows) Allows(t time.Time, loc *time.Location) bool + func (w Windows) IsZero() bool + type WorkerScaler interface + QueueLoads func(ctx context.Context) ([]QueueLoad, error) + SetWorkers func(ctx context.Context, queue string, n int) error + type Workflow struct + Concurrency *Concurrency + Cron []string + CronActive Active + CronKeepRuns int + CronLocation *time.Location + CronOverlap OverlapPolicy + CronSeconds bool + CronWindows Windows + Idempotency IdempotencyPolicy + Misfire Misfire + Name string + OnFailure Handler + OnTimeout Handler + Queue string + RateLimits []RateLimit + Retry RetryPolicy + RunTimeout time.Duration + ScheduleWhen func(ctx context.Context, tick Tick) bool + Steps []Step + Timeout time.Duration