Today, I was working on one of my many custom code actions, trying to figure out why it isn’t working after just rewriting and updating it to resolve the last error.
In looking for some of the great examples I’ve worked from in the past, I’ve realized the new documentation has almost no examples for working with the Python SDK. Is this dead/dying? Do I now need to learn JavaScript just to work with HubSpot?
Hey, @Hkrewson
I’ll check on an updated page for that dev doc. But in the meantime, here is a link to the HubSpot Python SDK repo. I hope that helps! — Jaycee
@Hkrewson - I have a lot of sympathy with your perspective here. I too chose Python as my preferred Custom Code workflow imlementation lanaguage and now have quite a library built up of techniques and structures which I pull from on new projects. Although I have to say that I gave up on the HubSpot SDK calls after multiple misses with specific object support - I now exclusivly use the “raw” API call format so that I can closelfy follow the call/response documentation.
When this feature was introduced, there was a published set of examples - mainly JS - but some Python. Last time I looked it was so out of date as to be embarrassing. In the past, I also submitted a number of examples of Python techniques to update/supplement the library, following the associated instructions. I naver got any response from my submissions, positive or negative. It would seem, despite the fantastic power of the tools here, that this remains a support backwater for HubSpot. A real missed opportunity IMHO.
Steve
I had honestly hoped to avoid working with requests. Not because it’s a bad solution, it just seemed like a potential for extra work when there’s such a great SDK for providing more direct access. That may be the way I’ll need to move.
I appreciate the insightful and sympathetic response. I’ve used this SDK for so many custom code actions to clean up and simplify workflows and work with a unique custom object.
Hi @Hkrewson I hear you. It is frustrating when you invest in the Python path and the official examples feel like they were left a few versions behind while everything new is JS-first.
The Python SDK itself is not dead, but it does lag a bit behind the docs and new features, which is why you are feeling that mismatch. In workflow custom code actions you can absolutely stay in Python, and you do not need to switch to JavaScript just to keep working with HubSpot.
In practice, the most reliable setup I see in 2025 is what Steve described: use Python in the workflow, pull your private app token from secrets, and call the REST APIs directly with requests, following the main API docs for objects, associations, etc. That way your code matches what is documented here instead of what the SDK happens to expose at a given moment (https://knowledge.hubspot.com/workflows/choose-your-workflow-actions )
If you still want to keep the SDK around, it can sit on top for simple CRUD, but I would not rely on it for newer surfaces like some CRM v4 endpoints without double checking the repo (https://github.com/HubSpot/hubspot-api-python).
If part of the reason you are pushing so hard on custom code is to glue HubSpot to another system in a clean way, Stacksync takes on that integration layer so you can keep writing Python where it adds value instead of chasing SDK gaps and incremental sync logic yourself
@RubenBurdin I’m using custom code because I’m working with custom HubSpot objects or driving solutions with HubSpot objects that may not directly have a supported workflow solution. Looping through code, finding and associating objects that haven’t interacted with the enrolled ticket, or customizing due dates are all things that require some level of customization.