Sync new Teachable students into HubSpot contacts

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

Agentic Task
TeachableHubSpotSalesOperationsData SyncOnboarding AutomationLead Enrichment
PromptCreate

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.

Additional information

What does this prompt do?
  • Watches your Teachable school for new student purchases every 30 minutes and pushes them into HubSpot.
  • Creates a new HubSpot contact if the email is new, or updates the existing one if the buyer is already in your CRM.
  • Sets the contact's lifecycle stage to Customer and stamps the course name and enrollment date on the record.
  • Logs any students it could not match cleanly so you can review them by hand.
What do I need to use this?
  • A Teachable school on a plan that includes API access, and permission to generate an API key.
  • A HubSpot account where you can sign in and grant permission to create and update contacts.
  • Optional: a couple of custom contact properties in HubSpot (for example, enrolled course and enrollment date). The workflow will fall back to a standard note if you skip this step.
How can I customize it?
  • Change how often it runs. Every 30 minutes is a good default, but hourly or every 15 minutes both work.
  • Decide what lifecycle stage new buyers should land in. Customer is the most common choice, but you can send them to Opportunity or a custom stage instead.
  • Pick which fields you care about writing back. First name, last name, course name, and enrollment date are the usual set, but you can add coupon code, price paid, or affiliate.
  • Filter which purchases sync. You can skip free enrollments, sync only a specific course, or only include paid transactions.

FAQs

Will this create duplicate contacts in HubSpot?
No. Every student is matched to HubSpot by email address, and the match is case-insensitive. If the buyer already exists, the workflow updates their record instead of creating a new one.
What happens if I do not have custom properties set up in HubSpot?
The workflow will still create and update contacts and set their lifecycle stage. If it cannot find your custom course or enrollment-date property, it writes that context into a standard notes field instead so nothing is lost.
What if the same student buys two courses in the same 30 minute window?
The workflow groups multiple purchases from the same buyer into a single HubSpot update, so their contact is not overwritten mid-sync.
Does this work for free enrollments and coupon signups too?
Yes by default, but you can tell the workflow to only sync paid transactions if you want your CRM to reflect real customers only.
How do I know if a student could not be synced?
Any student the workflow could not reconcile, for example a purchase with no email, is written to a log so you can review and fix them manually.

Related templates

Filter spam from Netlify forms before it reaches your CRM

Every new form submission gets judged real or junk, sorted by intent, and only genuine sales leads land in HubSpot with an email brief waiting for your team.

Netlify
HubSpot
Gmail
Agentic Task
Log signed Documenso contracts as closed won in HubSpot

When a contract is fully signed, we read the agreed terms, move the matching HubSpot deal to closed won, and post a deal desk summary to Slack.

Documenso
HubSpot
Slack Bot
Agentic Task
Turn signed DocuSeal forms into HubSpot contacts and notes

When a DocuSeal document is fully signed, the answers people typed become real HubSpot records, with the executed PDF filed in Drive.

DocuSeal
HubSpot
Google Drive
+1
Agentic Task
Research new HubSpot leads and brief their owner in Slack

When a new contact lands in HubSpot, we read their company website and recent news, fill in the record, and send their owner a short brief.

Notte
HubSpot
Slack
Agentic Task
Unblock contracts stuck waiting on your own signature

When a customer signs but your side has not, this alerts the internal signer in Slack with the deal value and re-sends their signing email.

DocuSeal
HubSpot
Slack
Agentic Task
Weekday Mailjet deliverability alert that stays quiet on good days

Every weekday at 7am we check your bounce and spam complaint rates, and only message you in Slack when something is actually going wrong.

Mailjet
Slack
HubSpot
Agentic Task

Stop copying course buyers into your CRM by hand.

Connect Teachable and HubSpot once, and Geni keeps your customer list in sync every 30 minutes.