dbt · Arazzo Workflow

dbt Cloud Re-run the Latest Failed Run

Version 1.0.0

Inspect the most recent run, and if it failed, re-trigger its job.

1 workflow 1 source API 1 provider
View Spec View on GitHub Analytics EngineeringDataELTMetricsProjectSQLTransformationArazzoWorkflows

Provider

dbt

Workflows

rerun-latest-failed-run
Re-trigger the job of the latest run only when that run errored.
Lists runs to find the newest one, reads its status and job id, and if the status is 20 (error) triggers a new run of the same job.
2 steps inputs: accountId, cause, token outputs: failedRunId, newRunId
1
listRuns
listRuns
List runs for the account; the first entry is treated as the most recent run. Run status codes are 1 (queued), 2 (starting), 3 (running), 10 (success), 20 (error) and 30 (cancelled).
2
rerunJob
triggerJobRun
Trigger a fresh run of the job whose latest run errored.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: dbt Cloud Re-run the Latest Failed Run
  summary: Inspect the most recent run, and if it failed, re-trigger its job.
  description: >-
    A self-healing pattern for scheduled pipelines. The workflow reads the most
    recent run in the account, branches on whether that run errored (status 20),
    and when it did, triggers a fresh run of the same job to recover. When the
    latest run did not fail the workflow simply ends. 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: dbtAdminApi
  url: ../openapi/dbt-cloud-administrative-api-openapi.yml
  type: openapi
workflows:
- workflowId: rerun-latest-failed-run
  summary: Re-trigger the job of the latest run only when that run errored.
  description: >-
    Lists runs to find the newest one, reads its status and job id, and if the
    status is 20 (error) triggers a new run of the same job.
  inputs:
    type: object
    required:
    - accountId
    - token
    properties:
      accountId:
        type: integer
        description: The dbt Cloud account id.
      token:
        type: string
        description: The dbt Cloud service token (sent as Authorization Bearer Token).
      cause:
        type: string
        description: A human-readable reason for the recovery run.
        default: Automatic re-run of failed run
  steps:
  - stepId: listRuns
    description: >-
      List runs for the account; the first entry is treated as the most recent
      run. Run status codes are 1 (queued), 2 (starting), 3 (running),
      10 (success), 20 (error) and 30 (cancelled).
    operationId: listRuns
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.token
    - name: accountId
      in: path
      value: $inputs.accountId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      latestRunId: $response.body#/data/0/id
      latestStatus: $response.body#/data/0/status
      latestJobId: $response.body#/data/0/job_definition_id
    onSuccess:
    - name: latestFailed
      type: goto
      stepId: rerunJob
      criteria:
      - context: $response.body
        condition: $.data[0].status == 20
        type: jsonpath
    - name: latestOk
      type: end
      criteria:
      - context: $response.body
        condition: $.data[0].status != 20
        type: jsonpath
  - stepId: rerunJob
    description: >-
      Trigger a fresh run of the job whose latest run errored.
    operationId: triggerJobRun
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.token
    - name: accountId
      in: path
      value: $inputs.accountId
    - name: jobId
      in: path
      value: $steps.listRuns.outputs.latestJobId
    requestBody:
      contentType: application/json
      payload:
        cause: $inputs.cause
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      newRunId: $response.body#/data/id
      status: $response.body#/data/status
  outputs:
    failedRunId: $steps.listRuns.outputs.latestRunId
    newRunId: $steps.rerunJob.outputs.newRunId

Work with this as data

Every workflow here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for arazzo workflows

4 MCP tools reach this
  • find_arazzoBrowse and filter every workflow in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools

Call it yourself

curl for this page
This workflow
curl "https://apis.io/api/v1/arazzo/dbt-rerun-latest-failed-run-workflow"
All arazzo workflows
curl "https://apis.io/api/v1/arazzo?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no email required.

A second provider on the same verified email joins the account you already have.