30 second limit in workflow custom code

I am calling a rest api using nodejs request from inside my workflow custom code. The call takes more than 30 seconds to complete. I get the below message…

All is not lost.

There was a network error while running your test. Please wait a minute and try reloading the page.

This limit seems to be imposed by Hubspot. Is there a way to increase this timeout limit?

Thanks for any help.

Hey there @gjm222,

The time limit per action execution is actually 20 seconds and is indeed imposed by HubSpot. The below is taken from the docs on coded actions:

Custom code actions must finish running within 20 seconds and can only use up to 128 MB of memory. Exceeding either of these limits will result in an error.

Link to the docs HERE.

HubSpot has not publicized a means of increasing this time limit. Coded actions are primarily meant for smaller scale operations.

Has Hubspot gave any update on increasing the 20s rule? We are trying to do more enhanced API calls to better the customer liver chat experience and the 20s rule is becoming problamatic.

Hello,
I am also having the same problem,
has this been resolved yet?

Hi @tjurabek and welcome, it’s a pleasure to have you here!
Thanks for reaching out to the HubSpot Community!
As @nikodev mentioned, you can see on this documentation “Custom code workflow actions” that custom code actions must finish running within 20 seconds and can only use up to 128 MB of memory. Exceeding either of these limits will result in an error.
If you’d like to see this limit increase, I’d suggest that you share your valuable feedback via the HubSpot Developer Feedback Tool to see if that’s an option for the future.
Thanks and have a great day!
Bérangère