APIs & Integrations

AAdamonis
Participant

Enroll Custom Object Into Workflow API

SOLVE

Is there an API that will allow me to enroll a custom object into a workflow?

0 Upvotes
2 Accepted solutions
evaldas
Solution
Key Advisor | Platinum Partner
Key Advisor | Platinum Partner

Enroll Custom Object Into Workflow API

SOLVE

Hi @AAdamonis,

 

As far as I am aware, you can only enroll contact objects via API through the older (v2) workflows API.

 

For custom objects, your best bet would be to set up a custom property (i.e. "enroll_x_workflow") and a workflow based on a custom object property change.

 

You could then use the CRM Objects API to update the property to "Yes", for example.  

 

PATCH
https://api.hubapi.com/crm/v3/objects/{objectType}/{objectId}

 

This would then trigger the workflow to enroll the custom object that had the property changed.

 

Hope this helps


✔️ Did this post help answer your query? Help the community by marking it as a solution.

View solution in original post

0 Upvotes
AAdamonis
Solution
Participant

Enroll Custom Object Into Workflow API

SOLVE

I am using that older endpoint to enroll contacts in another program.  I was hoping maybe there is a newer one that I am not finding that will handle custom objects.  The process I am working on allows the user to select from quite a few workflows and I did not want to add a new property for each one.  My other thought was to maybe try to add the objects to specific lists and use that as the trigger.  Seems like overkill also though.  Thanks for the reply!

View solution in original post

3 Replies 3
MichaelMa
Contributor

Enroll Custom Object Into Workflow API

SOLVE

Have you considered setting up a Workflow that uses a Webhook as an enrollment trigger? You can post the hs_object_id into this workflow and then have this workflow enroll into another one that does the work.

 

I've done something similar to have a single stream that works on multiple objects without having to go into Custom Coded Actions.

 

Eg,

 

Workflow 1: Form Submission. At the end of the form submission, it posts the company hs_object_id to a Webhook via the Webhook action

 

Workflow 2: Triggers on Webhook (Company Object). I can use this as a middle man workflow and push it to another workflow (that might be used for many things or has it's own criteria for enrollment) or just have stuff be done here.

 

Workflow X: Normal enrollment criteria. WF2 can manually enroll companies into this via the Workflow Enrollment action.

 

Can be a bit of a pain to set up but you wouldn't have to deal with properties change trigger.

0 Upvotes
evaldas
Solution
Key Advisor | Platinum Partner
Key Advisor | Platinum Partner

Enroll Custom Object Into Workflow API

SOLVE

Hi @AAdamonis,

 

As far as I am aware, you can only enroll contact objects via API through the older (v2) workflows API.

 

For custom objects, your best bet would be to set up a custom property (i.e. "enroll_x_workflow") and a workflow based on a custom object property change.

 

You could then use the CRM Objects API to update the property to "Yes", for example.  

 

PATCH
https://api.hubapi.com/crm/v3/objects/{objectType}/{objectId}

 

This would then trigger the workflow to enroll the custom object that had the property changed.

 

Hope this helps


✔️ Did this post help answer your query? Help the community by marking it as a solution.

0 Upvotes
AAdamonis
Solution
Participant

Enroll Custom Object Into Workflow API

SOLVE

I am using that older endpoint to enroll contacts in another program.  I was hoping maybe there is a newer one that I am not finding that will handle custom objects.  The process I am working on allows the user to select from quite a few workflows and I did not want to add a new property for each one.  My other thought was to maybe try to add the objects to specific lists and use that as the trigger.  Seems like overkill also though.  Thanks for the reply!