Download OpenAPI specification:Download
This is a Job Scheduling Service based on the BullMQ library. With the power of BullMQ, this service provides a robust and scalable solution for handling job queues and scheduling tasks. The Job Scheduling Service enables them to streamline their workflow by automating recurring tasks, background processing, and asynchronous job execution. It empowers administrators, and developers to define and manage complex job scheduling requirements with ease.
The Scheduler Service using BullMQ allows you to add jobs to a queue with different scheduling options. It supports three types of jobs: delayed jobs, repeatable jobs with a cron pattern, and repeatable jobs with an interval. Accepts a JSON request body with specific parameters.
Job details
jobName required | string Name of the job to be executed |
email required | Array of strings Email addresses associated with the job to report job failure |
required | object Details about the HTTP request to be made when the job is processed |
required | delay (object) or repeat (object) |
{- "jobName": "emailCronJobBeforeOneHour",
- "email": [
- "nevil@tunerlabs.com"
], - "request": {
- "method": "get",
- "header": {
- "internal_access_token": "internal_access_token"
}
}, - "jobOptions": {
- "jobId": "emailCronJobBeforeOneHour",
- "delay": 500000,
- "removeOnComplete": true,
- "removeOnFail": false,
- "attempts": 1
}
}
{- "success": true,
- "responseCode": 200,
- "message": "Job queued successfully",
- "result": {
- "name": "emailCronJobBeforeOneHour",
- "data": {
- "email": [
- "nevil@tunerlabs.com"
], - "request": {
- "method": "get",
- "header": {
- "internal_access_token": "internal_access_token"
}
}
}, - "opts": {
- "attempts": 1,
- "delay": 500000,
- "jobId": "emailCronJobBeforeOneHour",
- "removeOnComplete": true,
- "removeOnFail": false
}, - "id": "emailCronJobBeforeOneHour",
- "progress": 0,
- "returnvalue": null,
- "stacktrace": null,
- "attemptsMade": 0,
- "delay": 500000,
- "timestamp": 1684836046766
}, - "meta": {
- "correlation": "cf4ff717-258a-477e-acb3-4f2bbaa969b9"
}
}
It is used to remove a single job from the scheduler queue. The request body contains a JSON object with the jobId property, representing the unique identifier of the job to be removed.
jobId required | string Unique identifier of the job to be removed |
{- "jobId": "emailCronJobBeforeOneHour"
}
{- "success": true,
- "responseCode": 200,
- "message": "Job successfully removed",
- "result": true,
- "meta": {
- "correlation": "73c06d73-8fb1-487f-b073-992233231bd6"
}
}
Purge jobs/queue using different methods (clean, drain, obliterate). Accepts a JSON request body with the method and options parameters. Note: "options" parameter is only needed for the clean method.
method required | string Enum: "clean" "drain" "obliterate" BullMQ method for purging jobs |
CleanOptions (object) or DrainOrObliterateOptions (object) Options specific to the selected purging method |
{- "method": "clean",
- "options": {
- "gracePeriod": 10000,
- "limit": 100,
- "jobStatus": "completed"
}
}
{- "success": true,
- "responseCode": 200,
- "message": "Jobs cleaned successfully",
- "result": { },
- "meta": {
- "correlation": "b55ee699-981b-48b8-84f0-93a118daaaa8"
}
}
Get a list of jobs from the scheduler
filter | string Enum: "completed" "failed" "delayed" "active" "wait" "paused" "repeat" |
{- "success": true,
- "responseCode": 200,
- "message": "Job list successfully retrieved",
- "result": [
- {
- "name": "emailCronJobBeforeOneHour",
- "opts": {
- "attempts": 3,
- "delay": 62343133,
- "prevMillis": 1684898100000,
- "timestamp": 1684835756867,
- "removeOnFail": 200,
- "removeOnComplete": 100,
- "jobId": "repeat:f17f9ebd8e9a8b916c55a57a567aadaa:1684898100000",
- "repeat": {
- "jobId": "emailCronJobBeforeOneHour",
- "pattern": "15 3 * * *",
- "count": 1
}
}, - "id": "repeat:f17f9ebd8e9a8b916c55a57a567aadaa:1684898100000",
- "progress": 0,
- "returnvalue": "null",
- "stacktrace": [ ],
- "attemptsMade": 0,
- "delay": 62343133,
- "repeatJobKey": "emailCronJobBeforeOneHour:emailCronJobBeforeOneHour:::15 3 * * *",
- "timestamp": 1684835756867
}
], - "meta": {
- "correlation": "8dec3a0b-1622-4d11-9071-4434c126b598"
}
}
The Scheduler Service using BullMQ allows you to add jobs to a queue with different scheduling options. It supports three types of jobs: delayed jobs, repeatable jobs with a cron pattern, and repeatable jobs with an interval. Accepts a JSON request body with specific parameters.
Job details
delay required | number |
id required | number |
{- "delay": 120000,
- "id": 50
}
{- "success": true,
- "responseCode": 200,
- "message": "Job delay updated successfully",
- "result": {
- "name": "emailCronJobBeforeOneHour",
- "data": {
- "email": [
- "nevil@tunerlabs.com"
], - "request": {
- "method": "get",
- "header": {
- "internal_access_token": "internal_access_etoken"
}
}
}, - "opts": {
- "attempts": 1,
- "delay": 15000,
- "removeOnFail": false,
- "jobId": "50",
- "removeOnComplete": false
}, - "id": 50,
- "progress": 0,
- "returnvalue": null,
- "stacktrace": [ ],
- "attemptsMade": 0,
- "delay": 120000,
- "timestamp": 1695813193081
}, - "meta": {
- "correlation": "a2bcaf3d-6010-42ba-a3e4-cf02d7138847"
}
}