# Get workflow enrollment history

**URL:** <https://community.hubspot.com/t/get-workflow-enrollment-history/123871>\
**Category:** APIs & Integrations\
**Tags:** free\
**Created:** [January 14, 2025, 12:42pm UTC](https://community.hubspot.com/t/get-workflow-enrollment-history/123871 "2025-01-14T12:42:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![EmilianoVidela](https://avatars.discourse-cdn.com/v4/letter/e/97f17d/32.png) [@EmilianoVidela](https://community.hubspot.com/u/EmilianoVidela)\
**Post date:** [January 14, 2025, 12:42pm UTC](https://community.hubspot.com/t/get-workflow-enrollment-history/123871/1 "2025-01-14T12:42:10Z")

</div>

Hi everyone,

I would like to retrieve all workflow enrollments for a given contact, including the completed ones, similar to what the Workflow Memberships screen on HubSpot displays. Is there a way to achieve this using the API? I tried using this endpoint: “/automation/v2/workflows/enrollments/contacts/:vid”, but it only returns workflows with the status “enrolled.”

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [January 14, 2025, 4:38pm UTC](https://community.hubspot.com/t/get-workflow-enrollment-history/123871/2 "2025-01-14T16:38:20Z")

</div>

Hey, @EmilianoVidela 👋 You are not missing an option. The endpoint you linked to will only return [Current Enrollments](https://developers.hubspot.com/docs/reference/api/automation/create-manage-workflows/v2#current-enrollment). And the current offerings for the v4 Automation (beta) endpoints don’t offer this as an option.

One workaround would to leverage Lists:

- create a Contact-based list
- use the filter "Workflow status: has been enrolled in your\_workflow\_name ( **split name** is the name of one of my test workflows)

 ![CleanShot 2025-01-14 at 09.20.25@2x.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/5/57db4347370f5ae7b346c24f7775c40b631eff75.png)

- use the List API to [**Fetch List Memberships Ordered by ID**](https://developers.hubspot.com/docs/reference/api/crm/lists#get-%2Fcrm%2Fv3%2Flists%2F%7Blistid%7D%2Fmemberships)
- which will return the record IDs for each contact that enrolled
- or
- you can export the list directly if you want the additional columns (properties) included as well

 ![CleanShot 2025-01-14 at 09.32.50@2x.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/5/1/513aafc7f64d8e699786dae2502ce70f80931dfc.png)

I hope this helps! — Jaycee

---

<div class="post-metadata">

**Author:** ![EmilianoVidela](https://avatars.discourse-cdn.com/v4/letter/e/97f17d/32.png) [@EmilianoVidela](https://community.hubspot.com/u/EmilianoVidela)\
**Post date:** [January 15, 2025, 12:36pm UTC](https://community.hubspot.com/t/get-workflow-enrollment-history/123871/3 "2025-01-15T12:36:22Z")

</div>

I found a workaround that, for now, is working. Calling this endpoint: _ **“/crm/v3/lists/records/{objectTypeId}/{recordId}/memberships”** _ returns all the lists a contact is a member of. I noticed that when a user is enrolled in a workflow, a new membership record is created and returned by this endpoint.

If you check the name field, you’ll see something like this for workflow enrollments:  
_**{name: Workflow: 786123, Active List (Automation)}**_.

Using regular expressions, I parsed the name to extract the workflow ID and the status (Active, Completed, or Enrolled). It seems there might be multiple records for a single contact-workflow association, so I merged them using the updatedAt field, keeping only the most recent one.

Afterward, I used the endpoint _ **“/automation/v3/workflows”** _ to retrieve all workflows for a portal. I created a dictionary indexed by workflow ID to optimize access. Then, iterating over my workflow memberships list, I filtered the portal workflows to match the memberships.

I know this workaround doesn’t seem very robust and will require further testing, but it’s working for now. I hope this can help anyone trying to display all workflows for a given contact. Hopefully, we’ll eventually get a dedicated endpoint to handle this more easily! 😀

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [January 15, 2025, 6:04pm UTC](https://community.hubspot.com/t/get-workflow-enrollment-history/123871/4 "2025-01-15T18:04:49Z")

</div>

Hey, @EmilianoVidela 👋 Thanks you verify much for taking the time to come back and share your workaround 🙌 — Jaycee  
PS if you have a moment, adding a comment with your use case and need to the developer feedback form [**here**](https://developers.hubspot.com/feedback) would be helpful. You probably don’t need to share your workaround in the submission, but you could link to your thread for context. We appreciate you!

---

<div class="post-metadata">

**Author:** ![FSiddiqui8](https://avatars.discourse-cdn.com/v4/letter/f/f6c823/32.png) [@FSiddiqui8](https://community.hubspot.com/u/FSiddiqui8)\
**Post date:** [February 25, 2025, 11:16am UTC](https://community.hubspot.com/t/get-workflow-enrollment-history/123871/5 "2025-02-25T11:16:31Z")

</div>

Hey @EmilianoVidela I tried this out but could not find any List being generated on workflow enrollment

---

<div class="post-metadata">

**Author:** ![EmilianoVidela](https://avatars.discourse-cdn.com/v4/letter/e/97f17d/32.png) [@EmilianoVidela](https://community.hubspot.com/u/EmilianoVidela)\
**Post date:** [February 25, 2025, 12:31pm UTC](https://community.hubspot.com/t/get-workflow-enrollment-history/123871/6 "2025-02-25T12:31:13Z")

</div>

Hi @FSiddiqui8,

You’re using objectType = ‘0-1’ and recordId = ‘your contact id’, right?

In my case, that setup works. I’m also using the Node.js SDK.

```auto
const lists = await client.crm.lists.membershipsApi.getLists(
 object_type_id,
 record_id
);

```

That code returns only the IDs, so you’ll need to fetch the details separately like this:

```auto
const ids = lists.results.map((l) => l.listId);
const listDetails = await client.crm.lists.listsApi.getAll(ids, false);

```

At that point, you should see some records with workflow:id as the name.

At least, that’s how it works for me. Hope that helps!
