Trigger the right Hightouch sync when a data PR merges

By General Input

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.

Integrations

  • Hightouch
  • GitHub
  • Slack Bot

Type

Deterministic Code

Categories

  • Engineering
  • Operations

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.

Related prompts

Explore more prompts
A brand asset library your marketing team actually searchesTurn Mailjet email clicks into ranked HubSpot follow-upsClean out the Looker dashboards and Looks nobody opensLiveKit live operations console for room moderationWake up dormant Keap leads with a researched reasonLiveChat coverage board for planning next week's shiftsPhone routing control panel for LiveKit voice agentsLinkedIn Ads budget pacing dashboard for every client accountGive your team Looker numbers without buying more seatsPause marketing emails to escalated customers, then restore them