HubSpot Custom Code Node.js 24: Upgrade Before Nov 17

The HubSpot custom code Node.js 24 upgrade has a hard date: workflow actions on Node.js 20 become read-only on November 17, 2026. For each action: drop the callback style, return outputFields from an async handler, and replace the request library. Your Node.js 20 actions keep running after the deadline, but you won't be able to save changes to them, so upgrade and test them now.

Written November 10, 2026 (KST). Facts checked on November 10, 2026 against HubSpot's developer changelog (published November 3, updated November 4, 2026), the official "Upgrade custom code actions to Node.js 24" guide, the custom code actions reference and the @hubspot/api-client changelog on GitHub. I have not run these changes in a HubSpot portal. The code samples are my own examples based on the documented rules. Test them on a test record first.

What changes for HubSpot custom code actions on November 17

HubSpot announced the change in its developer changelog on November 3, 2026. Node.js 16 and 20 no longer receive security updates, so HubSpot is moving workflow custom code actions to Node.js 24 and closing the older runtimes in two steps.

DateWhat happensStill works
Nov 3, 2026No new Node.js 20 custom code actionsExisting Node.js 20 actions run and can be edited
Nov 17, 2026Existing Node.js 20 actions can't be savedThey keep running as they are
Feb 1, 2027Design manager serverless functions stop runningDeveloper project functions (Node.js 24)
Jan 5, 2027Python 3.9 custom code is sunsetHubSpot recommends Python 3.14

Node.js 16 actions already have the same lock: they run, but you can't save changes until you switch them to a newer runtime. As of November 10, 2026, HubSpot hasn't announced a date when Node.js 20 actions will stop running.

HubSpot custom code actions Node.js 24 timeline card: no new Node.js 20 actions from November 3, Node.js 20 actions read-only from November 17, design manager serverless functions stop on February 1, 2027
Deadlines from HubSpot’s November 3, 2026 changelog

The risk on November 18 is not an outage. It's a workflow you can't fix. If a property name changes or an API call starts failing, a read-only Node.js 20 action can't be edited. You'd have to rebuild it on Node.js 24 under pressure.

The same changelog also covers design manager serverless functions (the /_hcms/api/ endpoints). You can't edit them after November 17 either, and they stop running on February 1, 2027. HubSpot says it can't migrate them automatically; they move to developer projects served from /hs/serverless/. That migration needs its own guide, so this post covers workflow custom code actions only.

Find every Node.js 20 custom code action

HubSpot doesn't give you a single list of runtimes, so you check each workflow. The official steps:

  1. Go to Automation > Workflows.
  2. Add an Action type filter and select Custom code.
  3. Hover over each workflow and click Edit workflow.
  4. Click each custom code action and read the Language dropdown. Anything on Node.js 16.x or Node.js 20.x needs an upgrade.

Before you change anything, copy each action's code out of HubSpot into a text file or a Git repository. Name the files after the workflow and action so you can match them later. You'll need this copy to compare Breeze's output and to roll back.

A simple folder layout works:

hubspot-custom-code-backup/
  lead-routing__assign-owner__node20.js
  lead-routing__assign-owner__node24.js
  deal-sync__post-to-erp__node20.js
  deal-sync__post-to-erp__node24.js
HubSpot custom code Node.js 24 audit card: filter workflows by Custom code action type, open each action, check the Language dropdown, and save the old code outside HubSpot
Four steps to list the actions you need to upgrade

Upgrade HubSpot custom code to Node.js 24

You have two ways to upgrade: let Breeze rewrite the code, or edit it yourself. The HubSpot CLI can't update custom code actions, so both happen in the workflow editor.

Option 1: Upgrade with Breeze

Click a Node.js 16 or 20 action. A warning appears under the Language dropdown with an Upgrade with Breeze button. Breeze then updates every custom code action in that workflow to Node.js 24. You can also open Collaborate with Assistant and ask Breeze to update the Node 16 or 20 actions.

HubSpot's own guide warns that Breeze can make mistakes. Before you save, check three things against your backup:

  • The logic is the same: same conditions, same API calls, same property names.
  • Every field under Data outputs is still returned.
  • Each API method exists in @hubspot/api-client 13.

Option 2: Upgrade manually

Open the action, set Language to Node.js 24.x, then apply the changes below. The biggest one is the handler signature. Node.js 24 doesn't support callback-style handlers.

A typical Node.js 20 action looks like this:

// Node.js 20 style (callback)
const hubspot = require('@hubspot/api-client');

exports.main = async (event, callback) => {
  const client = new hubspot.Client({ accessToken: process.env.PRIVATE_APP_TOKEN });
  const contact = await client.crm.contacts.basicApi.getById(
    event.object.objectId, ['email', 'lifecyclestage']
  );
  callback({
    outputFields: { email: contact.properties.email }
  });
};

The Node.js 24 version removes callback and returns the same object:

// Node.js 24 style (async + return)
const hubspot = require('@hubspot/api-client');

exports.main = async (event) => {
  const client = new hubspot.Client({ accessToken: process.env.PRIVATE_APP_TOKEN });
  const contact = await client.crm.contacts.basicApi.getById(
    event.object.objectId, ['email', 'lifecyclestage']
  );
  return {
    outputFields: { email: contact.properties.email }
  };
};

Three rules from HubSpot's guide:

  • exports.main must be async and must not take a callback parameter.
  • The returned object must still contain outputFields.
  • await everything before you return. Code still running after return isn't guaranteed to finish, so a fire-and-forget fetch() to a webhook can be lost.

PRIVATE_APP_TOKEN is just the name of a secret you added to the action; secrets are read with process.env.<SECRET_NAME> in both runtimes.

HubSpot custom code actions Node.js 24 handler change card: Node.js 20 callback with outputFields on the left, Node.js 24 async function returning outputFields on the right
The handler change every Node.js 20 action needs

Replace the request library

request was bundled with Node.js 20 actions but isn't available in Node.js 24. Use the built-in fetch() or the bundled axios. Here's a typical swap:

// Node.js 24: built-in fetch instead of request
exports.main = async (event) => {
  const res = await fetch('https://api.example.com/leads', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': `Bearer ${process.env.ERP_API_KEY}`
    },
    body: JSON.stringify({ id: event.object.objectId })
  });
  if (!res.ok) {
    throw new Error(`ERP returned ${res.status}`);
  }
  const data = await res.json();
  return { outputFields: { erp_id: String(data.id) } };
};

Note that fetch() doesn't throw on HTTP errors, so check res.ok yourself. axios does throw on 4xx and 5xx responses.

Check library versions

Node.js 24 actions ship fixed library versions. The ones most likely to break code:

LibraryNode.js 20Node.js 24What to check
@hubspot/api-client^11.1.013.4.0Renamed and removed APIs
request^2.88.2Not includedUse fetch or axios
googleapis^67.0.0171.4.0Method signatures
mongoose^6.8.09.2.2Connection and query API
redis^4.5.15.11.0Client API
axios^1.2.01.13.5Usually safe

aws-sdk 2.1693.0 is new in Node.js 24. lodash, async, bluebird, mysql and random-number-csprng stay on the same major version.

For @hubspot/api-client, the GitHub changelog lists these changes between 11 and 13 that can affect custom code:

VersionChange
12.0.0publicObjectApi renamed to mergeApi in companies, contacts, deals and tickets
12.0.0marketing.events.batchApi and searchApi removed
13.0.0crm.companies.mergeApi and crm.contacts.GDPRApi removed
13.0.0files.filesApi.archiveGDPR() renamed to _delete()
13.0.0events.send.customEventDataApi renamed to basicApi

Common calls like crm.contacts.basicApi.getById and crm.associations are not in this list, but search your backup for every client. call and check it against the changelog.

HubSpot custom code Node.js 24 library card: request removed, api-client 11 to 13, googleapis 67 to 171, mongoose 6 to 9, redis 4 to 5
Libraries that change major version in Node.js 24

Keep retries working

HubSpot retries an action after a 429 rate limit or a 5XX error from axios or @hubspot/api-client, for up to three days. That only happens if the error leaves your code. If you catch it, throw it again:

exports.main = async (event) => {
  try {
    // API calls here
    return { outputFields: { status: 'ok' } };
  } catch (err) {
    console.error(err.message);
    throw err; // lets HubSpot retry rate limit and 5XX errors
  }
};

The other limits stay the same: 20 seconds of run time, 128 MB of memory, and 1,000 characters for all secret values combined.

HubSpot custom code actions Node.js 24 upgrade flow: back up code, upgrade with Breeze or manually, test on a test record, then save or fix
Upgrade flow for each Node.js 20 custom code action
View PlantUML source
@startuml
start
:Copy code out of HubSpot;
if (Use Breeze?) then (yes)
  :Upgrade with Breeze;
  :Compare with backup;
else (no)
  :Set Language to Node.js 24.x;
  :async + return outputFields;
endif
:Test on a test record;
if (Status and outputs OK?) then (yes)
  :Save;
else (no)
  :Check logs and fix;
endif
stop
@enduml

Test and save each action

Testing runs only the custom code action, not the whole workflow, and it does change the selected record. Use a test contact or deal, not a live one.

  1. Click the action in the workflow editor.
  2. Expand Test action at the bottom.
  3. Pick your test record in the Object dropdown.
  4. Click Test and confirm.
  5. Check Status (success), Data outputs (every field has the expected value) and Logs (no missing modules or is not a function errors).
  6. Click Save only after the test passes.

If a later step in the workflow uses an output, open that step and confirm the output still appears in its dropdown.

HubSpot custom code Node.js 24 test checklist card: use a test record, check Status, Data outputs and Logs, then save, with rollback to Node.js 20 possible only until November 17
What to check before you click Save

Roll back before November 17 if you need to

Until November 17, 2026, you can still switch an action back to Node.js 20.x, paste your saved code, test and save. After that date, rollback is gone. Node.js 16 actions can't be rolled back at all because 16 is no longer selectable. If you need more time, roll back now. After November 17, your only choice is to fix the action on Node.js 24.

If an upgraded action fails

SymptomLikely causeFix
Cannot find module 'request'request not in Node.js 24Rewrite with fetch or axios
Outputs empty, status successStill calling callbackreturn { outputFields }
... is not a function on client.api-client 13 rename or removalCheck the changelog, use the new name
Data posted to an external API sometimes missingWork not awaited before returnawait every call
No retry after a 429Error caught and not thrownthrow err in catch
OUTPUT_VALUES_TOO_LARGEString output over 65,000 charactersTrim or split the output
HubSpot custom code actions Node.js 24 troubleshooting card: missing request module, empty outputs from callback, renamed api-client methods, and lost retries
Common Node.js 24 upgrade errors and their fixes

If you run other automation platforms, the same check-before-a-runtime-change approach applies. See our n8n Migration Report guide for the 3.0 upgrade. For Node.js projects you control yourself, the Node.js 26 LTS upgrade checklist covers what changes outside HubSpot's managed runtime.

FAQ

Will my Node.js 20 workflows stop on November 17? No. HubSpot says existing Node.js 20 custom code actions keep running. From November 17, 2026 you just can't save changes to them. As of November 10, 2026, no shutdown date has been announced.

Can I upgrade custom code actions with the HubSpot CLI? No. HubSpot's guide says the CLI can't update custom code actions. Use Breeze or edit them manually in the workflow editor.

Do I need to change how I read secrets? HubSpot's upgrade guide doesn't list a change. Secrets are still read with process.env.<SECRET_NAME>, and the combined 1,000-character limit still applies.

Is the Breeze upgrade safe to save without testing? HubSpot says Breeze can make mistakes. Compare its output with your backup, confirm every data output, and run Test action on a test record before saving.

Does this affect Python custom code? Not on November 17. Python 3.9 custom code is sunset on January 5, 2027, and HubSpot recommends moving to Python 3.14.

Once your Node.js 20 actions are on Node.js 24, keep the backup folder. It's your best reference the next time HubSpot changes a runtime. To keep watching Node.js security fixes, see what to expect from the Node.js security release on November 11.

References

Leave a Comment