Job object schema
The job object allows you to query information about a particular model based on jobId
and, optionally, a runId
.
If you don't provide a runId
, the API returns information on the latest runId of a job.
The example query illustrates a few fields you can query in this job
object. Refer to Fields to see the entire schema, which provides all possible fields you can query.
Arguments
When querying for job
, you can use the following arguments.
Field | Type | Required? | Description |
id | BigInt! | Yes | The unique ID of this job |
runId | BigInt | No | The unique ID of the run in dbt-cloud |
Example Query
You can use your production job's id
.
query JobQueryExample {
# Provide runId for looking at specific run, otherwise it defaults to latest run
job(id: 940) {
# Get all models from this job's latest run
models(schema: "analytics") {
uniqueId
executionTime
}
# Or query a single node
source(uniqueId: "source.jaffle_shop.snowplow.event") {
uniqueId
sourceName
name
state
maxLoadedAt
criteria {
warnAfter {
period
count
}
errorAfter {
period
count
}
}
maxLoadedAtTimeAgoInS
}
}
}
Fields
When querying an job
, you can use the following fields.
Field | Type | Description |
exposure | ExposureNode | |
exposures | [ExposureNode!]! | Retrieve exposure information. |
id | BigInt! | The unique ID of this job |
macro | MacroNode | |
macros | [MacroNode!]! | Retrieve macro information. |
model | ModelNode | |
models | [ModelNode!]! | Retrieve model information. |
runId | BigInt! | The unique ID of run in dbt-cloud |
seed | SeedNode | |
seeds | [SeedNode!]! | |
snapshot | SnapshotNode | |
snapshots | [SnapshotNode!]! | Retrieve snapshot information. |
source | SourceNode | |
sources | [SourceNode!]! | Retrieve model information. |
test | TestNode | Retrieve test information. |
tests | [TestNode!]! | Retrieve test information. |
0