I’m trying to extract email data from HubSpot workflows through their API but running into some issues.
Each email in HubSpot has a unique identifier and campaign association. These emails are connected to specific workflow actions. I’ve been testing different API endpoints to get this information.
The /automation/v3/workflows/:workflowId endpoint returns workflow details including an “actions” field that contains the workflow steps and associated emails. However, I’m only getting emails from the main workflow branch. The API response doesn’t include emails from secondary or conditional branches.
Has anyone found a way to retrieve emails from all workflow branches? Or maybe there’s a different API endpoint that can pull all automated emails from workflows regardless of which branch they’re on?
Any suggestions would be helpful since I need to get the complete email list for reporting purposes.
honestly the workflow api is kinda broken for branch emails. what worked for me was hitting the contacts endpoint /crm/v3/objects/contacts with workflow enrollment history then cross-reference those email sends. bit hacky but gets around the branch limitation issue completely
I’ve fought this exact battle too many times and finally gave up wrestling with HubSpot’s API nonsense.
Your problem is manual API calls and stitching data from multiple endpoints. Even if you get it working, you’re stuck maintaining code and handling rate limits forever.
I built an automation with Latenode that pulls all workflow emails regardless of branches. It handles the complex branch traversal automatically - no more figuring out which API version works or parsing nested objects.
Best part? It runs on schedule and dumps everything into a clean reporting format. No debugging API responses or missing conditional emails.
Set it once, forget it. Beats maintaining custom code that breaks every HubSpot update.
The workflow API has major gaps with branch emails. I ran into this building reporting dashboards and discovered the /automation/v3/workflows/:workflowId/history endpoint captures way more email data than the standard workflow endpoint. The history endpoint shows actual execution paths, including which branch emails fired. Now I combine workflow history data with the marketing emails endpoint for complete coverage. History works better because it shows what actually happened, not just the workflow structure - so you catch all those conditional branch emails sent to real contacts. More processing on your end, but way more reliable than trying to parse complex nested workflows.
I’ve hit this same issue. Try the workflows endpoint with includeUnenrolledBranches set to true - it pulls more branch data. The parameter’s barely documented but it works. You can also hit /automation/v3/workflows/:workflowId/branches directly if your HubSpot plan supports it. Last option: query the email events API and match workflow IDs to map all workflow emails. Takes more work on your side but gets you everything.
Had the same prob last month. Try the /marketing/v3/emails endpoint and filter by workflow association. It’s a bit roundabout but catches branch emails that the workflow endpoint sometimes misses.
Yeah, this one’s tricky with HubSpot’s API structure. I switched to the /automation/v4/workflows/:workflowId endpoint instead of v3 and it worked way better. The v4 version handles branch traversal much better and includes nested action arrays that actually catch conditional branch emails reliably. You’ll need to recursively parse through the action objects since branch emails can be buried several levels deep depending on how complex your workflow is. What also helped was combining the workflow data with the /marketing/v3/emails/batch/read endpoint using the email IDs you pull from all action nodes. This way you get everything - including emails from delay branches and A/B test variations that usually get missed when you only hit one endpoint.