Our requirement is to assign workflows to a group of contacts as soon as they are exported to HubSpot.
To do so, I am using the API : "/contacts/v1/contact/batch/", to export a group of contacts, and once we receive the status code from the API as 202, we assign the workflows to all contacts of the batch using the API: "/automation/v2/workflows/:workflowId/enrollments/contacts/:email".
Since, create/update contact API does not provide a field in request body for workflow if, we have to do this after batch is run successfully.
However, sometimes the API to enroll a contact to workflow returns an error as 404, even if the contact is shown as exported correctly.
Please let us know as how this could be resolved as there is no issue while exporting contact.