Hi all.
I’m attempting to create a custom object using custom coded workflows. When testing using the documentation “Test Call” feature, it works exactly as expected, creating a new “Test” object record, and associating it with the correct Contact. Below is the example code.
const hubspot = require('@hubspot/api-client');
const hubspotClient = new hubspot.Client({"accessToken":"YOUR_ACCESS_TOKEN"});
const properties = {
"test_name": "Test",
"amount": 80.59
};
const SimplePublicObjectInputForCreate = { associations: [{"types":[{"associationCategory":"USER_DEFINED","associationTypeId":19}],"to":{"id":"4351"}}], properties };
const objectType = "2-9289205";
try {
const apiResponse = await hubspotClient.crm.objects.basicApi.create(objectType, SimplePublicObjectInputForCreate);
console.log(JSON.stringify(apiResponse, null, 2));
} catch (e) {
e.message === 'HTTP request failed'
? console.error(JSON.stringify(e.response, null, 2))
: console.error(e)
}
However, when copying the code over the record is created but the association isn’t made.
const properties = {
"test_name": `New Project - ${event.inputFields['name']}`,
"amount": results_array[i].properties.amount
}
const SimplePublicObjectInputForCreate = { associations: [{"types":[{"associationCategory":"USER_DEFINED","associationTypeId":19}],"to":{"id":"4351"}}], properties };
try {
var createObject = await hubspotClient.crm.objects.basicApi.create("2-9289205", SimplePublicObjectInputForCreate)
}
As you can see the “Test Call” works, and the code (whilst not identical, is still the same format) doesn’t.

I suspect this is because the documentation is using “v3” of the HubSpot client, whereas by default HubSpot custom coded workflows use “v8”.
Are there any changelogs or documentation available that outline the changes to “crm.objects.basicApi.create” so I can get the association working with v8?
EDIT: I refactored my workflow code to use v3. I was hoping that changing the version I was using to be identical to the documentation would solve everything, but unfortunately it’s the same issue ![]()