Versions in this module Expand all Collapse all v0 v0.1.1 Nov 10, 2026 Changes in this version type Option + func WithRunQuerier(rq workflow.RunQuerier, caps workflow.Caps) Option v0.1.0 Nov 10, 2026 Changes in this version + const BulkSample + const CodeConflict + const CodeForbidden + const CodeInternal + const CodeInvalid + const CodeMediaType + const CodeNotFound + const CodeUnauthorized + const CodeUnsupported + const DefaultMaxBody + const DefaultMaxBulk + const DefaultMaxScan + const DefaultMetricsBucket + const DefaultMetricsDedupe + const DefaultMetricsKeep + const DefaultMetricsPoints + const DefaultMetricsWindow + const DefaultMonitorInterval + const DefaultOutputBytes + const DefaultOutputPerRun + const DefaultOutputRuns + const DefaultSchedulesLimit + const MaxForceReason + const MaxMetricsPoints + const MaxSchedulesLimit + var Actions = []Action + var Operations = []Operation + func NewHandler[P any](a *Admin, auth Auth[P], opts ...HandlerOption) http.Handler + func Requirements(op Operation) workflow.Caps + func ValidateMetricsQuery(q MetricsQuery) error + type Action string + const ActionCancelRun + const ActionCancelRuns + const ActionCancelStep + const ActionCapabilities + const ActionDeleteRun + const ActionDeleteRuns + const ActionForceComplete + const ActionForceFail + const ActionHealth + const ActionListDiscarded + const ActionListFailures + const ActionListNodes + const ActionListPauses + const ActionListRuns + const ActionListSchedules + const ActionMetrics + const ActionPause + const ActionPauseSchedule + const ActionQueueStats + const ActionRescheduleRun + const ActionResume + const ActionResumeSchedule + const ActionRetryRun + const ActionRetryRuns + const ActionShowOutput + const ActionShowRun + const ActionShowSchedule + const ActionTriggerSchedule + const ActionUI + func (a Action) ReadOnly() bool + type Admin struct + func New(c workflow.Client, opts ...Option) *Admin + func (a *Admin) Cancel(ctx context.Context, ref workflow.RunRef) error + func (a *Admin) CancelAll(ctx context.Context, q workflow.RunQuery) (int, error) + func (a *Admin) CancelStep(ctx context.Context, ref workflow.RunRef, step string) error + func (a *Admin) Client() workflow.Client + func (a *Admin) CountRuns(ctx context.Context, q workflow.RunQuery) (RunCount, error) + func (a *Admin) Delete(ctx context.Context, ref workflow.RunRef) error + func (a *Admin) DeleteAll(ctx context.Context, q workflow.RunQuery, opts BulkOptions) (BulkResult, error) + func (a *Admin) Discarded(ctx context.Context, q workflow.RunQuery) (workflow.RunPage, error) + func (a *Admin) Failures(ctx context.Context, q workflow.RunQuery) (workflow.RunPage, error) + func (a *Admin) ForceComplete(ctx context.Context, ref workflow.RunRef) error + func (a *Admin) ForceFail(ctx context.Context, ref workflow.RunRef, reason string) error + func (a *Admin) HasMetrics() bool + func (a *Admin) HasOutputs() bool + func (a *Admin) Health(ctx context.Context) workflow.HealthReport + func (a *Admin) Metrics(ctx context.Context, q MetricsQuery) (MetricsSeries, error) + func (a *Admin) Nodes(ctx context.Context) ([]workflow.NodeInfo, error) + func (a *Admin) Pause(ctx context.Context, t workflow.PauseTarget) error + func (a *Admin) PauseSchedule(ctx context.Context, id workflow.ScheduleID) error + func (a *Admin) Paused(ctx context.Context) ([]workflow.PauseTarget, error) + func (a *Admin) PreviewCancelAll(ctx context.Context, q workflow.RunQuery) (BulkResult, error) + func (a *Admin) QueueDepths(ctx context.Context) (map[string]int64, error) + func (a *Admin) QueueStats(ctx context.Context) (QueueReport, error) + func (a *Admin) Reschedule(ctx context.Context, ref workflow.RunRef, at time.Time) (workflow.RunRef, error) + func (a *Admin) Resume(ctx context.Context, t workflow.PauseTarget) error + func (a *Admin) ResumeSchedule(ctx context.Context, id workflow.ScheduleID) error + func (a *Admin) Retry(ctx context.Context, ref workflow.RunRef) (workflow.RunRef, error) + func (a *Admin) RetryAll(ctx context.Context, q workflow.RunQuery, opts BulkOptions) (BulkResult, error) + func (a *Admin) Run(ctx context.Context, ref workflow.RunRef) (workflow.RunInfo, error) + func (a *Admin) RunOutput(ctx context.Context, ref workflow.RunRef) ([]AttemptOutput, error) + func (a *Admin) Runs(ctx context.Context, q workflow.RunQuery) (workflow.RunPage, error) + func (a *Admin) Schedule(ctx context.Context, id workflow.ScheduleID) (workflow.ScheduleInfo, error) + func (a *Admin) Schedules(ctx context.Context) ([]workflow.ScheduleInfo, error) + func (a *Admin) Support() []OperationSupport + func (a *Admin) Supports(op Operation) bool + func (a *Admin) TriggerSchedule(ctx context.Context, id workflow.ScheduleID) (workflow.RunRef, error) + type Alert struct + At time.Time + Depth int + Kind AlertKind + Queue string + Resolved bool + Threshold Threshold + Truncated bool + Wait time.Duration + type AlertKind string + const AlertQueueDepth + const AlertQueueWait + type Alerter interface + Alert func(ctx context.Context, a Alert) + type AlerterFunc func(ctx context.Context, a Alert) + func (f AlerterFunc) Alert(ctx context.Context, a Alert) + type AttemptOutput struct + Attempt int + Error string + Finished time.Time + Started time.Time + Step string + Text string + Truncated bool + type Auth struct + Authorize func(ctx context.Context, req Request[P]) error + Identify func(r *http.Request) (P, error) + type BulkOptions struct + DryRun bool + Max int + type BulkResult struct + Done int + Matched int + Sample []workflow.RunRef + Skipped int + Truncated bool + type HandlerOption func(*handlerConfig) + func WithLogger(l *slog.Logger) HandlerOption + func WithPayloads() HandlerOption + func WithStacks() HandlerOption + type MemoryMetrics struct + func NewMemoryMetrics(cfg MemoryMetricsConfig) *MemoryMetrics + func (m *MemoryMetrics) Observe(_ context.Context, ev workflow.RunEvent) + func (m *MemoryMetrics) Series(_ context.Context, q MetricsQuery) (MetricsSeries, error) + type MemoryMetricsConfig struct + Bucket time.Duration + Clock clock.Clock + Dedupe int + Keep time.Duration + type MemoryOutputLimits struct + Bytes int + PerRun int + Runs int + type MemoryOutputs struct + func NewMemoryOutputs(lim MemoryOutputLimits) *MemoryOutputs + func (m *MemoryOutputs) Deliver(_ context.Context, out middleware.Output) error + func (m *MemoryOutputs) RunOutput(_ context.Context, run workflow.RunID) ([]AttemptOutput, error) + type MetricsPoint struct + At time.Time + Cancelled int64 + Discarded int64 + Failed int64 + Succeeded int64 + func (p MetricsPoint) Total() int64 + type MetricsQuery struct + From time.Time + Step time.Duration + To time.Time + Workflow string + type MetricsSeries struct + Points []MetricsPoint + Since time.Time + Step time.Duration + type MetricsSource interface + Series func(ctx context.Context, q MetricsQuery) (MetricsSeries, error) + type MetricsSourceFunc func(ctx context.Context, q MetricsQuery) (MetricsSeries, error) + func (f MetricsSourceFunc) Series(ctx context.Context, q MetricsQuery) (MetricsSeries, error) + type Monitor struct + func NewMonitor(a *Admin, alerter Alerter, thresholds []Threshold, opts ...MonitorOption) (*Monitor, error) + func (m *Monitor) Check(ctx context.Context) error + func (m *Monitor) Run(ctx context.Context) error + type MonitorOption func(*Monitor) + func WithErrorHandler(fn func(error)) MonitorOption + func WithInterval(d time.Duration) MonitorOption + func WithRepeat(d time.Duration) MonitorOption + type Operation string + const OpCancel + const OpCancelAll + const OpCancelStep + const OpDelete + const OpDeleteAll + const OpDiscarded + const OpFailures + const OpForce + const OpHealth + const OpNodes + const OpPause + const OpQueues + const OpReschedule + const OpRetry + const OpRetryAll + const OpRun + const OpRuns + const OpSchedulePause + const OpScheduleTrigger + const OpSchedules + type OperationSupport struct + Missing workflow.Caps + Operation Operation + Reason string + Supported bool + type Option func(*Admin) + func WithClock(clk clock.Clock) Option + func WithMaxBulk(n int) Option + func WithMaxScan(n int) Option + func WithMetrics(src MetricsSource) Option + func WithOutputs(src OutputSource) Option + type OutputSource interface + RunOutput func(ctx context.Context, run workflow.RunID) ([]AttemptOutput, error) + type OutputSourceFunc func(ctx context.Context, run workflow.RunID) ([]AttemptOutput, error) + func (f OutputSourceFunc) RunOutput(ctx context.Context, run workflow.RunID) ([]AttemptOutput, error) + type QueueReport struct + At time.Time + Queues []QueueStat + Truncated bool + Workers bool + type QueueStat struct + Depth int + OldestEnqueuedAt time.Time + OldestWait time.Duration + Queue string + Running int + Workers int + type Request struct + Action Action + HTTP *http.Request + Resource Resource + Who P + type Resource struct + At time.Time + DryRun bool + File string + Metrics *MetricsQuery + Pause *workflow.PauseTarget + Query *workflow.RunQuery + Reason string + Run workflow.RunRef + Schedule workflow.ScheduleID + Step string + type RunCount struct + Cursors []string + Total int + Truncated bool + type Threshold struct + MaxDepth int + MaxWait time.Duration + Queue string