Get associated workflow from email event

workflows

#1

Hello,

I'm working on an integration to our ERP system and I'm running into an issue. How do I get to the name of the workflow that sent an email? I cannot find the workflow ID from the event or the campaign. I see that it was created by Workflow and the appId of Workflow. But I want the specific workflow that created the event/email.

I'm not a HubSpot expert. So any help would be greatly appreciated.

Thank you,
Tracy


#2

Hi @tdog! Just to confirm so we're on the same page, you're using this endpoint to get a specific event, and are looking for the particular workflow that sent that email, correct?

If so, we currently don't return the workflow ID in the JSON response, but can see the use-case for that. I'm happy to pass this along internally for you if you'd like?


#4

Sounds correct to me. I can see if from the front end. But I cannot figure out how to get from the email to the workflow via the API endpoints. (I've tried several).

Actually, I use /email/public/v1/campaigns and compare the lastUpdatedTime to the last time I ran the process, then I use /email/public/v1/events with the campaign Id, and eventType = SENT.

We then push that information to our ERP, which also contains CRM data. To us, the workflow in HubSpot would be the equivalent of a campaign in our ERP. The recipient is a contact, and the email sent it the activity. So when a customer calls, sales has the HubSpot data readily available.


#5

Hi @tdog, thanks for explaining your use case and clarifying the endpoint you're using! Yes I see we surface this information in the UI, but not within the API. There isn't a way to identify the specific workflow you get returned via the API at this time. I'm reaching out internally on your behalf. In the meantime, I'd recommend using the "name" property for the email, and perhaps giving an indication of which workflow that email might be a part of. You could potentially also build a link with a link from your system to the email in HubSpot, which would then have the workflows listed as you show in your screenshot.


#6

Exactly what I did for a workaround, "Test Workflow || Email 1 of 3".

Thank you for your help. I appreciate it.