Conversation
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>
🦋 Changeset detectedLatest commit: 52b13b5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
A user has added the prerelease/inngest label, so this PR will be published to npm with the tag You can install this prerelease version with: npm install inngest@pr-1299The last release was built and published from 7482e01. |
There was a problem hiding this comment.
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()andendpointAdapter. - Adds
endpointAdapterand 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.headerscan benullfor API Gateway v1 events (peraws-lambdatypes). CallingObject.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.
| import { testEndpointAdapter } from "./test/testEndpointAdapter.ts"; | ||
|
|
There was a problem hiding this comment.
./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.
| 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; | |
| } |
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>
Summary
Add a Lambda Durable Endpoints adapter.
Checklist
Added a docs PR that references this PRN/A post-mergeRelated
endpointAdapterto Express adapter #1293 (Express adapter)endpointAdapterto Node.js adapter #1294 (Node.js adapter)