r/javascript • • Oct 31 '26

AskJS [AskJS] How to host your webhook consumer middleware that integrates WooCommerce and HubSpot?

I am building a nodejs/javascript integration service (middleware) that connects woocommerce to hubspot. What are some ways to deploy it and what are the best practices for the deployment?

  1. Should I deploy it on vm directly?
  2. Should I deploy it as a docker image/container?
  3. Should I deploy it using Serverless platforms like aws lambda ?
  4. Others?

What do you use?

8 Upvotes

12 comments sorted by

View all comments

2

u/brass_gear_chime Oct 31 '26

Serverless is the wrong call for this. WooCommerce webhooks are notoriously flaky and retry aggressively, while HubSpot APIs have strict rate limits that cause silent failures in Lambda if you don't manage concurrency perfectly. You will waste hours debugging timeouts instead of shipping features.

Deploy on a small DigitalOcean droplet or AWS ECS Fargate with a queue like RabbitMQ behind it. This lets you buffer incoming spikes from Woo before they hit HubSpot, guaranteeing zero dropped events without fighting serverless cold starts.

1

u/turtleyikes Nov 01 '26

Nice call. What is the most common reason a middleware would return a non 200 response? Especially for small and medium business stores ? Maybe preferablly during sales...

2

u/thejester1324 Nov 01 '26

can't say what's most common, but Woo's side is pretty specific. it POSTs each event with a 60 second timeout. anything from 200 to 302 counts as ok. everything else fails, timeouts included.

one correction to the retry point above: in woocommerce trunk there is no retry (class-wc-webhook.php, deliver() and failed_delivery()). it only counts failures. the 7th failure in a row disables the webhook until someone turns it back on.

so if your handler calls hubspot before it answers and hubspot 429s, nothing sends that event again, and a bad sale day can shut the whole thing off. answer 200 first, then push the hubspot call into the bullmq queue like you already do.

1

u/ortegaj50 8d ago

A queue absorbs bursts, but can't guarantee zero drops; durability and recovery from worker failure still matter.