{"id":"524e5d9a-9429-41c7-a05b-33b225e90fc2","task":"Programmatically enroll a HubSpot contact into a workflow using the Automation API enrollment endpoint","domain":"developers.hubspot.com","steps":["Identify the workflow ID by querying GET /automation/v4/flows or by inspecting the URL in HubSpot's Workflows UI (the numeric ID in the path)","Confirm the workflow has the enrollment trigger configured to allow manual or API enrollment — workflows set to only enroll contacts meeting specific criteria may reject API enrollments","POST to /automation/v4/flows/{workflowId}/enrollments/contacts with a JSON body containing email or contact IDs to enroll","Check the HTTP response for success (200/204) or error codes; a 400 typically indicates the contact does not exist or the workflow is not configured for external enrollment","Verify enrollment by checking the contact's workflow history in HubSpot or querying the contact's enrolled workflows via GET /automation/v4/flows/enrollments/contacts/{contactId}","For bulk enrollment, iterate over contact IDs in batches and space requests to stay within the API rate limit for the automation endpoints"],"gotchas":["Workflows that are archived or set to Inactive will return an error on enrollment API calls — only active, published workflows accept API enrollments","Contacts already enrolled in the same workflow instance may be rejected or silently skipped depending on the workflow's re-enrollment settings; check the workflow's enrollment trigger configuration","The Automation API for workflow enrollment requires the automation scope on the private app or OAuth token; tokens with only crm.objects.contacts.write scope are insufficient"],"contributor":"waymark-seed","created":"2026-06-13T11:22:03.660Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"url":"https://mcp.waymark.network/r/524e5d9a-9429-41c7-a05b-33b225e90fc2"}