capabilities.work

Cloud Trigger Run and Poll to Completion

A 3-step recipe with dbt. We can help you get access.

Recipe · 3 steps

Cloud Trigger Run and Poll to Completion

with dbt

Trigger a job run and poll it to a successful completion, then fetch artifacts.

  1. Trigger a new run of the supplied job. dbt Cloud queues the run and returns the newly created run resource including its id and initial status.
  2. Fetch the run resource. dbt Cloud run status codes are 1 (queued), 2 (starting), 3 (running), 10 (success), 20 (error) and 30 (cancelled). The step branches on the returned status: success advances to listing artifacts, a terminal failure o
  3. List the artifacts produced by the successful run so downstream tools can retrieve manifest.json, catalog.json and run_results.json.
What you'll need to have ready
  • accountId: The dbt Cloud account id that owns the job.
  • jobId: The id of the job to trigger a run for.
  • token: The dbt Cloud service token (sent as Authorization Bearer Token).
  • cause: A human-readable reason for triggering the run.
For your developer

Arazzo workflow dbt:trigger-run-and-poll, 3 operations: triggerJobRun → getRun → listRunArtifacts. Specs on APIs.io.