Auto-enroll HubSpot MQLs in a Salesforge sequence

By General Input

The moment a HubSpot contact becomes a Marketing Qualified Lead, drop them into a Salesforge outreach sequence and log the handoff to Google Sheets.

Integrations

  • HubSpot
  • Salesforge
  • Google Sheets

Type

Deterministic Code

Categories

  • Sales
  • Marketing

Build a deterministic code workflow that hands off HubSpot Marketing Qualified Leads to Salesforge automatically, with a Google Sheets audit trail. Every step is a fixed CRUD call, no reasoning needed.

Trigger: a HubSpot webhook fired when a contact's lifecyclestage property changes. The workflow should be configurable so I can point it at any target stage (default: marketingqualifiedlead) and let me change it without editing code.

Step 1. Receive the HubSpot webhook payload. Extract the contact ID and the new lifecyclestage value. If the new value does not match the configured target stage, exit cleanly (no logging needed).

Step 2. Call HubSpot Get Contact using the contact ID. Request the properties email, firstname, lastname, company, and phone. If the contact is archived or not found, exit.

Step 3. Guard: if the returned email is empty or missing, skip Salesforge enrollment. Jump straight to the audit log step below and record the skip reason ("missing email") so nothing disappears silently.

Step 4. Call Salesforge Import Lead into Sequence against a pre-selected sequence ID (make this a per-run configurable input, not hard-coded). Pass the email, firstName, lastName, company, and phone from step 2. This single call both creates the contact in Salesforge and enrolls them in the sequence, so no separate create-then-enroll is needed.

Step 5. Call Google Sheets Append Values against a configured spreadsheet ID and an audit tab (default tab name: MQL Handoff Log). Append one row with these columns in order: timestamp (ISO 8601, UTC), HubSpot contact ID, email, first name, last name, company, Salesforge sequence name, status (enrolled or skipped), and skip reason (blank when status is enrolled). Use USER_ENTERED value input option so the timestamp renders as a real date.

Configurable inputs surfaced in the run dialog: the target HubSpot lifecycle stage, the Salesforge sequence ID (and the human-readable sequence name to write to the sheet), the Google Sheets spreadsheet ID, and the audit tab name.

Error handling: if Salesforge returns a 429, back off and retry once. If it returns any other 4xx, still write an audit row with status=failed and the error message. Do not throw on Sheets append failures; log to the run trace so a temporary Sheets outage does not break the sales handoff.

Non-goals: do not create a HubSpot workflow, do not update the HubSpot contact after enrollment, and do not send Slack notifications. Keep the flow to the four steps above.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentLocal listing health board for every location you manageLet support send one-off Loops emails without an engineerTurn Mailjet email clicks into ranked HubSpot follow-upsStop cold emails to anyone with a live deal in PipedriveiMessage campaign console with pre-flight checks and delivery boardA searchable RFP answer library your bid team drafts fromLinkedIn Ads budget pacing dashboard for every client accountSee which target accounts just started advertising on LinkedInFront desk appointment confirmation board for the next 3 days