Skip to main content

jobs Query

Description​

Retrieves a paginated list of background jobs with filtering options. Results are sorted by creation date, newest first.

query jobs(
$page: Int
$taskName: String
$tasks: [String!]
$statuses: [String]
) {
jobs(page: $page, taskName: $taskName, tasks: $tasks, statuses: $statuses) {
jobs {
_id
type
created
options
optionsAsString
status
hidden
completion
}
hasProcessingJobs
pagination {
limit
count
page
pages
hasMore
capped
}
tasks {
label
value
}
}
}

Variables​

{
"page": 1,
"taskName": "taskName",
"tasks": [
"tasks"
],
"statuses": [
"statuses"
]
}

Response​

{
"jobs": {
"jobs": [
{
"_id": "b2ca3f41d53f0953b6d78dc5",
"type": "example",
"created": 1790316009062,
"options": {},
"optionsAsString": "example",
"status": "pending",
"hidden": true,
"completion": 1.23
}
],
"hasProcessingJobs": true,
"pagination": {
"limit": 20,
"count": 10,
"page": 1,
"pages": 1,
"hasMore": true,
"capped": true
},
"tasks": [
{
"label": "example",
"value": "example"
}
]
}
}

Arguments​

NameTypeDescription
pageIntThe requested page number. Defaults to 1 if not specified.
taskNameStringFilter jobs by a specific task name. If provided, tasks parameter is ignored.
tasks[String!]Filter jobs by multiple task names. Ignored if taskName is provided.
statuses[String]Filter jobs by status values. Valid statuses include "pending", "processing", "completed", "failed", etc.

Returns​

JobsConnection!