I’m working on a custom code action for a workflow and need to get the value of some properties of some associated custom objects for a deal.
It seems like I would grab the object id of the associated object with:
I don’t really know how to get the id out of the first one (what does it return?), and I think I’m missing something in the second one. How should this be done, and could it be done with a single request?
Also, if there is any documentation on this Node.js SDK yet, please point me to it, as I’ve only come across a few code examples, and no real documentation. This is the most I’ve been able to find:
@GregP, I agree that we need to get more documentation on the various libraries. I can say that this is being worked on. Hoping we have more available sooner than later!
Just adding a quick update for anyone coming across this thread.
HubSpot has introduced improvements to how data from associated records can be used in custom code workflow actions.
You can now use the workflow data panel to select properties from associated records and pass them directly into your custom code action. Depending on your use case, this may eliminate the need to make separate API calls to retrieve those values.
The original two-step API approach is still useful when you need to dynamically identify associated records.
Also, keep in mind that the API key authentication shown in the older example is no longer supported. Current integrations should use a supported access-token authentication method.
Moderator Note: this post was reviewed for relevancy and optimized for clarity on October 23, 2026. Thank you for your contributions to the HubSpot Community!*
Have you resolved your problem yourself or you still need help?
If you have found your answer you should mark this post as resolved. If not, I’d be happy to help
The example code above is way more readable for just this question. It has the call to the deal, to get the id of the associated object, and then a call to the associated object to get it’s properties. The questions is if there is a way to directly get the properties of the associated object, without having to do a separate call to first get the id of the associated object.
In my opinion you can’t do this in the same call so I think what you did is the best way to do it.
Custom code workflow actions can now receive associated-record properties directly through configured data inputs, without necessarily requiring those two API requests.
Moderator Note: this post was reviewed for relevancy and optimized for clarity on October 23, 2026. Thank you for your contributions to the HubSpot Community!