Git Sync for dbt (beta)

The Hightouch git sync for dbt integration is a beta feature. Email hello@hightouch.io to request access or request a demo at https://hightouch.io

It allows you to define Hightouch workflows next to your dbt models in a git repository. This ensures that your model definition is always the source of truth for your workflows.

This requires two steps:

  • Connecting your git account to Hightouch

  • Defining your workflow in the model metadata

Connecting to your git repository

In the top menu navigate to your Connection view and select a Connection.

Then in the right side bar select "Configure Git Sync".

Save your git credentials (for GitHub and GitLab users, provide a personal access token with clone privileges as a password).

Defining your workflow

In your repository add a hightouch meta field in your model definition like so:

version: 2
models:
- name: users
meta:
hightouch:
slug: "select-all-users-query"
primary_key: id
schedule:
type: cron
expression: "*/30 * * * *"
destinations:
- id: 52407
config:
subscribeAdd: true
subscribeChange: false
subscribeDelete: false
mappings:
- from: id
to: id
- from: email
to: email
- from: first_name
to: firstName
- from: last_name
to: lastName

You must define a slug, primary_key, schedule and destinations property in the meta field.

Slug

The slug property is a string that represents your query. This string is unique and will be used to determine if your query needs to be created or updated. Changing your slug will result in a new query being created.

Primary Key

The primary_key property is a string that represents which column is the primary key in your table.

Schedule

The schedule property defines which schedule the query will be created with. The following are possible options:

Schedule: Manual

schedule:
type: manual

Schedule: Interval

schedule:
type: interval
unit: minute|hour|day|week
amount: 1

Schedule: Cron

schedule:
type: cron
expression: "*/30 * * * *"

Schedule: dbt

dbt is only available if you are using the dbt Cloud integration

schedule:
type: dbt
accout_id: 1
job_id: 1

Destinations

The destinations property is an array of possible destinations to connect your query results to.

Each destination requires an id and a config property.

The id property is your destination id

This can be found in the URL path name of your destination in Hightouch. For example, go to https://app.hightouch.io/destinations/, click any destination, and copy the <id> from https://app.hightouch.io/destinations/<id>.

The config property is different for each type of destinations. To learn each variation of the config property read our dbt Destination Config document.