Trigger the right Hightouch sync when a data PR merges
When a data-model pull request merges to main, fire only the Hightouch syncs that touch the changed folders, and post the receipt in Slack.
Build a code workflow that triggers the right Hightouch sync automatically whenever a data-model pull request ships, so production destinations always reflect what just merged. This is a deterministic pipeline with no judgement calls per run.
Trigger: a GitHub webhook on the pull_request event, filtered to action=closed AND merged=true AND base ref=main. Ignore every other PR event (opened, synchronize, closed without merge, draft, non-main base). Configure the trigger so the workflow only runs on real merges to main.
Step 1: Read the changed file paths from the webhook payload. If the payload does not already include the file list, call GitHub to list files for the PR using the repository, PR number, and head SHA from the webhook. Collect the full set of changed file paths.
Step 2: Match those paths against a small path-to-sync-slug mapping the workflow owns. The mapping should be a simple config table inside the workflow that the user can edit. Start with these example entries so the user can see the shape: models/marketing/ → marketing_audience, models/sales/ → sales_account_sync, models/finance/ → finance_billing_sync. A path matches an entry if it starts with that prefix. Build a deduplicated list of matching sync slugs across all changed paths.
Step 3: If the matched list is empty, exit the workflow without doing anything. Do not call Hightouch and do not post to Slack. This keeps unrelated PRs (docs, CI config, tests) from kicking off every sync.
Step 4: For each matched sync slug, call the Hightouch operation "Trigger Sync By ID or Slug" using the slug. Capture the returned sync run id for each trigger. Keep going on errors so one bad slug does not block the rest, but record the failure so it can be reported.
Step 5: Post a single confirmation message to Slack using the Slack Bot "Send a Message" operation, to the channel #data-deploys (let the user override the channel). The message should include the PR title, the PR URL, and a list of the sync slugs that were triggered with their returned sync run ids. If any trigger failed, include the failed slug and the error so the data team can react.
Inputs the user should be able to configure at install time: the GitHub repo to listen to (or repos), the main branch name (default main), the path-to-sync-slug mapping, and the destination Slack channel.
Integrations to use: Hightouch (Trigger Sync By ID or Slug), Slack Bot (Send a Message), and GitHub for the webhook trigger and, if needed, to list PR files.
Additional information
What does this prompt do?
- Watches your data repo for pull requests merged into main and reads which folders the PR changed.
- Maps each changed folder to the matching Hightouch sync using a small lookup you define (for example, marketing models map to the marketing audience sync).
- Kicks off only the syncs that match, so unrelated PRs do not run every sync in your workspace.
- Posts a Slack receipt to your data-deploys channel with the PR title, link, and the syncs that were triggered.
What do I need to use this?
- A Hightouch workspace with the syncs you want to trigger already set up.
- A GitHub repo that holds your data models, where you can add a webhook.
- A Slack workspace and a channel for deploy receipts (for example, #data-deploys).
- A short list mapping each folder in your repo to the right Hightouch sync.
How can I customize it?
- Edit the folder-to-sync mapping to add new model directories or split one folder across multiple syncs.
- Change the Slack channel, or send a direct message to the on-call data engineer instead of a channel.
- Restrict the workflow to certain repos, branches, or PR labels so only production-ready merges fire syncs.
Frequently asked questions
What happens if a PR changes files that do not map to any sync?
Can a single PR trigger more than one sync?
Does this work on a private GitHub repo?
Will it fire when I push a branch or open a draft PR?
Can I see whether each sync actually finished successfully?
Stop guessing which Hightouch sync to run after every merge.
Connect GitHub, Hightouch, and Slack once, and Geni runs the right sync for every data PR that ships.