Sync Thinkific enrollments into HubSpot contacts

By General Input

Every 15 minutes, push new Thinkific course enrollments into HubSpot as fresh contacts so sales and lifecycle automations see real course activity.

Integrations

  • Thinkific
  • HubSpot

Type

Deterministic Code

Categories

  • Sales
  • Operations

Build a code workflow that syncs new Thinkific course enrollments into HubSpot as contacts. The flow is deterministic with no judgement steps. No agent reasoning is needed because the field mapping is 1:1.

Trigger: cron, every 15 minutes. Thinkific is not in the poll providers catalog, so a cron plus list pattern is the correct shape. Keep track of the last successful run timestamp in workflow state so each run only processes enrollments created since the previous run.

Step 1. Call Thinkific List Enrollments with a date filter scoped to enrollments created since the previous run timestamp. Paginate until all new enrollments for the window have been collected.

Step 2. For each new enrollment, call Thinkific Get User by ID using the user_id on the enrollment to fetch the student's first name, last name, and email.

Step 3. Build a single batch payload of contacts, one entry per unique email seen in this run. If the same student appears on multiple enrollments in the same window, collapse them into one entry and use their most recent enrollment as the source of last_thinkific_course and last_enrollment_date. Compute total_thinkific_enrollments as the running total per student. The simplest correct approach is to read the current value of total_thinkific_enrollments from HubSpot via Batch Read Contacts before incrementing, so the count survives across runs. If the property is empty for a contact, treat it as zero.

Step 4. Call HubSpot Batch Upsert Contacts keyed on the email property. Write standard fields firstname, lastname, email, plus three custom contact properties: last_thinkific_course (string, the course name from the enrollment), last_enrollment_date (date, the enrollment created_at), and total_thinkific_enrollments (number). Use a single batch upsert per run, not per contact calls. HubSpot batch endpoints accept up to 100 inputs per call, so chunk if the window has more than 100 unique emails.

Step 5. On success, advance the stored last successful run timestamp to the start time of the current run. On failure, do not advance the cursor so the next run retries the same window.

Notes for the author. The three HubSpot custom properties (last_thinkific_course, last_enrollment_date, total_thinkific_enrollments) must already exist on the Contact object. Mention this in the setup notes the workflow surfaces to the user. Respect rate limits: Thinkific allows 120 requests per minute, HubSpot search is 4 per second, and HubSpot batch endpoints share the standard 110 per 10 seconds OAuth burst limit. Surface a clear log line per run with the count of enrollments processed and the count of contacts upserted so the user can sanity check it from the run history.

Related prompts

Explore more prompts
Turn Mailjet email clicks into ranked HubSpot follow-upsiMessage campaign console with pre-flight checks and delivery boardA searchable RFP answer library your bid team drafts fromSee which target accounts just started advertising on LinkedInAccount health board that puts product usage next to your CRMLook up a customer's full chat history mid conversationLusha prospecting workbench with credit-safe revealsWhich companies your LinkedIn ads reach, matched to your CRMLead response desk with a running clock on every new leadApprove Lusha enrichment field by field before HubSpot saves it