Reference

Queue API Reference

interface Job {
  name: string;
  data: any;
  opts?: JobOpts;
}
interface JobOpts {
  attempts?: number;
  backoff?: {
    type: "exponential" | "linear",
    delay: number // Time in milliseconds
  };
  delay?: number; // Milliseconds
  priority?: number; // Value between 1 and 2_097_152
  lifo?: boolean;
  jobId?: string;
}
interface JobJson {
    id: string;
    data: any;
    opts: JobOpts;
    progress?: number | object;
    returnvalue?: string;
    failedReason?: string;
    stacktrace?: string[];
    attemptsMade: number;
    delay: number;
    timestamp: number;
    processedOn?: number;
    finishedOn?: number;
    queueQualifiedName: string;
}

Add jobs

POST /queues/:queue-name/jobs

Adds one or more jobs to a given queue.

Headers

Body

The body must include an array of jobs with the following structure:

Response

[{
  "id": string,
  "name": string,
  "data": {},
  "opts": JobOpts,
  ...
}]

Get Jobs

GET /queues/:queue-name/jobs

Get jobs in a queue in pages and filtered according to their statuses.

Query Params

Headers

Response

{
  "counts"; { [status: string]: number },
  "jobs": JobJson[],
  "start": number,
  "length": number
}

Get Job

GET /queues/:queue-name/jobs/job-id

<Description of the endpoint>

Headers

Response

JobJson

Last updated