RevenueOperations.si

Notes · Workflows

HubSpot custom code actions: plan, time and memory limits

You need Data Hub Professional or Enterprise for custom code actions, and each execution must finish within 20 seconds using at most 128 MB of memory. Exceeding either limit causes an error.

Last verified 27 November 2026 · first published 27 November 2026 · by Sharoze Iftikhar

You can write JavaScript or Python, with Python labelled beta. HubSpot manages the serverless runtime through AWS Lambda. Check the runtime version before you develop or update an action.

The documented deadline to upgrade Node.js 16 and 20 actions to Node.js 24 was November 17, 2026. New actions on Node.js 20 have been unavailable since November 3, 2026. Python 3.9 sunsets on January 5, 2027: you cannot create or update actions on that version after the sunset, but existing actions keep running. The docs recommend Python 3.14.

What to check

  1. Budget execution time and memory against the 20-second and 128 MB caps. Test logs show memory used and total runtime. Choose your test record carefully because test runs can change that real record.
  2. Add secrets in the action and read them as environment variables. The combined length of all secret values must not exceed 1000 characters.
  3. Keep inputs to at most 50 properties per action. String output values have a 65,000-character limit; exceeding it produces OUTPUT_VALUES_TOO_LARGE.
  4. Rethrow errors in your catch handler to allow documented retries. For rate-limit, 429 or 5XX errors from axios or @hubspot/api-client, HubSpot retries for up to three days, starting after one minute, with a maximum gap of eight hours.
  5. Consider the optional per-action rate limit, which is off by default. You can set a number of executions per second, minute or hour; paused actions resume later.

Common mistakes

Do not treat the optional execution rate limit as an exemption from API limits: HubSpot API calls inside your code remain subject to normal API rate limits. Check both settings when planning your action.

Do not swallow an error that needs a retry: the documented retry behaviour requires you to rethrow it. Include that check when reviewing your error handling.

Sources