ht
Documentation
WelcomeConcepts

Get Started

OverviewCreate a sourceCreate a modelCreate a destinationCreate a sync

Integrations

dbt CloudAirflowPagerDuty
Documentation/Integrations/dbt Cloud
ht
Documentation

dbt Cloud

Table of Contents
Scheduling with dbt
The Hightouch dbt Cloud integration allows you to schedule a query to execute after your dbt job runs. This ensures that Hightouch always performs syncs with fresh data.

Scheduling with dbt

This requires two steps:
  • Connecting your dbt account to Hightouch
  • Configuring your query to follow a dbt job

Connecting to dbt

Navigate to dbt Cloud and retrieve your API Key.Then copy your API Key from dbt Cloud to the Hightouch credential page.

Configuring your query

Now when creating a query you will be able to select dbt as a schedule type.You can also change the schedule type of an existing query by selecting "Query settings" from the query page.Just select which dbt account and job that your query will run after.Now when your dbt job runs Hightouch will subsequently trigger your query!

Git sync

Git sync allows you to version-control your workflow settings via git. When enabled, your Sync will read/write from a schema file and commit any changes. This ensures that your model definition is always the source of truth for your workflows.
The Hightouch git sync for dbt integration is a beta feature. Email [hello@hightouch.io](mailto:hello@hightouch.io) to request access or request a demo at https://hightouch.io
This requires two steps:
  • Connecting your git account to Hightouch
  • Defining your workflow in the model metadata

Connecting to your git repository

Navigate to your Git Sync Settings and save your git credentials (for service providers like GitHub or Bitbucket see our article on Authenticating for Git Sync).Enabling Bidirectional will enable bidirectional syncing; whenever a change is made to your sync in Hightouch a commit or pull request will be created in your repository reflecting the change.

Defining your workflow

In your repository create a hightouch.yml file like so:
syncs:
- model_id: 123
destination_id: 52407
schedule:
type: cron
expression: "*/30 * * * *"
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 model_id, destination_id, schedule and config property for each sync.

Model ID

The model id property represents the Hightouch model that your sync will use. To find the identifier navigate to your model in Hightouch and grab the identifier from the pathname (ex: https://app.hightouch.io/models/123).

Destination ID

The destination id property represents the Hightouch desitnation that your sync will use. To find the identifier navigate to your destination in Hightouch and grab the identifier from the pathname (ex: https://app.hightouch.io/destinations/52407).

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
quantity: 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

Config

The destinations property is an array of possible destinations to connect your query results to.The config property is different for each type of destination. To learn each variation of the config property read our dbt Destination Config document.

Querying your dbt Models

After connecting your dbt git repository you may query any of your dbt models.We will display any models that exist in your source in the left-sidebar.After creating a Hightouch Sync based on a dbt Model we will automatically sync the configuration for your Hightouch Sync into your git repository (this only works when bidirectional syncing is enabled in your Git Sync configuration).You may see recent Git Activity for your Hightouch Sync under the "Git Activity" tab.

dbt Destination Config

The config property for a destination object varies for each type of destination.

Webhook

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
Where subscribeAdd, subcribeChange, and subscribeDelete define when the sync results should deliver data to the destination.And where mappings is an array of from and to properties defining field mapping transformations.

Slack

config:
format: message|table|csv
channel: C01FA3A40LW
addedBody: "Added things"
removedBody: "Removed things"
Where format define how the update is sent to Slack (either as a message, table, or csv).And where channel is the ID of the Slack channel to send the updates to.If the value format is message then you must include addedBody and optionally removedBody.

Iterable

config:
emailFrom: email
userIdFrom: id
mappings:
- from: id
to: id
- from: email
to: email
- from: first_name
to: firstName
- from: last_name
to: lastName
Where emailFrom defines which column references the name of the column on the Hightouch query that will map to the email field for in Iterable. This is used as the primary key in Iterable.And where userIdFrom is an optional field defining which column will map to the userId field in Iterable.mappings is an array of from and to properties defining field mapping transformations.

Google Sheets

config:
spreadsheetURL: https://docs.google.com/spreadsheets/d/1iH7r9crb3btOuO1y_NUPa1xvXAY6XlQ8Qc1hxhnSmQ8
sheetName: Sheet 1
Where spreadsheetURL is the url to the Google Sheet and where sheetName is the name of the sheet within the spreadsheet.