Skip to content

[FEEDBACK REQUEST] Should AWS Lambda deprecate callback-style function handlers for Node.js 24 and later? #137

@maxday

Description

@maxday

UPDATE
Node.js 24 support in Lambda is now Generally Available.
https://aws.amazon.com/about-aws/whats-new/2025/11/aws-lambda-nodejs-24/
https://aws.amazon.com/blogs/compute/node-js-24-runtime-now-available-in-aws-lambda/
https://www.amazonaws.cn/en/new/2025/amazon-lambda-adds-support-for-node-js-24-in-amazon-web-services-china-regions/

We have made the change discussed in this proposal. Callback-based function handlers are not supported in the Lambda Node.js 24 runtime. Support for callback-based function handlers in Node.js 22 and earlier runtimes is not affected.

To clarify: the non-async function handler signature that takes event and (optionally) context parameters, without a callback, is not deprecated:

export const handler = (event) => { };

export const handler = (event, context) => { };

If your function is using the handler signature that includes a callback parameter, but doesn't actually use the callback, then you can switch to one of these function signatures without making other code changes.

For more details, see Valid handler patterns for Node.js functions in our documentation.

We are working through the necessary changes to the examples in the API Gateway and Lambda@Edge documentation.

Thank you all for the feedback and discussion.

👍 👎 The AWS Lambda Runtimes team would love your thoughts! Please upvote/downvote to indicate if you support this change.

Currently, AWS Lambda supports both callback-style and async/await function handler signatures. Considering Node.js has fully embraced async/await, we are considering removing support for callback style function handlers starting with our Node.js 24 release later this year. With this change, customers currently using the callback signature will need to update their code to use the async/await signature when migrating their functions to Node.js 24 or later runtimes.

This proposal applies to Node.js 24 and later runtimes only. We will continue to support both callback and async/await function handler signatures in our existing Node.js 18, Node.js 20, and Node.js 22 runtimes.

Current callback-style: (to be removed)

exports.handler = (event, context, callback) => {
  // ... handler logic
  callback(null, { statusCode: 200, body: 'Success!' });
};

Async/await style: (to be kept as-is)

export const handler = async (event, context) => {
  // ... handler logic
  return { statusCode: 200, body: 'Success!' };
};

Should we make this change? Please vote!
👍 : Yes, in favor of deprecating the callback handler signature.
👎 : No, keep the callback handler signature.

Please also share any feedback in the comments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions