HubSpot Ideas

jgranados

Custom code action global instance

Custom code actions (still in beta) are a great addition to HubSpot workflows.  However, if you have a custom code action which is used in a lot of workflows and you change the source code for that action, you have to manually change it in all of the workflows one by one.   It would be great if we can create a custom code action "global instance" which can be referenced (and executed) from any workflow so everytime we need to update the custom code action source code we do that only in a single place (the "global instance").

1 Reply
aaberni
Participant

I would love this feature actually. A very useful addendum would be the ability to leverage external parameters from the global instance so that when it is used in a workflow some custom parameters can be set from inside the workflow instead of hardcoding them in the custom code itself. 

I'll give an example: 

I created a custom code action that calls an external api to get a coupon as a gift for the enrolled customer. The parameters for this action are the external coupon service profile id of the contact, which comes from a property of the contact itself, and the campaign from which the coupon is created. The same custom code can be used in multiple workflows but each time the campaign code must be hardcoded. Since the campaign is obviously a workflow-level parameter it would be awesome if I could inject such variable from some shape in the workflow into the custom code.

This is useful because the people who usually build workflows are not the same people who write the custom code, and therefore they should not be allowed to modify the custom code, even just for changing some hardcoded parameter.