AWS / Lambda / Node.js / Serverless / Software Development
Node.js 22 end of support on AWS Lambda: the questions we're being asked
What does the Node.js 22 end of support email mean?
AWS Health has started sending out its "[Action Required] AWS Lambda end of support for Node.js 22" emails, and one arrived with us this week. If you've had one too, you're probably wondering how many of your functions are affected, what the three dates in the email mean, which version to move to and whether it's the quick runtime change it looks like on paper... And who's going to find the time to do it.
Nothing will break on 30 May 2027, the date in the email. The date we'd plan around is 31 August 2027, when Lambda stops accepting updates to Node.js 22 functions, and it's now the same date for Node.js 18 and Node.js 20 too. For most teams we'd recommend going straight to Node.js 26, once you've checked your handlers don't use callbacks.
The questions below are the ones we tend to get asked whenever one of these emails goes out.
Node.js 22 deprecation dates on Lambda
Will my Lambda functions stop working on 30 May 2027?
No - AWS are clear that end of support doesn't affect invocation, so a Node.js 22 function will carry on running after 30 May. What changes is that AWS stop patching the runtime, the function is no longer eligible for technical support, and Node.js 22 disappears from the runtime list in the Lambda console, although you can still deploy to it with CloudFormation, the CDK, SAM or the AWS CLI until the end of August. AWS do warn that a deprecated runtime can suffer degraded performance, or a problem such as an expired certificate that stops it working properly, so carrying on running isn't a guarantee.
That's usually why we find these deadlines slipping down the to-do list, as nothing visibly breaks on the day. The risk comes later, when a vulnerability turns up in Node.js 22 that nobody is going to patch, and an unsupported runtime is likely to come up in a Cyber Essentials or ISO 27001 assessment long before then.
What happens on each Node.js 22 deprecation date?
The email gives three dates, and there's a fourth that comes from the Node.js project rather than AWS:
- 30 April 2027 - Node.js 22 reaches end of life. The Node.js project stops releasing fixes for it, and Lambda stops patching Node.js itself.
- 30 May 2027 - Lambda deprecates the
nodejs22.xruntime. AWS stop patching the rest of the runtime, including its operating system, technical support ends and it's removed from the console. - 29 July 2027 - you can no longer create new functions on Node.js 22.
- 31 August 2027 - you can no longer update existing Node.js 22 functions. This is the one we'd plan around, because after it any deploy that leaves a function on Node.js 22 will be refused, including the urgent bug fix that needs to go out on a Friday afternoon.
AWS say Lambda won't start blocking creates or updates before the dates in its runtime support policy, so they can only move later, as the Node.js 18 and Node.js 20 dates both did. We wouldn't plan on it happening again.
We're still on Node.js 18 or 20. Are we worse off?
In one sense you're no worse off, because AWS have moved the block dates for Node.js 18 and Node.js 20 to 29 July and 31 August 2027, the same as Node.js 22, so the lockout lands on all three on the same day. But both are already deprecated, Node.js 18 since 1 September 2025 and Node.js 20 since 30 April 2026, so they've been running without security patches for some time and the jump to a supported version is a bigger one.
The bigger change, in our experience, is usually the AWS SDK. Lambda stopped including v2 of the AWS SDK for JavaScript in its runtimes from Node.js 18 onwards, so any Node.js 18 or 20 function still calling require('aws-sdk') is bundling its own copy, either directly or through a dependency, and v2 itself reached end of support on 8 September 2025. We've found moving those functions to v3 to be the most painful part of the upgrade, because it isn't a find-and-replace: each service client becomes its own package called with commands, .promise() goes away, errors are identified by name rather than code, S3 object bodies come back as streams, and the DynamoDB DocumentClient moves into a separate library with its own marshalling options to get right.
Node.js 18 functions also run on Amazon Linux 2, whereas Node.js 20 and later run on Amazon Linux 2023, so anything that bundles native binaries will usually need rebuilding as well. We'd tackle these functions first, rather than treating the shared deadline as extra time.
Why is Lambda ending support for Node.js 22?
Lambda follows the Node.js release schedule. The Node.js project puts out a new long-term support version every year and ends each one after around three years, and Lambda deprecates its matching runtime shortly afterwards - Node.js 22 reaches end of life on 30 April 2027, and Lambda follows a month later.
We've written one of these for Node.js 8, 10, 12 and 18 already, and we find the teams who treat the runtime upgrade as a yearly maintenance task, rather than something prompted by an email, tend to have a much easier time of it.
Upgrading Lambda from Node.js 22 to Node.js 26
Should we move to Node.js 24 or Node.js 26?
We'd go to Node.js 26. Lambda supports it until 30 April 2029, a year longer than Node.js 24, and the work involved is pretty similar either way, since the callback handler change below applies to both. Stopping at 24 means doing all of this again within eighteen months.
Node.js 26 started out on Lambda as a public preview, but it's now a fully supported runtime, and we've just moved a client's order integration straight from Node.js 22 to 26 without stopping at 24. The one reason we'd hold back is a dependency or Lambda layer that doesn't support 26 yet, so it's worth checking those before you start.
Is it just a case of changing the runtime setting?
On paper, yes. In practice we find it's rarely one setting, because whatever builds and tests your code needs to move with it. On that client integration the change touched five files: the runtime on each function in the CDK stack, the Node.js version in both CI jobs, @types/node and its lock file, and a new test. The CDK itself also needs to be recent enough to know about nodejs26.x, and any Lambda layers need checking, as a monitoring or tracing layer that hasn't caught up with the new runtime can break a function that's otherwise fine.
The new test checks that every function in both the dev and production templates is on nodejs26.x, so a function added later on an old runtime fails the build rather than turning up in an AWS Health email in a couple of years' time. It's a few lines of code, and it's the thing we'd most recommend adding whichever version you move to.
How much work it is depends more on the code than on how many functions you have. Where the handlers are already async and use v3 of the AWS SDK, as on that client integration, it's a small change we'd fit in alongside other work. Callback handlers, v2 SDK code and functions spread across several AWS accounts are what turn it into a project in its own right, so it's worth knowing which of those you have before you plan it.
Why do callback handlers fail on Node.js 24 and later?
Lambda only supports callback-style handlers up to Node.js 22. A handler that takes a third callback argument won't run on Node.js 24 or later - from the reports we've seen, invoking one fails with a Runtime.CallbackHandlerDeprecated error - and needs rewriting as an async function that returns its result:
// Node.js 22 and earlier
exports.handler = (event, context, callback) => {
doWork(event)
.then(result => callback(null, result))
.catch(callback);
};
// Node.js 24 and later
exports.handler = async (event) => {
return doWork(event);
};
We tend to find these in the oldest functions, written before Lambda supported async/await, and if one relies on context.callbackWaitsForEmptyEventLoop to carry on working after it has responded, that behaviour needs rethinking rather than just converting. The same goes for older middleware or wrapper libraries that call the callback on your behalf.
How do we find every function still on Node.js 22?
The AWS Health dashboard lists the affected functions, as does Trusted Advisor's deprecated runtimes check, and AWS Config advanced queries can search every region and account at once. Health and Config only look at each function's $LATEST version, though, so we'd also run this in every region you use, as it includes published versions:
aws lambda list-functions \
--region eu-west-2 \
--function-version ALL \
--query "Functions[?Runtime=='nodejs22.x'].FunctionArn" \
--output text
Swap in nodejs20.x and nodejs18.x while you're there. Functions deployed as container images are the gap in all of this: they have no runtime setting for the command to match, and AWS send no deprecation notice for them, so if you build on the AWS Node.js base images, check which version your Dockerfiles start from. We'd also expect some of what turns up to be dead, like the cron job in the old staging account nobody remembers setting up, and deleting those is quicker than upgrading them.
If you'd rather not do this yourselves, we've been upgrading Lambda functions through most of the Node.js versions AWS have retired, so get in touch and we'll take a look at what you're running.
Questions or thoughts? Email us at hello@sinovi.uk.


