Sync HubSpot contacts with pagination
Recipe ToolsMarketingData ParserUtilities
What it does
When the clock triggers every 5 minutes, this automation searches HubSpot for contacts in batches. It parses each batch to extract names and emails, builds a complete list, and logs results so nothing is missed.
Who it's for
Sales operations teams who need to sync large HubSpot contact lists without hitting API limits.
How teams use this
Sync all contacts without API timeouts
Retrieve large contact lists from HubSpot by paginating through batches every 5 minutes. The offset variable ensures no contacts are skipped or duplicated across runs.
Feed contacts to a downstream system
Use the final list to push contacts into another CRM or data warehouse. Only the destination app changes while the pagination logic stays the same.
Filter contacts by status before syncing
Add a condition to the search step so only active or recently updated contacts are included in the final list. The batch loop and parsing remain unchanged.
How it works
- Start sync on a 5-minute schedule. The automation runs every 5 minutes to continuously retrieve contacts from HubSpot.
- Search contacts in the first batch. Search HubSpot for contacts in the first batch, then loop through subsequent batches using an offset variable to paginate through all records.
- Parse JSON from each batch. Parse the JSON document from HubSpot to extract first name, last name, and email for each contact in the batch.
- Build the complete contact list. Add parsed contact details to a final list and update the offset variable to move to the next batch until all contacts are collected.
- Log results to the job report. Record the sync outcome in the job report so the team can verify all contacts were processed without errors.