Skip to content

Why should I use custom coded actions in workflows?


In an era where digital marketing is transforming business landscapes, choosing the right tools can make the difference between being a leader or a follower. Among these tools, marketing automation platforms have emerged as a vital component for businesses looking to streamline their operations, improve efficiency, and drive growth. One such platform is HubSpot, renowned for the ease of use of the marketing automation through workflows.

By using Operations Hub Pro or Enterprise, HubSpot users can unlock a world of possibilities. Say goodbye to the limitations that have been holding your business back and hello to increased efficiency, streamlined operations, and accelerated growth. In this article, we'll delve into the basics of Operations Hub and show you how to take things to the next level with just a little bit of code. With Operations Hub at your fingertips, the sky's the limit when it comes to improving your marketing automation workflows and driving your business forward. Get ready to make a profound impact on your bottom line!


Understanding HubSpot's Custom Coded Workflows

In workflows, use the Custom coded action to write and execute JavaScript or Python. With custom code actions, you can extend workflow functionality within and outside of HubSpot. To learn more about HubSpot's APIs, you can refer to the developer documentation. To see examples of common custom code actions, view HubSpot's Programmable Automation Use Cases, but we do want to mention that at the time of writing the use-cases are not up to date and some still use the deprecated API keys, while one other we tested simply did not work.

Custom code actions support JavaScript using the Node 16.x or the Python 3.9 runtime framework. When an action executes, the runtime compute is managed through a serverless function by HubSpot and AWS Lambda.

Expanding Functionality with Custom Code Actions

HubSpot's custom code actions in workflows are powerful tools that allow you to expand beyond the basic functionalities, opening up a world of possibilities tailored to your specific needs. Let's look at a few creative use cases to illustrate the versatility and potential of custom code actions. While the use cases are limitless, here is some inspiration:

Verify email addresses

What if you have a high bounce rate? We all know that more then 30% of the CRM data goes bad every year. That means that if you have not send the contact an email recently, you may want to use an email verification tool like Kickbox, Neverbounce or Zerobounce to confirm that the chance of a bounce is acceptable. But you may not want to do that for your entire database, just for the ones that matter. Custom coded workflow actions are perfect for that.

Cloning closed-won deals to create a renewal deal.

Say you work with subscriptions and renewals. If a deal closes, you want the sales team to get the credit and want to report on the close-rates. But you also want to have visibility on the future renewal deals for forecasting. So you may have a 'sales' pipeline and a separate 'renewals' pipeline for both reporting purposes and because the sales process is drastically different. But obviously you don't want to waste time doing this manually. With a custom coded workflow you can go far beyond the standard capabilities and recalculate the amount to exclude onboarding fees for instance. and recalculate the new contract start and end-date. Once created this may streamline your processes.

Cloning lineitems and associating them to the renewal deal

But why stop with just cloning the deal? Add the lineitems to them as well, and use whatever logics make sense. You could check with the product library if there has been a price change and amend that automatically, remove the once-off items of the original deal or patch the amount based on the lineitems.

Attaching a quote to a deal

To build on the example of the line items: say you have a renewal deal, you have all the line items you need in there. Why not automatically create a quote and put that in draft? This means the sales rep can simply check and do what they do best: sell. Less admin, less friction, more sales.

These are just a few examples of the countless possibilities that HubSpot's custom coded workflow actions can bring to your business. In the code library you can find many more. They offer an immense opportunity to customize and enhance your workflows, leading to increased efficiency, improved data quality, and ultimately, better marketing outcomes.