Versions in this module Expand all Collapse all v0 v0.2.2 Oct 19, 2026 v0.2.1 Oct 19, 2026 v0.2.0 Oct 1, 2026 v0.1.0 Sep 30, 2026 Changes in this version + const LevelAlert + func Output[In, Out any](run *TaskRun[In], def TaskDef[Out]) (Out, error) + func Permanent(err error) error + func WithCode(code string, err error) error + type Cipher interface + Decrypt func(ctx context.Context, token string) (string, error) + Encrypt func(ctx context.Context, plaintext string) (string, error) + type CodedError struct + Code string + Err error + func (e *CodedError) Error() string + func (e *CodedError) Unwrap() error + type Config struct + BackoffBase time.Duration + BackoffMax time.Duration + Cipher Cipher + Context Propagator[json.RawMessage] + DefaultMaxAttempts int + DefaultTaskTimeout time.Duration + MaxInProcessBackoff time.Duration + MaxLocalRuns int + SweepMaxAge time.Duration + type Failure struct + Attempts int + Code string + Error string + Task string + type Manager struct + func NewManager(ctx context.Context, db *pgkit.DB, reg *Registry, cfg Config, log *slog.Logger) (*Manager, error) + func (m *Manager) Draining() bool + func (m *Manager) NewRunnable(cfg RunnerConfig) runnable.Runnable + type None = struct + type PermanentError struct + Err error + func (e *PermanentError) Error() string + func (e *PermanentError) Unwrap() error + type Propagator interface + Capture func(ctx context.Context) (T, error) + Restore func(ctx context.Context, snapshot T) (context.Context, error) + func Propagate[T any](p Propagator[T]) Propagator[json.RawMessage] + type Registry struct + func NewRegistry() *Registry + func (r *Registry) Register(wf Workflow) error + type RunnerConfig struct + BatchSize int + ClaimStrategy store.ClaimStrategy + Concurrency int + PollInterval time.Duration + SweepEnabled bool + SweepInterval time.Duration + type StartOption func(*startConfig) + func WithIdempotencyKey(key string) StartOption + type Status = store.WorkflowStatus + const StatusCancelled + const StatusRunning + const StatusStuck + const StatusSucceeded + type TaskDef struct + func NewTask[Out any](name string) TaskDef[Out] + func (d TaskDef[Out]) Name() string + type TaskOption func(*taskConfig) + func Backoff(base, max time.Duration) TaskOption + func BackoffSchedule(schedule []time.Duration) TaskOption + func MaxAttempts(n int) TaskOption + func Timeout(d time.Duration) TaskOption + type TaskRun struct + Input In + Log *slog.Logger + func NewTaskRun[In any](input In, outputs map[string]any) (*TaskRun[In], error) + func (r *TaskRun[In]) IdempotencyKey() string + func (r *TaskRun[In]) LastAttempt() bool + type TaskSpec struct + func Handle[In, Out any](def TaskDef[Out], h func(context.Context, *TaskRun[In]) (Out, error), ...) TaskSpec[In] + func (s TaskSpec[In]) SkipIf(pred func(In) bool) TaskSpec[In] + type Workflow struct + func Define[In any](def WorkflowDef[In], tasks ...TaskSpec[In]) Workflow + func (w Workflow) Name() string + type WorkflowDef struct + func NewWorkflow[In any](name string) WorkflowDef[In] + func (d WorkflowDef[In]) Input(ctx context.Context, run *WorkflowRun) (in In, err error) + func (d WorkflowDef[In]) Name() string + func (d WorkflowDef[In]) Start(ctx context.Context, m *Manager, input In, opts ...StartOption) (*WorkflowRun, error) + func (d WorkflowDef[In]) StartTx(ctx context.Context, m *Manager, tx pgx.Tx, input In, opts ...StartOption) (*WorkflowRun, error) + type WorkflowRun struct + func (r *WorkflowRun) Await(ctx context.Context) (Status, error) + func (r *WorkflowRun) Failure(ctx context.Context) (*Failure, error) + func (r *WorkflowRun) ID() uuid.UUID + func (r *WorkflowRun) Status(ctx context.Context) (Status, error)