> For the complete documentation index, see [llms.txt](https://ciusji.gitbook.io/luden/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ciusji.gitbook.io/luden/features/dbt-cloud-integration.md).

# DBT Cloud Integration

You can configure Jitsu to trigger [dbt Cloud job run](https://docs.getdbt.com/dbt-cloud/api-v2#operation/triggerRun) on certain events:

* Successful run of Source sync task
* Sync of Destination in batch mode

## Configuration

To enable the integration first you need to configure a special kind of destination with type `dbtcloud`:

```
destinations:
 my_dbtcloud:
  type: dbtcloud
  mode: stream
  dbtcloud:
   account_id: 12345
   job_id: 12345
   cause: '`${_.event_type} triggered sync. source: ${_.source}`'
   token: '12345'
   enabled: true

```

Then you need to add this destination to `post_handle_destinations` collection of Sources and Destinations that need to trigger dbt Cloud job:

```
sources:
  amplitude:
    type: amplitude
    post_handle_destinations:
      - my_dbtcloud
    config:
    ...
destinations:
 my_snowflake:
  type: snowflake
  mode: batch
  post_handle_destinations:
   - my_dbtcloud
  snowflake:
  ...
```

## Supported Events

`dbt` Cloud destination works with following event types only:

* SOURCE\_SUCCESSFUL\_RUN
* DESTINATION\_BATCH\_RUN

all other events are ignored.

Event body example:

```
{
    "event_type":  "DESTINATION_BATCH_RUN",
    "source":      "my_snowflake",
    "_timestamp":  "2021-08-05T14:33:18.607892Z",
    "finished_at": "2021-08-05T14:33:18.607892Z",
    "started_at":  "2021-08-05T14:30:55.182912Z"
}
```
