bunqueue v2.8 API referenceall versions · guide
bunqueue
    Preparing search index...

    Interface JobOptions

    Job options when adding to queue

    interface JobOptions {
        attempts?: number;
        backoff?: number | BackoffOptions;
        continueParentOnFailure?: boolean;
        debounce?: DebounceOptions;
        deduplication?: DeduplicationOptions;
        delay?: number;
        durable?: boolean;
        failParentOnFailure?: boolean;
        ignoreDependencyOnFailure?: boolean;
        jobId?: string;
        keepLogs?: number;
        lifo?: boolean;
        parent?: ParentOpts;
        priority?: number;
        removeDependencyOnFailure?: boolean;
        removeOnComplete?: boolean;
        removeOnFail?: boolean;
        repeat?: RepeatOptions;
        sizeLimit?: number;
        stackTraceLimit?: number;
        stallTimeout?: number;
        timeout?: number;
        timestamp?: number;
    }
    Index
    attempts?: number

    Maximum number of attempts

    backoff?: number | BackoffOptions

    Backoff delay or configuration between retries

    continueParentOnFailure?: boolean

    Continue parent processing even if this child fails

    debounce?: DebounceOptions

    Debounce configuration

    deduplication?: DeduplicationOptions

    Deduplication configuration

    delay?: number

    Delay in milliseconds before job becomes available

    durable?: boolean

    Force immediate persistence to disk (bypass write buffer). Use for critical jobs where data loss is unacceptable. Default: false (uses buffered writes for better throughput)

    failParentOnFailure?: boolean

    Fail parent job if this child job fails

    ignoreDependencyOnFailure?: boolean

    Move job to parent's failed dependencies instead of blocking parent

    jobId?: string

    Custom job ID (for idempotent/deduplication)

    keepLogs?: number

    Maximum number of log entries to keep

    lifo?: boolean

    Process jobs in LIFO order (newest first)

    parent?: ParentOpts

    Parent job reference for flow dependencies (BullMQ v5 compatible). When set, this job becomes a child of the specified parent. The parent will wait for all children to complete before processing.

    priority?: number

    Job priority (higher = processed sooner)

    removeDependencyOnFailure?: boolean

    Remove dependency relationship if this job fails

    removeOnComplete?: boolean

    Remove job on completion. Boolean only — age/count retention (number | KeepJobs) is not implemented and was silently ignored, so the type is narrowed to prevent the misuse. See issue #90.

    removeOnFail?: boolean

    Remove job on failure. Boolean only — see removeOnComplete.

    repeat?: RepeatOptions

    Repeat configuration for recurring jobs

    sizeLimit?: number

    Maximum job data size in bytes

    stackTraceLimit?: number

    Maximum stack trace lines to store on failure

    stallTimeout?: number

    Stall timeout in ms - job is stalled if no heartbeat after this time

    timeout?: number

    Processing timeout in milliseconds

    timestamp?: number

    Job creation timestamp (default: Date.now())