Skip to content

AWS Lambda: Add support for Lambda Durable Functions#137

Open
c10h22 wants to merge 6 commits intooss-serverless:mainfrom
c10h22:feature/lambda_durable_function
Open

AWS Lambda: Add support for Lambda Durable Functions#137
c10h22 wants to merge 6 commits intooss-serverless:mainfrom
c10h22:feature/lambda_durable_function

Conversation

@c10h22
Copy link
Copy Markdown

@c10h22 c10h22 commented Jan 22, 2026

On December 2nd, 2025, AWS introduced Durable Lambda Executions, enabling long-running, fault-tolerant workflows without custom chaining, self-invocation, or continuation persistence (announcement).

This PR adds support for Lambda Durable Functions :

Features:

  • durableConfig property with executionTimeout (1-31536000 seconds) and retentionPeriodInDays (1-90 days)
  • Auto-enables versioning when durableConfig is present (required for qualified ARNs)
  • Automatic IAM managed policy attachment (AWSLambdaBasicDurableExecutionRolePolicy)
  • --durable-execution-name option for idempotent invocations
  • Supported Runtimes: Node.js 22+, Python 3.13+

Usage:

functions:
  orderProcessor:
    handler: handler.processOrder
    runtime: nodejs22.x
    durableConfig:
      executionTimeout: 86400        # 24 hours
      retentionPeriodInDays: 14

c10h22 and others added 5 commits January 22, 2026 19:23
Add Lambda Durable Functions support with:
- durableConfig property in serverless.yml (executionTimeout, retentionPeriodInDays)
- Auto-enable versioning when durableConfig is present (required for qualified ARNs)
- CloudFormation DurableConfig property generation
- Deploy function support for durable configuration

Durable functions enable long-running workflows that can span multiple
Lambda invocations with automatic state management and checkpointing.
Automatically attach AWSLambdaBasicDurableExecutionRolePolicy managed
policy to Lambda execution roles when durableConfig is present.

This grants the necessary permissions for durable function operations
including checkpoint management and execution state access.
Add --durable-execution-name option to serverless invoke command:
- Enables idempotent invocations with unique execution names
- Supports both synchronous and asynchronous durable invocations
- Execution names must be 1-64 chars (alphanumeric, hyphens, underscores)
- Repeated invocations with same name return cached results

Usage: serverless invoke -f myFunc --durable-execution-name order-12345
Document durable functions feature including:
- Configuration properties (executionTimeout, retentionPeriodInDays)
- Supported runtimes (Node.js 22+, Python 3.13+)
- IAM permissions and managed policy
- Invoke command --durable-execution-name option
- Usage examples and limitations
@mnapoli
Copy link
Copy Markdown
Contributor

mnapoli commented Jan 22, 2026

This looks very clean, I added a minor comment but honestly the rest looks good to me 👍

Move durable execution example to a more appropriate location in the
invoke.md documentation and update example to include contextPath parameter.
@c10h22
Copy link
Copy Markdown
Author

c10h22 commented Jan 22, 2026

@mnapoli moved that section below local invocation examples and used similar arguments for clarity

This example invokes a durable function with a unique execution name. If you invoke the same function with the same execution name again, Lambda returns the cached result from the previous execution instead of re-executing the function. This enables idempotent invocations for reliable workflow orchestration.

**Note:** Durable execution names must be 1-64 characters and contain only alphanumeric characters, hyphens, or underscores. See the [Functions guide](../guides/functions.md#aws-lambda-durable-functions) for more information on configuring durable functions.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

😅 sorry that's still not good, now the new section is right in the middle of the "invoke locally" documentation:

Image

Can you move it up after the #### Example data.json`` section and before the documentation about local invokes?

@zirkelc
Copy link
Copy Markdown
Contributor

zirkelc commented Mar 20, 2026

Is there anything blocking the merge?

@mnapoli
Copy link
Copy Markdown
Contributor

mnapoli commented Mar 25, 2026

@zirkelc yes my comment above

@zirkelc
Copy link
Copy Markdown
Contributor

zirkelc commented Mar 26, 2026

@c10h22 will you make the requested changes? I'd like to help out if you're busy with other things

@c10h22
Copy link
Copy Markdown
Author

c10h22 commented Mar 26, 2026

@zirkelc if you can just review and reorganise the documentation update 🙏🏻🙏🏻🙏🏻. Other than that everything should be okay we are using our branch in production without any notable issue.

Unrelated issue that we need to fix later is when we attach an eventbridge trigger to a Durable Function we have to patch the target Arn to use the fully qualified Durable Function version when function versioning is off. For now we are using a plugin workaround but it's worth including it directly in osls

@zirkelc
Copy link
Copy Markdown
Contributor

zirkelc commented Mar 26, 2026

@c10h22 since I'm not an official maintainer, I can't push directly to your branch. I opened a PR against your branch, once you merge it the fix should be available in this PR as well.

c10h22#1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants