# dbt Cloud

Euno's integration with dbt Cloud supports auto-discovery of [dbt resources](/sources/transformation-etl/dbt-core/dbt-integration-discovered-resources.md). It automates the retrieval and processing of dbt artifacts from completed runs. This allows for seamless data synchronization and analysis using the latest available dbt job runs.

### How It Works

The integration follows these steps:

1. **Retrieve Jobs from dbt Cloud**
   * Using a dbt Cloud service token, the integration queries the dbt Cloud API to fetch all jobs associated with the single dbt Cloud project specified by the **dbt Cloud Project ID** in the integration configuration. The integration does not iterate over other projects that may be accessible via the service token; to cover multiple projects, create a separate Euno integration per project.
2. **Find the Latest Unprocessed Run for Each Job**
   * For each job, the integration identifies the latest run that has completed successfully and has not yet been processed by Euno.
3. **Retrieve Artifacts from the Run**
   * Once an eligible job run is found, the integration retrieves its associated artifacts:
     * `run_results.json`
     * `manifest.json`
     * `semantic_manifest.json`
     * `catalog.json`
4. **Process the Artifacts**
   * The integration processes the retrieved artifacts to extract relevant information and adds the [discovered](/sources/transformation-etl/dbt-core/dbt-integration-discovered-resources.md) [resources](/sources/transformation-etl/dbt-core/dbt-integration-discovered-resources.md) to Euno's data model.

### Advanced Configuration

#### Filtering Jobs

It's possible to define patterns to include or exclude jobs based on:

* Job names
* Environments
* Branch names

**Without Advanced Filtering**

If no filtering patterns are set, the integration will process all jobs retrieved from dbt Cloud. This means every available job in the configured project will be considered.

**With Advanced Filtering**

By defining inclusion/exclusion patterns, users can:

* Focus on specific jobs that match certain naming conventions.
* Exclude jobs from non-production environments.
* Restrict processing to specific Git branches (e.g., `main` or `production`).

This provides better control over which jobs are processed, reducing unnecessary artifact downloads and processing time.

### Prerequisites

* A dbt Cloud **service token** with sufficient `Read-only` permission. See dbt Cloud's documentation on [how to create service tokens](https://docs.getdbt.com/docs/dbt-cloud-apis/service-tokens).
* The service token should grant access to the dbt project with the job run(s) to retrieve. A single token with access to multiple projects can be reused across separate Euno integrations.

## Setting up Euno's dbt Cloud Integration

### Step 1: Configure New dbt Cloud Source in Euno

#### Step 1: Access the Sources Page

1. Navigate to the **Sources** page in the Euno application.
2. Click on the **Add New Source** button.

#### Step 2: General Configuration

Asterik (\*) means a mandatory field.

<table><thead><tr><th width="221">Configuration</th><th>Description</th></tr></thead><tbody><tr><td>Name*</td><td>Enter a name for your dbt Cloud source (e.g., "dbt - Marketing Models")</td></tr><tr><td>dbt Cloud Account ID*</td><td>Enter you dbt Cloud Account ID. It can be found in the URL, e.g. https://cloud.getdbt.com/settings/accounts/{account_id}/pages/projects/{project_id}<a href="https://cloud.getdbt.com/#/accounts/{account_id}/projects/{project_id}/dashboard/"><br></a></td></tr><tr><td>dbt Cloud Project ID*</td><td>Enter you dbt Cloud Project ID. It can be found in the URL,<br>e.g. https://cloud.getdbt.com/settings/accounts/{account_id}/pages/projects/{project_id}</td></tr><tr><td>dbt Cloud Api Token*</td><td>Enter the service token created in the previous section</td></tr><tr><td>dbt Cloud Job ID (optional)</td><td>Specific dbt Cloud job ID to process. If not specified, all jobs under the dbt project associated with this integration will be processed.</td></tr></tbody></table>

#### **Step 3: Resource Cleanup Options**

To keep your data relevant and free of outdated resources, Euno provides automatic **resource cleanup** options. These settings determine when a resource should be removed if it is no longer detected by a source integration. For a detailed explanation on Euno's cleanup strategies, see: [Resource Sponsorship in Euno.](/developer-reference/technical-concepts/resource-sponsorship-and-cleanup-in-euno.md)

* **Time-Based Cleanup (default)**: Remove resources that were last detected X days before the most recent successful source integration run (user-defined X, default is 7 days).
* **Immediate Cleanup**: Remove resources not detected in the most recent successful source integration run.
* **No Cleanup**: Keep all resources indefinitely, even if they are no longer detected.

#### Step 4: Scheduling Updates

1. Enable the Schedule option.
2. Choose:
   1. **Weekly**: Set specific days and times.
   2. **Hourly**: Define the interval in hours (e.g., every 8 hours).

#### Step 5: Advanced Settings (Optional)

Click on the '**Advanced**' section to display these additional configurations.

<table><thead><tr><th width="210">Configuration</th><th>Description</th></tr></thead><tbody><tr><td>Job Name</td><td>Define patterns to include or exclude jobs based on their names.</td></tr><tr><td>Job Environment</td><td>Define patterns to include or exclude jobs based on their environment.</td></tr><tr><td>Job Branch</td><td>Define patterns to include or exclude jobs based on their branch name.</td></tr><tr><td>dbt Cloud URL</td><td>If you have a dedicated URL to access dbt Cloud enter it here. Defaults to "https://cloud.getdbt.com"</td></tr><tr><td>Override Build Target</td><td>Override the auto-detected warehouse URI prefix. Use when the warehouse account identifier reported by dbt Cloud differs from the one used by the warehouse integration (e.g. Snowflake account locator vs organization account name). Accepts a Snowflake host (e.g. <code>account.snowflakecomputing.com</code>), a Databricks host, or an already-canonized prefix (e.g. <code>snowflake.myorg-myaccount</code>).</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.euno.ai/sources/transformation-etl/dbt-cloud.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
