Sync new Teachable students into HubSpot contacts

By General Input

Every 30 minutes, add new course buyers to HubSpot as customer contacts so sales and success see who bought what without lifting a finger.

Integrations

  • Teachable
  • HubSpot

Type

Agentic Task

Categories

  • Sales
  • Operations

Build an agent workflow that syncs new Teachable students into HubSpot as CRM contacts so sales and customer success have a single source of truth for course buyers.

Trigger: cron, every 30 minutes.

On each run, the agent should:

1. Call Teachable List Transactions to find sales transactions created since the last run. Track the last-run timestamp in workflow state so we do not reprocess old rows. Teachable notes that new transactions can take up to two minutes to appear, so overlap the window by a couple of minutes to be safe. If a transaction is missing enrollment context, fall back to Teachable Get User for the buyer to pull their course enrollments.

2. Normalize each student: lowercase and trim the email, capture first and last name (split from Teachable's name field if needed), and record the course name and enrollment date (the transaction's purchased_at or the enrollment's enrolled_at).

3. Group transactions by student. If the same buyer appears in multiple new transactions this run (multiple courses purchased), merge them into a single HubSpot update per contact so we do not overwrite our own work mid-batch. Prefer the most recent course and enrollment date, but include all course names in the custom field (comma-separated) if there is more than one.

4. Look up the HubSpot contact schema once per run using HubSpot List Properties for the contacts object. Detect whether the school's preferred custom properties exist (for example, enrolled_course, enrollment_date, or any obvious course/enrollment field). If they do, write to them. If they do not, write the same information into the standard notes or hs_content_membership_notes property so it is not lost.

5. Call HubSpot Batch Upsert Contacts (matched on email as the idProperty) with up to 100 contacts per call. Set email, firstname, lastname, lifecyclestage=customer, and the course/enrollment fields resolved in step 4. Chunk larger sets across multiple batch calls.

6. For any student the agent could not reconcile (missing email, invalid email format, batch upsert error), log an entry to workflow output listing the Teachable transaction id, the buyer's name if known, and the reason. Do not fail the whole run for these; keep going and report at the end.

At the end of each run, produce a short summary: how many transactions were seen, how many contacts were created vs updated in HubSpot, and any students that could not be reconciled. Persist the new high-water-mark timestamp so the next run picks up cleanly.

Integrations: Teachable and HubSpot.

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