APIs & Integrations

Ralph_Samuel
Member

Unenroll contacts from workflow not apparently working

SOLVE

I get a 204 response just like when adding to the workflow which works, but there is no visible effect on the Hubspot ui. The same two contacts are in the workflow no matter how many times i remove them via api. What does this 204 response code mean? Is this delayed? Are contacts removed form workflows as a cron job or something? here is a request/response form the logs:

{ statusCode: 204,
  body: undefined,
  headers:
   { 'access-control-allow-credentials': 'false',
     'x-trace': '1B2EEBD0F162550A1E29EFF471A2292FEF746FBEE9943B853DCEB1E438',
     date: 'Fri, 04 Nov 2016 22:10:10 GMT',
     connection: 'close' },
  request:
   { uri:
      Url {
        protocol: 'https:',
        slashes: true,
        auth: null,
        host: 'api.hubapi.com',
        port: 443,
        hostname: 'api.hubapi.com',
        hash: null,
        search: null,
        query: null,
        pathname: '/automation/v2/workflows/1536062/enrollments/contacts/ralph@example.com',
        path: '/automation/v2/workflows/1536062/enrollments/contacts/ralph@example.com',
        href: 'https://api.hubapi.com/automation/v2/workflows/1536062/enrollments/contacts/ralph@example.com' },
     method: 'DELETE',
     headers:
      { Authorization: 'Bearer CENSORED',
        accept: 'application/json',
        'content-length': 0 } 
   } 
}

Low priority, but thanks for any help.
–Ralph

0 Upvotes
1 Accepted solution
IsaacTakushi
Solution
HubSpot Employee
HubSpot Employee

Unenroll contacts from workflow not apparently working

SOLVE

Hi @marshre,

This endpoint truly does unenroll a contact from a workflow, so you can certainly use this endpoint to re-enroll contacts.

I just tested and confirmed this works with a workflow set to manual enrollment:

02%20AM

Isaac Takushi

Associate Certification Manager

View solution in original post

0 Upvotes
10 Replies 10
rmarshall
Member

Unenroll contacts from workflow not apparently working

SOLVE

Hi @Isaac_Takushi, I hadn't tried it this way around and it works out even better. Thanks for the tip to change my workflow to manual enrollment because now it isn't necessary to unenroll the contact from the workflow at all. Just using the endpoint to enroll allows my contacts to be re-enrolled to the workflow via the API endlessly.

Thanks a bunch for the advice!!!
Rebecka

IsaacTakushi
HubSpot Employee
HubSpot Employee

Unenroll contacts from workflow not apparently working

SOLVE

I'm glad I could help, @marshre!

Isaac Takushi

Associate Certification Manager
0 Upvotes
IsaacTakushi
Solution
HubSpot Employee
HubSpot Employee

Unenroll contacts from workflow not apparently working

SOLVE

Hi @marshre,

This endpoint truly does unenroll a contact from a workflow, so you can certainly use this endpoint to re-enroll contacts.

I just tested and confirmed this works with a workflow set to manual enrollment:

02%20AM

Isaac Takushi

Associate Certification Manager
0 Upvotes
rmarshall
Member

Unenroll contacts from workflow not apparently working

SOLVE

Hi, thanks for this explanation, however a question for clarity: does this mean the API is not actually "unenrolling" a contact from a workflow? Will I be able to re-enroll a contact, once I've used the API to "unenroll" them from the workflow? That's my whole purpose for using the DELETE contact from a workflow so as to be able to re-enroll them into the workflow as necessary.

Thanks for any and all suggestions!
Rebecka

0 Upvotes
Dadams
HubSpot Employee
HubSpot Employee

Unenroll contacts from workflow not apparently working

SOLVE

Hi @Ralph_Samuel

Can you send me a link to the contact records and workflows that you’re seeing this with?

0 Upvotes
Ralph_Samuel
Member

Unenroll contacts from workflow not apparently working

SOLVE

Here is the workflow:
https://app.hubspot.com/contacts/2497859/automation/flow/1536062/edit/
It has 2 fake contacts in it. I attempted to remove them shortly after
putting them in. Not sure how to drill down to find links to the individual
contacts in there but there are only two…

0 Upvotes
Dadams
HubSpot Employee
HubSpot Employee

Unenroll contacts from workflow not apparently working

SOLVE

Thanks @Ralph_Samuel. Looking at the history for that workflow, I do see two contacts that have been in the workflow, but I also see that both contacts were manually removed using the API, both on November 4th:
https://app.hubspot.com/contacts/2497859/automation/flow/1536062/timeline/

The workflow also shows 0 active contacts, and 0 contacts that have completed the workflow. Are you seeing something else that shows the contacts as still in the workflow?

0 Upvotes
Ralph_Samuel
Member

Unenroll contacts from workflow not apparently working

SOLVE

Hi David–

So I think maybe i am misunderstanding the terminology used here. maybe
this endpoint doesn’t actually unenroll but rater makes then not active? I
just ran through a short test with a screencast. You can watch it here.
CloudApp

I am setting up the add/remove from workflow trigger action in our
automation interface. I am triggering the action in postman. (just to
give you context on what’s happening in the screen.) Basically the history
shows that a contact was unenrolled but the number of enrolled contacts
never goes down. For your info, here is the remove from workflow request
that happened along with this screen cast:

Request sent: { statusCode: 204,
body: undefined,
headers:
{ ‘access-control-allow-credentials’: ‘false’,
‘x-trace’:
‘1B154915BCEB51FD7465CBEBF9D9C05C62DEC861F79DDBE7A7C4883937’,
date: ‘Tue, 08 Nov 2016 22:16:57 GMT’,
connection: ‘close’ },
request:
{ uri:
Url {
protocol: ‘https:’,
slashes: true,
auth: null,
host: ‘api.hubapi.com’,
port: 443,
hostname: ‘api.hubapi.com’,
hash: null,
search: null,
query: null,
pathname: ‘/automation/v2/workflows/1536062/enrollments/contacts/
ralph5@woopra.com’,
path: ‘/automation/v2/workflows/1536062/enrollments/contacts/
ralph5@woopra.com’,
href: ‘
https://api.hubapi.com/automation/v2/workflows/1536062/enrollments/contacts/ralph5@woopra.com
},
method: ‘DELETE’,
headers:
{ Authorization: ‘Bearer XXX’,
accept: ‘application/json’,
‘content-length’: 0 } } }

Thanks
–Ralph

0 Upvotes
Dadams
HubSpot Employee
HubSpot Employee

Unenroll contacts from workflow not apparently working

SOLVE

The Total contacts enrolled count is the number of contacts that have ever started the workflow, so that count won’t go down, whether a contact finishes all of the steps or a contact is removed or unenrolled. The Active contacts count will go down, since that count tracks how many contacts are currently executing or waiting to execute steps.

0 Upvotes
Ralph_Samuel
Member

Unenroll contacts from workflow not apparently working

SOLVE

Ok just a misunderstanding of terminology. Sorry about that.
–Ralph

0 Upvotes