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

# Triggering dbt syncs in Omni

> How Omni schema refreshes and dbt syncing work together to keep your data warehouse, transformation logic, and BI layer in sync.

export const DbtIdeIcon = ({label}) => {
  return <span>
      <svg class="icon-position" width="1em" height="1em" viewBox="3.5 3.5 17 17" fill="none" stroke-width="2" xmlns="http://www.w3.org/2000/svg">
        <path d="M18.8626 5.12387C19.2152 5.46293 19.4457 5.91049 19.5 6.39873C19.5 6.60217 19.4457 6.7378 19.3237 6.99548C19.2016 7.25317 17.6962 9.85715 17.2487 10.5759C16.991 10.9964 16.8553 11.4982 16.8553 11.9864C16.8553 12.4883 16.991 12.9765 17.2487 13.3969C17.6962 14.1157 19.2016 16.7333 19.3237 16.991C19.4457 17.2487 19.5 17.3707 19.5 17.5741C19.4457 18.0624 19.2288 18.5099 18.8761 18.8354C18.5371 19.1881 18.0895 19.4186 17.6148 19.4593C17.4114 19.4593 17.2758 19.4051 17.0316 19.283C16.7875 19.1609 14.1293 17.6962 13.4105 17.2487C13.3562 17.2215 13.302 17.1808 13.2342 17.1537L10.142 15.7881C10.0418 16.2789 10.0606 16.3806 10.5488 16.8553C10.6438 16.9503 10.7387 17.0316 10.8472 17.113C10.7658 17.1537 10.6709 17.1944 10.5895 17.2487C9.8707 17.6962 7.25317 19.2016 6.99548 19.3237C6.7378 19.4457 6.61573 19.5 6.39873 19.5C5.91049 19.4457 5.46293 19.2288 5.13743 18.8761C4.78481 18.5371 4.55425 18.0895 4.5 17.6013C4.51356 17.3978 4.56781 17.1944 4.67631 17.0181C4.79837 16.7604 6.3038 14.1429 6.75135 13.4241C7.00905 13.0036 7.14467 12.5154 7.14467 12.0136C7.14467 11.5117 7.00905 11.0235 6.75135 10.6031C6.3038 9.85715 4.78481 7.2396 4.67631 6.98192C4.56781 6.8056 4.51356 6.60217 4.5 6.39873C4.55425 5.91049 4.77125 5.46293 5.12387 5.12387C5.46293 4.77125 5.91049 4.55425 6.39873 4.5C6.60217 4.51356 6.8056 4.56781 6.99548 4.67631C7.21248 4.77125 9.12477 5.88336 10.142 6.48012L10.3725 6.61573C10.4539 6.66998 10.5217 6.71067 10.5759 6.7378L10.6845 6.8056L13.6812 8.3724C13.8329 7.62172 13.8038 7.38878 13.1528 6.88698C13.2342 6.8463 13.3291 6.8056 13.4105 6.75135C14.1293 6.3038 16.7468 4.78481 17.0045 4.67631C17.1808 4.56781 17.3843 4.51356 17.6013 4.5C18.076 4.55425 18.5235 4.77125 18.8626 5.12387Z" stroke="currentColor" />
        <path d="M12.9623 12.1899L12.1893 12.9629C12.0808 13.0579 11.9045 13.0579 11.8095 12.9629L11.0365 12.1899C10.928 12.0814 10.928 11.9186 11.0365 11.8101L11.8095 11.0371C11.918 10.9286 12.0808 10.9286 12.1893 11.0371L12.9623 11.8101C13.0708 11.9186 13.0708 12.0814 12.9623 12.1899Z" fill="currentColor" />
      </svg>
    </span>;
};

Omni pulls context from your dbt project into your model, so the descriptions, SQL, and dependencies you maintain in dbt are available to everyone querying in Omni. This allows you to keep definitions in one place, ensuring analytics engineers, analysts, and business users share a single source of truth for what a field or table means.

Two operations keep Omni current with your database and dbt; while the terms are often used interchangeably, they do different jobs:

* **dbt syncs** regenerate the dbt manifest from the selected [dbt environment](/integrations/dbt/environments) and Git branch, locate your dbt models in the database, and pull the model metadata into the corresponding Omni views. They do not scan the database, and therefore do not include structural changes.
* **Schema refreshes** inspect your connected database, identify structural changes, and update the associated Omni model to match. For example, if you add a new column in the warehouse, a schema refresh will pull it into Omni. When an Omni connection has dbt enabled, a schema refresh also performs a dbt sync.

<h2 id="dbt-sync">
  What dbt syncs pull in
</h2>

Omni includes some metadata in every dbt sync, while the rest depends on the connection's dbt settings. See the [dbt metadata reference](/integrations/dbt/metadata-reference) for more information, including the metadata Omni excludes.

## Requirements

To sync dbt with Omni, you'll need:

* A connection with [dbt configured](/integrations/dbt/setup)
* **Modeler** or **Connection Admin** permissions on the Omni model

<h2 id="sync-only">
  Triggering dbt syncs
</h2>

When nothing has changed in the warehouse — you edited a description, added a tag, switched to a different dbt branch, or changed an environment's settings — you don't need a full schema refresh. You can sync dbt on its own from the dbt IDE.

1. In Omni, click **Develop** in the [sidebar](/administration/settings/sidebar).

2. In the list of models, click the model you want to work with to open the model IDE.

3. In the model IDE, click the <DbtIdeIcon /> icon in the sidebar.

4. Click **Sync** at the top of the file list to open the **Sync** page:

   <Frame caption="Access the dbt sync settings through the dbt IDE">
     <img src="https://mintcdn.com/omni-e7402367/smeQ7nB3KO4E6BxP/integrations/dbt/images/dbt-sync-ide-sync-settings.png?fit=max&auto=format&n=smeQ7nB3KO4E6BxP&q=85&s=205c83f381acad7bfe14439178299093" alt="Highlighted Sync settings in the dbt IDE" width="1119" height="886" data-path="integrations/dbt/images/dbt-sync-ide-sync-settings.png" />
   </Frame>

5. Check that **dbt environment** and **dbt git branch** point at the build you want Omni to read.

   Both selectors require an active Omni branch. The production environment always uses the repository's default branch, so its branch selector stays disabled.

   <Warning>
     Unless [Branch-based schema refresh](/modeling/develop/schema-refreshes#requiring-branches-for-schema-refreshes) is enabled, syncing the **production** environment from a branch applies dbt across all models, not only the current branch.
   </Warning>

6. Click **Sync now**. If you changed the environment or branch, the button reads **Save and sync** instead and does both.

<Tip>
  Omni tells you when a sync is due. If the environment has never been synced or its settings have changed since the last sync, you'll see a notice on the **Sync** page.
</Tip>

<h2 id="schema-refresh">
  Triggering schema refreshes
</h2>

Run a schema refresh whenever a dbt run changes the structure of your warehouse, such as adding a model or adding, renaming, or removing columns. On a dbt-enabled connection, a schema refresh also runs a [dbt sync](#dbt-sync).

Schema refreshes happen at the connection level, so the steps are the same whether or not you use dbt. See [Schema refreshes](/modeling/develop/schema-refreshes) to learn how to trigger a refresh manually or on a schedule.

To automatically update Omni, use Omni's APIs to trigger a refresh as the last step of your orchestration workflow:

* Call the [Refresh schema API](/api/models/refresh-schema) immediately after a successful `dbt run`. By default, a schema refresh triggers a direct commit to your integrated Git branch to keep your model files in sync with the database.
* Define [cache policies](/modeling/models/cache-policies) (e.g., 24 hours) and use the [Reset cache API](/api/models/reset-cache) to reset the cache specifically when your warehouse jobs complete.

## Troubleshooting

If you notice a discrepancy between your warehouse and Omni, check these areas:

* **dbt sync issues** - In the dbt IDE, click **Sync** to see what the last sync couldn't translate, including dbt models that Omni couldn't match to a view. See [Debugging dbt sync issues](/integrations/dbt/debugging-sync-issues) for how to work through them.
* **Model version history** - Click the <Icon icon="clock" iconType="solid" className="icons" /> icon in the model IDE to see a chronological list of what changed and who triggered the refresh. See [Viewing and restoring model versions in the model IDE](/modeling/develop/history) for more information.

## Common questions

<AccordionGroup>
  <Accordion title="Do dbt syncs read all the files I see in the dbt IDE?">
    No. The dbt IDE file tree shows your whole dbt project, including macros, tests, and files that aren't dbt resources at all. Browsing a file there does not mean a sync reads it.

    Macros are the exception: Omni runs dbt to build the manifest, so `generate_schema_name` and `generate_database_name` decide where Omni looks for each model's table.
  </Accordion>

  <Accordion title="Does Omni support custom schema-naming macros?">
    Yes. Omni runs the dbt compiler directly. It detects and handles custom `generate_schema_name()` macros, applying them based on your dbt environment parameters in Omni.

    * **Production** - Maps to standard schemas (e.g., `marts`, `reports`).
    * **Development** - Maps to prefixed schemas (e.g., `dbt_blobby_marts`).
  </Accordion>

  <Accordion title="Why are my column descriptions different from dbt or my database?">
    When column descriptions differ between your dbt instance and your data warehouse's catalog, Omni prioritizes dbt's column descriptions. If descriptions are edited in Omni, Omni prioritizes those descriptions.
  </Accordion>

  <Accordion title="What happens if a column is renamed in dbt?">
    Upon refresh, Omni pulls in the new name automatically. The updated field will be available in your topics, but existing workbook references to the old name will break.

    Use the [Content Validator](/modeling/develop/content-validator) to find and bulk-replace broken references across your workbooks. You can open a branch to make these fixes safely, then merge once everything is working as expected — rather than making changes live.
  </Accordion>

  <Accordion title="Can dbt constraints be used with views?">
    In many warehouses, constraints are applied to tables rather than views. If your dbt project outputs views, define constraints at the model level in dbt so Omni can still inherit that logic, even if the warehouse doesn't enforce them on the view.
  </Accordion>

  <Accordion title="Does Omni automatically infer primary keys from dbt tests?">
    No. While a combination of `unique` and `not_null` tests is logically equivalent to a primary key, Omni does not infer primary key status from these tests. Instead, Omni identifies a primary key through:

    1. dbt constraints, which are included in dbt syncs when **Auto-generate primary keys and relationships from dbt constraints** is enabled in the connection's dbt tab.
    2. Primary keys defined on the object in your database
    3. Manually adding the primary key in Omni
  </Accordion>

  <Accordion title="How can dbt metadata help with Omni's AI?">
    Omni pulls dbt metadata into your model in ways that directly improve AI accuracy. For example, integrated descriptions are used for [AI context](/modeling/develop/ai-optimization), which can help the Omni Agent generate more accurate queries.
  </Accordion>
</AccordionGroup>
