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.
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
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?
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 @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.
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