Errors when enrolling many objects into a custom code workflow step
SOLVE
Hi folks,
I have a deal-based workflow which includes a custom code step.
The custom code searches for a custom object id, then copies a property from the custom object to the deal.
We get hundreds of new deals which are synced twice per day.
When many deals are enrolled in the workflow at once, I'm seeing the custom code step return HTTP 400 errors, and only a small percentage of the enrolled deals actually complete the code step successfully.
If I manually enrol any of the deals which failed individually, the code step completes successfully.
I'm thinking this is likely due to Search API limits, but the error reporting isn't helping me.
I've tried adding a delay step before and after the custom code, but no cigar.
I'm thinking I may need to add a delay in the actual code step itself.
Errors when enrolling many objects into a custom code workflow step
SOLVE
Commenting here as I had a similar case with a customer:
From checking in with our product team, we confirmed that there isn't a way of staggering workflow enrollments at the moment (i.e. if many objects are being enrolled into the same time, they can't be processed or staggered with a few seconds or minutes apart).
I'd suggest posting a new idea for this and sharing your use case with us over in the Ideas forum here which will hopefully let our product team know.
In the meantime, the only way around this is to adjust the process you're using to enroll objects into the workflow. Some possible options:
It sounds like you might be enrolling deals based on an automatic enrollment trigger set up in the workflow, so you could instead remove the trigger and manually enroll contacts. This way, you can choose how many objects you want to enroll at once. If you want to continue using an enrollment trigger, being more specific with the trigger and basing it off different property values might help.
You can also try to experiment with your action execution settings - see documentation here. If the workflow only executes actions during specific time frames throughout each day, you may be able to reduce the amount of objects attempting to go through the workflow actions simultaneously.
That said, while the above are some suggestions, there isn't any single "best" option here as this will depend on your specific needs. Hope this helps to point you in the right direction!
If this post helped, please mark it as a solution to help more users.
Errors when enrolling many objects into a custom code workflow step
SOLVE
Commenting here as I had a similar case with a customer:
From checking in with our product team, we confirmed that there isn't a way of staggering workflow enrollments at the moment (i.e. if many objects are being enrolled into the same time, they can't be processed or staggered with a few seconds or minutes apart).
I'd suggest posting a new idea for this and sharing your use case with us over in the Ideas forum here which will hopefully let our product team know.
In the meantime, the only way around this is to adjust the process you're using to enroll objects into the workflow. Some possible options:
It sounds like you might be enrolling deals based on an automatic enrollment trigger set up in the workflow, so you could instead remove the trigger and manually enroll contacts. This way, you can choose how many objects you want to enroll at once. If you want to continue using an enrollment trigger, being more specific with the trigger and basing it off different property values might help.
You can also try to experiment with your action execution settings - see documentation here. If the workflow only executes actions during specific time frames throughout each day, you may be able to reduce the amount of objects attempting to go through the workflow actions simultaneously.
That said, while the above are some suggestions, there isn't any single "best" option here as this will depend on your specific needs. Hope this helps to point you in the right direction!
If this post helped, please mark it as a solution to help more users.
Errors when enrolling many objects into a custom code workflow step
SOLVE
I think my problem here is that many deals are enrolling at the same time, and there's no way for me to sequentially process them several seconds apart to avoid hitting the 4 per second search API limit.
If I add a delay step, or add a pause in my code step, the workflow still tries to process many search requests at the same time.
What I need is a way to process each deal in the workflow several seconds apart.
Errors when enrolling many objects into a custom code workflow step
SOLVE
Zapier now has a nicely implemented delay method based on a very simple queue - essentially all enrolled objects get pushed onto a queue and then released every 'x' seconds/minutes. It'd be good if HubSpot could pick up something similar. It's getting more acute as an issue as leveraging the OpenAI API for example is super difficult without better control of rates
In the meantime, I'm now using that zapier delay/queue step as a work-round in a number of workflows.