Agenda - v6.0.0
    Preparing search index...

    Interface JobWithState<DATA>

    Job with computed state

    interface JobWithState<DATA = unknown> {
        _id: JobId;
        data: DATA;
        debounceStartedAt?: Date;
        disabled?: boolean;
        endDate?: Date;
        failCount?: number;
        failedAt?: Date;
        failReason?: string;
        fork?: boolean;
        lastFinishedAt?: Date;
        lastModifiedBy?: string;
        lastRunAt?: Date;
        lockedAt?: Date;
        name: string;
        nextRunAt: Date | null;
        priority: number;
        progress?: number;
        repeatAt?: string;
        repeatInterval?: string | number;
        repeatTimezone?: string;
        skipDays?: number[];
        startDate?: Date;
        state: JobState;
        type: "normal" | "single";
        unique?: Record<string, unknown>;
        uniqueOpts?: UniqueOpts;
    }

    Type Parameters

    • DATA = unknown

    Hierarchy (View Summary)

    Index

    Properties

    _id: JobId

    Job ID

    data: DATA
    debounceStartedAt?: Date

    Tracks when debounce window started. Used internally for maxWait calculations.

    disabled?: boolean
    endDate?: Date

    The date when the job should stop running. The job will not run after this date (nextRunAt will be set to null).

    failCount?: number
    failedAt?: Date
    failReason?: string
    fork?: boolean

    Forks a new node sub process for executing this job

    lastFinishedAt?: Date
    lastModifiedBy?: string
    lastRunAt?: Date
    lockedAt?: Date
    name: string
    nextRunAt: Date | null
    priority: number
    progress?: number
    repeatAt?: string
    repeatInterval?: string | number
    repeatTimezone?: string
    skipDays?: number[]

    Days of the week to skip (0 = Sunday, 1 = Monday, ..., 6 = Saturday). The job will not run on these days.

    startDate?: Date

    The date when the job should start running. The job will not run before this date.

    state: JobState
    type: "normal" | "single"

    normal: job is queued and will be processed (regular case when the user adds a new job) single: job with this name is only queued once, if there is an existing entry in the database, the job is just updated, but not newly inserted (this is used for .every())

    unique?: Record<string, unknown>

    Unique constraint query object. Keys are field paths (e.g., 'data.userId'), values are the expected values. The implementation interprets this for upsert operations.

    uniqueOpts?: UniqueOpts