Callback functionality being sun set with new versions of Node

Hi folks,

I’m getting warnings when running my workflow: "AWS Lambda plans to remove support for callback-based function handlers starting with Node.js 24. You will need to update this function to use an async handler to use Node.js 24 or later. For more information and to provide feedback on this change, see [FEEDBACK REQUEST] Should AWS Lambda deprecate callback-style function handlers for Node.js 24 and later? · Issue #137 · aws/aws-lambda-nodejs-runtime-interface-client · GitHub. To disable this warning, set the AWS_LAMBDA_NODEJS_DISABLE_CALLBACK_WARNING environment variable.
".
I can also see this is mentioned in the change logs: https://developers.hubspot.com/changelog/deprecation-of-node-v18-in-all-serverless-functions-and-cli….
However, I checked the documentation and callbacks are still the suggested implementation: https://developers.hubspot.com/docs/reference/api/automation/custom-code-actions#get-starte
From my understanding, if I want to make any changes to my production workflow, I will need to update my Node version, and in doing so, need to remove all callback functionality.
Updating my code to the following results in the warning “Not defined in code” for all my output fields, when I run the workflow in test mode. The workflow works perfectly if I restore the callback functionality.

```
exports.main = async (event) => {
let errorOutput = ‘’;
let isError = false;
etc…
return {
outputFields: {
isError: isError,
errorOutput: errorOutput
}
};

```
Can you please share the shape for how to return the output fields to accommodate this change?

Thanks.

Hi @Dev7

“Node.js 18 is no longer a supported runtime for editing custom code workflow actions; custom code should use a currently supported Node.js runtime.”

So, you can use try and catch before the return, and it should return as per your requirements. for more details,

Here is the documentation: Custom code actions - HubSpot docs

If the problem persists, you can contact HubSpot Support, and they can guide you best here."

I hope this will help you out. Please mark it as Solution Accepted and upvote to help another Community member.

Thanks!

Moderator Note: this post was reviewed for relevancy and optimized for clarity on September 30, 2026. Thank you for your contributions to the HubSpot Community!

Hey @GRajput,
I appreciate you replying and helping out.
I’m not quite sure why it’s already showing as the accepted solution because, sadly, I am still having issues. Basically, I followed the guidelines you shared but I still get “Not defined in code” for all my data outputs using try/catch blocks.
Can you please share a simple working example of a workflow that defines an output field and successfully recevies that output field value after running the workflow?
I created a new workflow to test this, and it didn’t work.

```

exports.main = async () => {

let email = “no email”;

try {

email = “test email”;

console.log(`email is ${email}`);

return {

“outputFields”: {

“email”: email

}

}

} catch (err) {

console.error(err);

return {

“outputFields”: {

“email”: email

}

};

}

};

```
You can see the data output is set correctly.

Am I missing something super simple with how to define or return the values or is this a bug?
Thanks!

Hi @Dev7

You are doing everything correctly here; you have added email in the output as well. Now there are two options available either you can use the value here in same action i.e. in your custom code or you can use the email value in the next action. To see the value, you can console.log the email to check whether the value is correct or not. If you want to use this value in the next option, you can refer to the SS

I hope this will help you out. Please mark it as Solution Accepted and upvote to help another Community member.

Thanks!

Hey @GRajput,
The issue is that when I run the workflow in test mode it says the variable isn’t defined in my code and thus the value isn’t returned.
So I don’t believe the output value will be able to be referenced in following steps of the workflow. This will break my production workflow.
Since you believe the code is also correct, is this a Hubspot bug?

If you run the same code I shared above in a custom worklfow step, do you see the same issue?
Thanks

Hi @Dev7

replace this part of your code 
return {
 "outputFields": {
 "email": email
 }
 };
with this
 callback({
 outputFields: {
 "email": email
 }
 });

Hopefully this will work for you.

Hi @GRajput,
Sadly, I think that solution includes the callback functionality which will be sunset with Node.js 24.
My existing Production code is basically the same…

```
return callback({
outputFields: {

…etc
```

Perhaps it’s time to write a bug report.
Appreciate you working on this issue with me.

Hi Grajput, I experience the same issue here. Have you found a solution?

Hi @MWWesterterp and @Dev7, welcome to the HubSpot Community!
Thanks for reaching out and I am sorry to hear your experience about this.
If you have a paid subscription, I would recommend connecting with HubSpot Technical Support, and sharing this Community post, as Support is included in your subscription and they will be able to provide real-time assistance for this matter, including hopping on a screenshare if necessary.
If you don’t have access to Support, I’d suggest submitting the form on the HubSpot Developer Feedback form so that the right Team can take a look at it.
Thanks and have a great day!
Bérangère

Hi @BérangèreL ,
Thanks for the note.
I’ve reached out to Customer Support and they have the Devs looking into it.
I’ll update this thread if I get an update from the Devs.
But in the meantime, they did confirm we can keep using callbacks after updating the custome code steps to Node.js 20, fortunately.
Cheers.

HI @Dev7 and @BérangèreL

I have also brought this to the attention of the dev-team of HubSpot and got the reassurance that it will continue working, even with the warning.

It actually does. Even with the example code that HubSpot provides, it gives the warning. It doesn’t feel good to deliver code that gives a warning to my client. Hopefully it gets solved soon.

Thanks so much @MWWesterterp and @Dev7 for sharing the final outcome, this will be helpful to other Community Members having the same question!
Have a lovely day!
Bérangère