---
title: dbt platform task for jobs
description: Configure a dbt platform task in a Lakeflow Job to orchestrate, trigger, and monitor existing dbt platform jobs from Databricks.
canonical_url: https://docs.databricks.com/aws/en/jobs/tasks/dbt-platform
---

# dbt platform task for jobs

> [!NOTE]
> **Preview**
>
> This feature is in [Public Preview](https://docs.databricks.com/aws/en/release-notes/release-types.md).

Use the dbt platform task to orchestrate and monitor existing dbt platform jobs directly from Databricks. Select and trigger dbt jobs, set auto-retry options for failures, and monitor runs.

## <a id="difference" />Differences between dbt platform and dbt tasks

Jobs offers two task types for dbt projects. Choose the right one based on where your dbt project is managed:

**dbt platform task**: Use this to orchestrate pre-existing dbt platform jobs. It connects to the dbt platform API and triggers a run there. Choose this if you want to centralize orchestration in Databricks while retaining all dbt platform benefits, such as monitoring and scheduling.

**dbt task**: Use this to run dbt Core projects on Databricks compute with code from Git or a workspace folder. Choose this if you need full control over the execution environment and prefer to manage dependencies entirely within Databricks. See [dbt task for jobs](https://docs.databricks.com/aws/en/jobs/tasks/dbt.md).

## <a id="prerequisites" />Requirements

To use the dbt platform task, you must meet the following prerequisites:

* A workspace admin must enable the preview. See [Manage Databricks previews](https://docs.databricks.com/aws/en/admin/workspace-settings/manage-previews.md).
* You must have `CREATE CONNECTION` privileges on the Unity Catalog metastore in your workspace.
* Access to an existing dbt project with a defined job in the dbt platform. To learn more, see [Jobs in the dbt platform](https://docs.getdbt.com/docs/deploy/jobs) in the dbt documentation.
* Permissions to generate a service token in the dbt platform. To learn more, see [Service account tokens](https://docs.getdbt.com/docs/dbt-cloud-apis/service-tokens).

> [!NOTE]
>
> For security and operational stability, Databricks recommends generating a service account token, not a personal access token. Service account tokens aren't tied to an individual user and can be easily scoped to provide the minimum necessary permissions.

## <a id="gather-dbt-details" />Gather dbt platform details

To integrate dbt with Databricks, you need the following three details:

* Your dbt platform Account ID.
* An API key generated in the dbt platform.
* Your dbt platform deployment host URL.

The following sections describe how to find this required information.

### <a id="get-account-id" />Get your account ID

To retrieve your account ID:

1. Log in to the dbt platform.
2. Navigate to **Settings** > **Account Settings**.
3. Get the Account ID from the URL suffix, which is in the following format: `https://cloud.getdbt.com/settings/accounts/{account_id}`.

### <a id="get-api-key" />Get your API key

To retrieve your API key:

1. Log in to the dbt platform.
2. Navigate to **Settings** > **Profile Setting** > **Your Profile** > **Access API** > **API Key**.

### <a id="host-url" />Host URL

Your host URL depends on your location and tenancy. See [Access, Regions, & IP addresses](https://docs.getdbt.com/docs/cloud/about-cloud/access-regions-ip-addresses) in the dbt documentation to find the URL for your region.

Identify your region and tenancy (Multi-tenant or Cell-based). Use the **Access URL** column to get your host URL.

| Tenancy Type | Region Example              | Host URL Example                                              |
| ------------ | --------------------------- | ------------------------------------------------------------- |
| Multi-tenant | North America               | `https://cloud.getdbt.com`                                    |
| Cell-based   | North America (`us-east-1`) | `https://12345.us1.dbt.com` (using `12345` as the Account ID) |

## <a id="connection-setup" />dbt platform connection setup

Use the following steps to set up your dbt platform connection in Databricks.

1. Click ![Data icon.](https://docs.databricks.com/aws/en/images/product-icons/DataIcon.svg) **Catalog** in the sidebar.
2. Click ![Plus icon.](https://docs.databricks.com/aws/en/images/product-icons/PlusIcon.svg) the plus icon in the schema browser. Then, click **Create a connection**. The **Set up connection** form opens.
3. Enter the following information, then click **Next**:
   * In **Connection name**, enter a name.
   * For **Connection type**, choose **dbt platform**.
4. Enter your dbt platform host URL in the **Host** text field. Do not include a trailing slash (`/`).
5. Enter your dbt platform Account ID and the API key you collected in a previous step.
6. Click **Create connection** to confirm the connection details.
7. (Optional) Grant other users privileges to use the connection:
   * Choose the user IDs and groups you want to grant privileges to in the **Principals** drop-down menu.
   * Select the privileges you want to grant.
   * Click **Confirm**.

For more about viewing, editing, or deleting Unity Catalog connections, see [Unity Catalog connections](https://docs.databricks.com/aws/en/connect/uc-connections.md).

## <a id="create-job" />Create a new job with a dbt platform task

1. In your workspace, click ![Workflows icon.](https://docs.databricks.com/aws/en/images/product-icons/WorkflowsIcon.svg) **Jobs & Pipelines** in the sidebar.
2. Click **Create**, then **Job**. The new job is automatically named with an associated timestamp.
3. (Optional) Click the job name and enter a new name to edit it.
4. Click **Add another task type**. Search for dbt platform and click the tile to select it.
5. Enter a **Task name**.
6. Use the **dbt platform connection** drop-down menu to select the connection created previously.
7. Use the **dbt platform job** drop-down menu to select the dbt platform job that you want to orchestrate.
8. (Optional) To configure retries, run-duration or streaming-backlog thresholds, or notifications, see [ Advanced task settings](https://docs.databricks.com/aws/en/jobs/configure-task.md#advanced).
9. Click **Save task**.
10. (Optional) Click **Run now** to manually test your job.

To edit, clone, disable, or delete this task, see [Configure and edit tasks in Lakeflow Jobs](https://docs.databricks.com/aws/en/jobs/configure-task.md).

## <a id="schedule-trigger" />Set a schedule or trigger

You can configure jobs to automatically trigger according to a time-based schedule or the arrival of new data. To learn more about the available options, see [Automate jobs with schedules and triggers](https://docs.databricks.com/aws/en/jobs/triggers.md).

> [!NOTE]
>
> Continuous triggers are not supported for dbt platform jobs.

## <a id="monitor-runs" />Monitor runs

You can monitor Lakeflow jobs in the Databricks UI. For dbt platform jobs, you can also open a link that points to job run details in the dbt platform.

To monitor a run:

1. Click **Jobs & Pipelines** in the workspace sidebar.

2. (Optional) Select the **Jobs** and **Owned by me** filters.

3. Click your job's **Name** link.

   The **Runs** tab appears, showing matrix and list views of active and completed runs.

4. Click the link for the run in the **Start time** column in the runs list view. The dbt platform job status opens.

5. Click **View in dbt** to see the job run details in the dbt platform.
