> ## Documentation Index
> Fetch the complete documentation index at: https://docs.synehq.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Analyze existing dbt models

> Query models built in dbt Cloud or another dbt environment without connecting GitHub or running a Syne compiler.

Start here when your team already builds dbt models elsewhere and wants to analyze their data in Syne. A team admin creates the connection. Team members with access can inspect metadata and run governed queries.

## Before you connect

* Add the PostgreSQL warehouse containing the built tables or views to your Syne team. Select the database that matches the manifest.
* Ensure the model relations exist and the connection has permission to read them.
* Use a PostgreSQL manifest with schema version 9–12, no more than 32 MB, and at most 10,000 normalized resources. Custom adapters and other warehouses are outside this preview.

## Connect dbt Cloud

1. Open **Database tools > dbt > Connect project** and choose **dbt Cloud**.
2. Enter a project name and choose the existing PostgreSQL warehouse connection.
3. Enter the dbt Cloud account hostname, account ID, and job ID. Use the hostname from your account URL, such as `your-account.us1.dbt.com`, without `https://` or a path. Documented regional account hosts and supported legacy hosts are accepted.
4. Supply a dbt Cloud token with permission to read the selected job, runs, and run artifacts. Prefer a service token with the minimum permissions your dbt Cloud plan supports. Syne stores it encrypted and does not return it in project responses.
5. Connect. Syne verifies the account and job, then requests the latest successful run's `manifest.json`. If initial refresh fails, the project stays connected so you can fix access and retry **Refresh metadata**.

Syne uses only GET requests to dbt Cloud: job lookup, successful-run lookup, and manifest retrieval pinned to that run ID. It does not trigger jobs, change schedules, or connect to your repository. The artifact is taken from the run's last step. Choose a job whose final step provides the model metadata you need.

The workspace records the provider run ID and available source SHA. Use **Settings** to renew the read token. Refresh metadata after saving settings. Metadata is not continuously synchronized.

## Import from another dbt environment

1. Generate or obtain `target/manifest.json` from your existing dbt build or compilation environment. Keep warehouse credentials and `profiles.yml` outside the artifact upload.
2. Choose **Import manifest** in **Connect project**.
3. Enter a project name, choose the PostgreSQL warehouse, and select the manifest file.
4. Connect. The imported snapshot is labeled as supplied by your team. Import a newer manifest when definitions change.

No repository, GitHub token, commit SHA, dbt Cloud token, or runner is required for this mode. The file supplies model metadata; it does not transfer warehouse rows or build missing relations.

## Run an analysis

Select a model and open **Analyze data**. **Start with selected model** inserts a quoted relation query. Replace it with the analysis you need. For example, if your project contains `analytics.customer_revenue` with `customer_id` and `lifetime_revenue`:

```sql theme={"system"}
select
  customer_id,
  lifetime_revenue
from analytics.customer_revenue
order by lifetime_revenue desc
```

These names are illustrative. Use the schema, relation, and columns shown in your own project. Queries return at most 200 rows in the editor. Aggregations run in the warehouse; the row cap limits returned rows, not the amount scanned.

Ask Kole: “Use the current dbt metadata to show the customers with the highest lifetime revenue. Show the SQL and explain what this model measures.” Read-only queries can run automatically. Check definitions and artifact provenance before treating the answer as a business metric.

## Troubleshooting

| Symptom                     | Next step                                                                                             |
| --------------------------- | ----------------------------------------------------------------------------------------------------- |
| No successful dbt Cloud run | Build the intended job in dbt Cloud, then refresh metadata in Syne                                    |
| Access denied               | Check hostname, account, job, and token permissions; renew the token in project settings              |
| Refresh failed              | Inspect metadata history, fix the provider error, and retry; the last successful snapshot is retained |
| Relation not found          | Confirm the selected database and schema; build the model in the existing dbt environment             |
| Project changed             | Refresh or import metadata for the current project settings                                           |
| Unsupported manifest        | Use a compatible PostgreSQL artifact within the version and size bounds above                         |

Analysis-only projects do not offer compilation, compiled-SELECT previews, or schema-change ticket creation. Connect a separate [GitHub project](/features/dbt/compilation) when you need that workflow.
