BullMQ Proxy
  • What is BullMQ Proxy
  • Getting started
    • Architecture overview
    • Using Dragonfly
  • HTTP API
    • Authentication
    • Queues
      • Adding jobs
        • Retries
        • Delayed jobs
        • Prioritized
        • Repeatable
        • LIFO
        • Custom Job IDs
      • Getting jobs
      • Queue's actions
      • Reference
    • Workers
      • Endpoints
      • Adding workers
        • Concurrency
        • Rate-Limit
        • Removing finished jobs
        • Stalled jobs
        • Timeouts
      • Removing workers
      • Getting workers
      • Reference
    • Jobs
      • Jobs' actions
        • Update job progress
        • Add job logs
      • Reference
    • Configuration
    • Debugging
Powered by GitBook
On this page
  • Add jobs
  • Get Jobs
  • Get Job
  1. HTTP API
  2. Queues

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

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

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

Name
Type
Description

name

string

Name of the job

data

any

Arbitrary data to pass to the job processor.

opts

JobOpts

Job options

Response

[{
  "id": string,
  "name": string,
  "data": {},
  "opts": JobOpts,
  ...
}]
Error message depending on the cause of the error.

Get Jobs

GET /queues/:queue-name/jobs

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

Query Params

Name
Default
Description

statuses

all

comma separated lists of valid statuses ("waiting", "delayed", "prioritized", "completed" or "failed"

start

0

offset on where the returned page should start

length

10

Maximum number of job to return in the page

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Response

{
  "counts"; { [status: string]: number },
  "jobs": JobJson[],
  "start": number,
  "length": number
}
Error message depending on the cause of the error.

Get Job

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

<Description of the endpoint>

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Response

JobJson
{
  "error": "Invalid request"
}
PreviousQueue's actionsNextWorkers

Last updated 1 year ago