# Scheduling with dbt Cloud

The Hightouch dbt Cloud integration allows you to schedule a query to execute after your dbt job runs. This ensures that Hightouch always performs syncs with fresh data.

This requires two steps:

* Connecting your dbt account to Hightouch
* Configuring your query to follow a dbt job

## Connecting to dbt

Navigate to dbt Cloud and [retrieve your API Key](https://cloud.getdbt.com/#/profile/api/).

Then copy your API Key from dbt Cloud to the Hightouch credential page.

![](https://1454996985-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHsth_4gateO06TTdt4%2Fsync%2F127d2458ff2dd8e23c098512f8509a1b7d09bdea.png?generation=1610649027858134\&alt=media)

## Configuring your query

Now when creating a query you will be able to select dbt as a schedule type.

> You can also change the schedule type of an existing query by selecting "Query settings" from the query page.

Just select which dbt account and job that your query will run after.

Now when your dbt job runs Hightouch will subsequently trigger your query!

![](https://1454996985-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHsth_4gateO06TTdt4%2Fsync%2Fa4e22ee3d07c8f5e107b0307dc76911edb5f94ca.png?generation=1610649027014442\&alt=media)
