Skip to main content

Model Historical Runs object schema

The model historical runs object allows you to query information about a model's run history.

The Example query illustrates a few fields you can query with the modelHistoricalRuns object. Refer to Fields to view the entire schema, which provides all possible fields you can query.

Arguments

When querying for modelHistoricalRuns, you can use the following arguments:

FieldTypeRequired?Description
identifierStringNoThe model identifier
lastRunCountIntNoNumber of last run results where this model was built to return (max of 20)
uniqueIdStringNoThe unique ID of this model
withCatalogBooleanNoIf true, return only runs that have catalog information for this model

Example query

You can use the environmentId and the model's uniqueId to return the model and its execution time for the last 20 times it was run, regardless of which job ran it.

query {
environment(id: 834) {
applied {
modelHistoricalRuns(
uniqueId: "model.marketing.customers" # Use this format for unique ID: RESOURCE_TYPE.PACKAGE_NAME.RESOURCE_NAME
lastRunCount: 20
) {
runId # Get historical results for a particular model
runGeneratedAt
executionTime # View build time across runs
status
tests {
name
status
executeCompletedAt
} # View test results across runs
}
}
}
}

Fields

When querying for modelHistoricalRuns, you can use the following fields:

FieldTypeDescription
accessStringThe access level of this model
accountIdBigInt!The unique ID of the account in dbt Cloud that this node was generated for
aliasStringThe alias of this model
argsStringThe args passed to the dbt step which generated this model
childrenL1[String!]!The list of nodes that depend on this model
columns[CatalogColumn!]The columns of this model
commentStringThe comment on this model
compileCompletedAtDateTimeThe ISO timestamp when the model compilation started
compileStartedAtDateTimeThe ISO timestamp when the model compilation started
compiledCodeStringThe compiled code of this model
compiledSqlStringThe compiled sql of this model
databaseStringThe database this model is defined in
dbtGroupStringThe dbt group id of this model
dbtVersionStringThe version of dbt used to produce this node
dependsOn[String!]!The list of nodes this model depends on
descriptionStringThe user-supplied description for this node
environmentIdBigInt!The unique ID of the account in dbt Cloud that this node was generated for
errorStringThe error message if there was an error else null
executeCompletedAtDateTimeThe ISO timestamp when the model execution completed
executeStartedAtDateTimeThe ISO timestamp when the model execution started
executionTimeFloatThe total time elapsed during the execution of this model
invocationIdStringThe identifier of the run step that generated this model
jobIdBigInt!The unique ID of the account in dbt Cloud that this node was generated for
languageStringThe language of this model
materializedTypeStringThe materialized type of this model
metaJSONObjectThe key-value store containing metadata relevant to this node
nameStringThe user-supplied name of this particular node
ownerStringThe owner of this model
packageNameStringThe package name of this model
packages[String!]The packages of this model
parentsModels[ModelNode!]!Retrieve parents information.
parentsSources[SourceNode!]!Retrieve parents source information.
projectIdBigInt!The unique ID of the account in dbt Cloud that this node was generated for
rawCodeStringThe raw code of this model
rawSqlStringThe raw sql of this model
resourceTypeString!The resource type of this node
runElapsedTimeFloatThe elapsed time of the specific run step (dbt run) that generated this model node
runGeneratedAtDateTimeThe timestamp when the run step (dbt run) was completed, ISO formatted timestamp
runIdBigInt!The unique ID of the account in dbt Cloud that this node was generated for
runResults[RunInfoNode!]!The run results of this model
schemaStringThe schema this model is defined in
skipBooleanWhether this model was skipped
stats[CatalogStat!]!The stats of this model
statusStringThe database reported status of this model
tags[String!]The tags associated with this node
tests[TestNode!]!Retrieve test information.
threadIdStringThe thread that ran the execution of this model
typeStringThe type of this model
uniqueIdString!The unique ID of this node
0