Interface EnqueueOptions
delayMs?: number;
groupKey?: string;
maxAttempts?: number;
maxStalledCount?: number;
metadata?: any;
priority?: number;
queue?: string;
removeOnComplete?: number | boolean | { age?: number; count?: number };
removeOnFail?: number | boolean | { age?: number; count?: number };
scheduledAtMs?: number;
tags?: string[];
uniqueKey?: string;
}
Properties
OptionaldelayMs
Convenience: delay this job by N milliseconds relative to now. Computed
server-side at enqueue time. Mutually exclusive with scheduledAtMs.
OptionalgroupKey
Group key for per-group concurrency / rate limiting.
OptionalmaxAttempts
Max total attempts before the job is marked failed. Default 3.
OptionalmaxStalledCount
Max number of stall recoveries (worker-lost rescues) before the job is
moved to failed. Distinct from maxAttempts so a pod kill mid-handler
doesn't burn the handler-throw retry budget. Default 1 — one free
recovery, then fail.
Optionalmetadata
Arbitrary JSON metadata attached to the job (not passed to the handler).
Optionalpriority
Priority (higher runs first). Default 0.
Optionalqueue
Named queue to land this job on. Default "default".
OptionalremoveOnComplete
removeOnComplete: true (drop on finalize) | false
(keep forever) | number (keep last N) | { age?: seconds; count?: N }.
Redis-only — Postgres ignores per-job rules and uses its cleanup tick.
OptionalremoveOnFail
removeOnFail. Same shape as removeOnComplete.
OptionalscheduledAtMs
Run no earlier than this time (epoch milliseconds). Default now.
Mutually exclusive with delayMs — set one or the other.
Optionaltags
Admin-visible tags.
OptionaluniqueKey
Unique key — duplicate enqueues with the same key are silently skipped.
Per-enqueue overrides. All fields optional.