Custom coded workflow gives errors with bulk enrollment
Hi,
we prepared a workflow with a custom coded action. When we test the custom code on individual enrolled records, it works perfectly. But when I turn on the workflow and enroll all records that need to go through the custom code, most of them are skipped because of an error. And the error is very unclear. It shows only:
We have enough API calls to work with, and HubSpot does not say that we hit the limits. So that should not be the case.
Digging deeper does not clarify what the problem is. Has anyone some ideas what could cause the issue? Has anyone a similar experience, an if yes how did yo resolve that?
Custom coded workflow gives errors with bulk enrollment
Can't know for sure without seeing the code and the records you are enrolling but it seems to me that maybe some of the records in the bulk enroll don't have known value for all the required properties set as variable in your code.
This is why it works with individual test record but when you enroll them all it fails for some.
Don't forget to mark my reply as a solution if you are satisfied. If not, do not hesitate to ask me anything!
Custom coded workflow gives errors with bulk enrollment
We found still a HAPIKEY instruction. Apparently we missed that one. So that is at least an error fixed 😮; And we finally got a hint that points towards the secondly limit.
Thanks for your response, I think we now know what to do.
Custom coded workflow gives errors with bulk enrollment
Hi,
see custom code listed here. The goal is to set an association between company and deal based on a property in the deal. This property is always filled.
// Get the HubSpot client const hubspot = require('@hubspot/api-client'); const http = require("https"); const {execSync} = require('child_process');
// Call main function exports.main = (event, callback) => { return callback(processEvent(event));};
// Process the work function processEvent(event) {
// HAPIKEY is defined in secrets at the Workflow / Custom Code // Instantiate the HS Client
const hubspotClient = new hubspot.Client({ accessToken: process.env.WorkflowCustomCode });
// Interval const intMin = 2; const intMax = 4;
// Get the Deal ID const dealId = event.object.objectId;
// Get the my_store_id property value // It looks like we need to use the searchApi instead of the basicApi as the custom properties are not returned by the basicApi