Skip to main content

dagster-hightouch integration reference

This reference provides an overview of the APIs available in the dagster-hightouch library.

Relevant APIs

NameDescription
HightouchSyncComponentA component that represents a Hightouch sync as a Dagster asset.
ConfigurableHightouchResourceA resource for connecting to the Hightouch API using pythonic configuration.
HightouchResourceClient for the Hightouch REST API.
hightouch_sync_opAn op that triggers a Hightouch sync and polls until completion.

Components

The HightouchSyncComponent is the modern, declarative way to define Hightouch syncs as Dagster assets. When materialized, it calls the Hightouch API, polls for completion, and reports metadata such as rows processed and sync status.

type: HightouchSyncComponent
attributes:
sync_id: '12345'
asset:
key: ['marketing', 'salesforce_sync']
AttributeDescription
sync_idThe ID of the Hightouch sync. Can be a literal string or an environment variable (e.g., $HIGHTOUCH_SYNC_ID).
assetThe specification of the asset that this sync produces.

Resources

ConfigurableHightouchResource

The recommended resource for modern Dagster projects using pythonic configuration.

from dagster_hightouch import ConfigurableHightouchResource

import dagster as dg

defs = dg.Definitions(
resources={
"hightouch": ConfigurableHightouchResource(
api_key=dg.EnvVar("HIGHTOUCH_API_KEY"),
)
},
)
AttributeTypeDefaultDescription
api_keystrRequiredYour Hightouch API key.
request_max_retriesint3Maximum number of retries for API requests.
request_retry_delayfloat0.25Delay between retries in seconds.
fail_on_warningboolFalseWhether to treat sync warnings as failures.
poll_intervalfloat3Time in seconds between successive status polls.
poll_timeoutfloat | NoneNoneMaximum time to wait before timing out. None means no timeout.

Methods:

  • sync_and_poll(sync_id, fail_on_warning=None, poll_interval=None, poll_timeout=None) — Triggers a sync and polls until completion. Returns a HightouchOutput.

HightouchResource (Legacy)

A lower-level client for the Hightouch REST API. For modern Dagster projects, use ConfigurableHightouchResource instead.

Methods:

MethodDescription
make_request(method, endpoint, params=None)Sends a request to the Hightouch API with automatic retries.
start_sync(sync_id)Triggers a sync and returns the sync request ID.
poll_sync(sync_id, sync_request_id, ...)Polls for the completion of a sync run.
sync_and_poll(sync_id, ...)Triggers a sync and polls until completion. Returns a HightouchOutput.
get_sync_details(sync_id)Gets details about a sync.
get_sync_run_details(sync_id, sync_request_id)Gets details about a specific sync run.
get_destination_details(destination_id)Gets details about a destination.

Ops

hightouch_sync_op

Executes a Hightouch sync for a given sync_id, and polls until that sync completes, raising an error if it is unsuccessful. It outputs a HightouchOutput which contains the details of the Hightouch connector after the sync run successfully completes.

Requires the hightouch resource key to be configured with a HightouchResource.

Config optionTypeDefaultDescription
sync_idstrRequiredThe Sync ID that this op will trigger.
poll_intervalfloat3Time in seconds between successive polls.
fail_on_warningboolFalseWhether to consider warnings a failure.
poll_timeoutfloat | NoneNoneMaximum time to wait before timing out.

Types

HightouchOutput

Contains recorded information about the state of a Hightouch sync after a sync completes.

AttributeTypeDescription
sync_detailsDict[str, Any]Details about the sync. See Hightouch API: GetSync.
sync_run_detailsDict[str, Any]Details about the sync run. See Hightouch API: ListSyncRuns.
destination_detailsDict[str, Any]Details about the destination. See Hightouch API: GetDestination.