Auto-enroll HubSpot MQLs in a Salesforge sequence
The moment a HubSpot contact becomes a Marketing Qualified Lead, drop them into a Salesforge outreach sequence and log the handoff to Google Sheets.
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.
Additional information
What does this prompt do?
- Watches HubSpot for contacts that move into your Marketing Qualified Lead stage, or any other lifecycle stage you pick.
- Pulls the contact's name, company, email, and phone from HubSpot so sales gets a real record, not a stub.
- Adds the lead to a Salesforge sequence you choose, so outreach starts the same day marketing hands them over.
- Appends a row to a Google Sheet every time, with the email, HubSpot record, sequence name, and timestamp, so you have a clean audit trail.
What do I need to use this?
- A HubSpot account where you can install an app and receive contact property change webhooks.
- A Salesforge workspace with the outreach sequence you want new MQLs to land in.
- A Google Sheets file with an audit tab ready to accept new rows.
- A shared idea of which HubSpot lifecycle stage counts as a Marketing Qualified Lead in your team.
How can I customize it?
- Change which HubSpot lifecycle stage triggers the handoff. Sales Qualified Lead, Opportunity, or a custom stage all work.
- Swap the Salesforge sequence per campaign, or route different lead sources to different sequences.
- Pick the columns you want in the audit sheet, for example add lead source, owner, or original form.
Frequently asked questions
What if a HubSpot contact doesn't have an email address yet?
Can I use a lifecycle stage other than Marketing Qualified Lead?
Will this create duplicate contacts in Salesforge?
Does this replace HubSpot workflows?
Can I route to different Salesforge sequences based on the lead?
Related templates
Stop retyping marketing leads into your outreach tool.
Connect HubSpot, Salesforge, and Google Sheets once, and every new MQL lands in the right sequence the same minute marketing hands them off.