Skip to content

Add endpointAdapter to Lambda adapter#1299

Open
jpwilliams wants to merge 4 commits intomainfrom
feat/lambda-endpoint-adapter
Open

Add endpointAdapter to Lambda adapter#1299
jpwilliams wants to merge 4 commits intomainfrom
feat/lambda-endpoint-adapter

Conversation

@jpwilliams
Copy link
Copy Markdown
Member

Summary

Add a Lambda Durable Endpoints adapter.

import { Inngest, step } from "inngest";
import { endpointAdapter } from "inngest/lambda";

const inngest = new Inngest({
  id: "my-app",
  endpointAdapter,
});

// Your durable endpoint Lambda handler
export const handler = inngest.endpoint(async (event, context) => {
  const result = await step.run("work", () => "done");

  return {
    statusCode: 200,
    body: JSON.stringify({ result }),
  };
});

Checklist

  • Added a docs PR that references this PR N/A post-merge
  • Added unit/integration tests
  • Added changesets if applicable

Related

jpwilliams and others added 2 commits February 9, 2026 19:28
Add a Durable Endpoints adapter for AWS Lambda, following the same
pattern as the Edge and Next.js adapters. Extracts a shared commHandler,
adds sync mode support, and includes a proxy handler for polling results.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 9, 2026 19:30
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 9, 2026

🦋 Changeset detected

Latest commit: 52b13b5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
inngest Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@jpwilliams jpwilliams added the prerelease/inngest Create snapshot releases for a PR for the "inngest" package. label Feb 9, 2026
@inngest-release-bot inngest-release-bot added the 📦 inngest Affects the `inngest` package label Feb 9, 2026
@inngest-release-bot
Copy link
Copy Markdown
Collaborator

A user has added the prerelease/inngest label, so this PR will be published to npm with the tag pr-1299. It will be updated with the latest changes as you push commits to this PR.

You can install this prerelease version with:

npm install inngest@pr-1299

The last release was built and published from 7482e01.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Durable Endpoints support to the AWS Lambda adapter by introducing an endpointAdapter (plus a proxy handler) so Lambda handlers can run step.run() safely and support async redirect + polling via endpointProxy().

Changes:

  • Refactors Lambda comm-handler creation to be shared between serve() and endpointAdapter.
  • Adds endpointAdapter and a durable endpoint proxy handler for Lambda/API Gateway v1/v2 events.
  • Adds a changeset and extends Lambda tests to cover the endpoint adapter proxy flow.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
packages/inngest/src/lambda.ts Adds endpointAdapter, durable proxy handler, and shared comm-handler factory for serve + sync endpoints.
packages/inngest/src/lambda.test.ts Adds endpoint adapter tests (proxy invocation), but currently references a missing helper.
.changeset/lambda-endpoint-adapter.md Declares a minor release for adding Lambda endpointAdapter.
Comments suppressed due to low confidence (1)

packages/inngest/src/lambda.ts:94

  • event.headers can be null for API Gateway v1 events (per aws-lambda types). Calling Object.entries(event.headers) will throw at runtime in that case. Default to an empty object before iterating/normalizing headers.
      // Create a map of headers
      const headersMap = new Map<string, string | undefined>([
        ...Object.entries(event.headers).map(
          ([key, value]) =>
            [key.toLowerCase().trim(), value] as [string, string | undefined],

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +5 to 6
import { testEndpointAdapter } from "./test/testEndpointAdapter.ts";

Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

./test/testEndpointAdapter.ts is imported but no such file exists under packages/inngest/src/test (and test/helpers.ts doesn’t export it either). This will break TypeScript/vitest compilation. Add the missing helper file, or change the import to the correct existing helper/export.

Suggested change
import { testEndpointAdapter } from "./test/testEndpointAdapter.ts";
function testEndpointAdapter(
name: string,
_endpointAdapter: unknown,
_options: {
invokeProxy: (
client: any,
args: { url: string; method: string },
) => Promise<{
status: number;
body: string;
headers: Record<string, string>;
}>;
},
): void {
// Placeholder implementation to satisfy TypeScript/vitest compilation
// when the shared test helper module is not available in this package.
// The parameters are intentionally marked as used to avoid lint errors.
void name;
}

Copilot uses AI. Check for mistakes.
Let the real middleware pipeline run instead of mocking
decryptProxyResult. Only inngestApi.getRunOutput (the external HTTP
boundary) remains mocked. The middleware error test now uses a real
InngestMiddleware that throws during transformInput.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📦 inngest Affects the `inngest` package prerelease/inngest Create snapshot releases for a PR for the "inngest" package.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants