# Get associated workflow from email event

**URL:** <https://community.hubspot.com/t/get-associated-workflow-from-email-event/12625>\
**Category:** APIs & Integrations\
**Tags:** email\
**Created:** [January 3, 2019, 6:32pm UTC](https://community.hubspot.com/t/get-associated-workflow-from-email-event/12625 "2019-01-03T18:32:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [January 3, 2019, 6:32pm UTC](https://community.hubspot.com/t/get-associated-workflow-from-email-event/12625/1 "2019-01-03T18:32:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![cbarley](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/cbarley/32/82559_2.png) [@cbarley](https://community.hubspot.com/u/cbarley)\
**Post date:** [January 4, 2019, 3:48pm UTC](https://community.hubspot.com/t/get-associated-workflow-from-email-event/12625/2 "2019-01-04T15:48:20Z")

</div>

Hi [@tdog](https://community.hubspot.com/u/tdog)! Just to confirm so we’re on the same page, you’re using [this endpoint](https://developers.hubspot.com/docs/methods/email/get_event_by_id) 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?

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [January 4, 2019, 4:10pm UTC](https://community.hubspot.com/t/get-associated-workflow-from-email-event/12625/3 "2019-01-04T16:10:27Z")

</div>

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.

[

 ![](https://d2qpr2jzcazej7.cloudfront.net/original/3X/4/1/41d77e550b0e12bcac2fca285f9d97c81fcf3ae1.jpeg)

email-workflow.jpg1049×381 66.6 KB

]([https://community.hubspot.com/legacyfs/online/uploads/default/original/2X/e/e37b205a4bc28d04f77bdabb818988da86354482.jpeg](https://community.hubspot.com/legacyfs/online/uploads/default/original/2X/e/e37b205a4bc28d04f77bdabb818988da86354482.jpeg))

---

<div class="post-metadata">

**Author:** ![cbarley](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/cbarley/32/82559_2.png) [@cbarley](https://community.hubspot.com/u/cbarley)\
**Post date:** [January 4, 2019, 5:34pm UTC](https://community.hubspot.com/t/get-associated-workflow-from-email-event/12625/4 "2019-01-04T17:34:09Z")

</div>

Hi [@tdog](https://community.hubspot.com/u/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.

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [January 4, 2019, 5:46pm UTC](https://community.hubspot.com/t/get-associated-workflow-from-email-event/12625/5 "2019-01-04T17:46:32Z")

</div>

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

Thank you for your help. I appreciate it.
