arazzo: 1.0.1
info:
title: dbt Cloud Get Run and Fetch Its Artifacts
summary: Read a run, branch on whether it succeeded, and list its artifacts only on success.
description: >-
A guarded artifact retrieval flow. The workflow reads a known run, branches
on the terminal success status (status code 10), and only when the run
succeeded does it list the produced artifacts. This avoids attempting to
pull artifacts for runs that are still in flight or that failed. Every step
spells out its request inline so the flow can be read and executed without
opening the underlying OpenAPI description.
version: 1.0.0
sourceDescriptions:
- name: runsApi
url: ../openapi/dbt-runs-api-openapi.yml
type: openapi
workflows:
- workflowId: run-and-fetch-artifacts
summary: List artifacts for a run only when the run reports status 10 (success).
description: >-
Reads the run, and if status is 10 (success) lists its artifacts; otherwise
ends without fetching artifacts.
inputs:
type: object
required:
- accountId
- runId
- token
properties:
accountId:
type: integer
description: The dbt Cloud account id.
runId:
type: integer
description: The id of the run to inspect.
token:
type: string
description: The dbt Cloud service token (sent as Authorization Bearer Token).
steps:
- stepId: getRun
description: >-
Read the run resource. Status 10 means the run succeeded and produced
artifacts; any other status means artifacts should not be fetched.
operationId: getRun
parameters:
- name: Authorization
in: header
value: Bearer $inputs.token
- name: accountId
in: path
value: $inputs.accountId
- name: runId
in: path
value: $inputs.runId
successCriteria:
- condition: $statusCode == 200
outputs:
status: $response.body#/data/status
isComplete: $response.body#/data/is_complete
onSuccess:
- name: succeeded
type: goto
stepId: listArtifacts
criteria:
- condition: $response.body#/data/status == 10
- name: notSucceeded
type: end
criteria:
- condition: $response.body#/data/status != 10
- stepId: listArtifacts
description: >-
List the artifacts produced by the successful run (manifest.json,
catalog.json, run_results.json).
operationId: listRunArtifacts
parameters:
- name: Authorization
in: header
value: Bearer $inputs.token
- name: accountId
in: path
value: $inputs.accountId
- name: runId
in: path
value: $inputs.runId
successCriteria:
- condition: $statusCode == 200
outputs:
artifacts: $response.body#/data
outputs:
status: $steps.getRun.outputs.status
artifacts: $steps.listArtifacts.outputs.artifacts
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.