Skip to content

Commit 51be0e4

Browse files
committed
seperate python and js PR
1 parent 7c1b46a commit 51be0e4

3 files changed

Lines changed: 20 additions & 21 deletions

File tree

lambda-durable-rest-api-sam-js/README.md

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Lambda Durable Function - REST API Call with Node.js
1+
# AWS Lambda durable function - REST API call with Node.js
22

3-
This pattern demonstrates a Lambda durable function that calls an external REST API using Node.js.
3+
This pattern demonstrates a AWS Lambda durable function that calls an external REST API using Node.js.
44

5-
Learn more about this pattern at Serverless Land Patterns: << Add the live URL here >>
5+
Learn more about this pattern at Serverless Land Patterns: https://serverlessland.com/patterns/lambda-durable-rest-api-sam-js
66

77
Important: this application uses various AWS services and there are costs associated with these services after the Free Tier usage - please see the [AWS Pricing page](https://aws.amazon.com/pricing/) for details. You are responsible for any AWS costs incurred. No warranty is implied in this example.
88

@@ -40,18 +40,7 @@ Important: this application uses various AWS services and there are costs associ
4040
4141
## How it works
4242
43-
This pattern demonstrates AWS Lambda Durable Execution for calling external REST APIs. It uses the AWS Durable Execution SDK to create a durable function that can:
44-
45-
**AWS Durable Execution Features:**
46-
- **Automatic State Management**: AWS manages execution state across invocations
47-
- **Durable Steps**: The `context.step()` method marks functions that can be retried automatically
48-
- **Durable Waits**: Use `context.wait()` to pause execution without consuming CPU or memory
49-
- **Built-in Retry Logic**: Failed steps are automatically retried by AWS
50-
- **Execution History**: AWS tracks the complete execution history and state
51-
52-
The function uses the `withDurableExecution` wrapper to mark the Lambda handler as a durable execution workflow. All steps defined with `context.step()` are automatically retryable.
53-
54-
AWS Lambda Durable Execution automatically handles failures, retries, and state persistence without requiring external services like DynamoDB or Step Functions.
43+
This pattern demonstrates AWS Lambda durable execution for calling external REST APIs. The function uses the `withDurableExecution` wrapper to mark the Lambda handler as a durable execution workflow. All steps defined with `context.step()` are automatically retryable.
5544
5645
**Note**: This pattern requires Node.js 24.x runtime which has native support for durable execution.
5746
@@ -108,4 +97,14 @@ The execution is durable - if the API call fails, AWS Lambda will automatically
10897
aws cloudformation list-stacks --query "StackSummaries[?contains(StackName,'<your-stack-name>')].StackStatus"
10998
```
11099

111-
----
100+
## Learn More
101+
102+
- [AWS Lambda durable functions Documentation](https://docs.aws.amazon.com/lambda/latest/dg/durable-functions.html)
103+
- [durable execution SDK (Python)](https://github.com/aws/aws-durable-execution-sdk-js)
104+
- [Callback Operations](https://docs.aws.amazon.com/lambda/latest/dg/durable-callback.html)
105+
---
106+
107+
Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
108+
109+
SPDX-License-Identifier: MIT-0
110+

lambda-durable-rest-api-sam-js/example-pattern.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
2-
"title": "Lambda Durable Function - REST API Call (Node.js)",
3-
"description": "A Lambda function that calls an external REST API using AWS Durable Execution SDK for automatic retries and state management.",
2+
"title": "AWS Lambda durable failures - REST API call (Node.js)",
3+
"description": "A Lambda function that calls an external REST API using AWS durable execution SDK for automatic retries and state management.",
44
"language": "Node.js",
55
"level": "200",
66
"framework": "SAM",
77
"introBox": {
88
"headline": "How it works",
99
"text": [
10-
"This pattern demonstrates AWS Lambda Durable Execution for calling external REST APIs.",
10+
"This pattern demonstrates AWS Lambda durable execution for calling external REST APIs.",
1111
"Uses the withDurableExecution wrapper to mark the Lambda handler as a durable workflow.",
1212
"Uses context.step() to make the REST API call automatically retryable.",
1313
"AWS automatically handles failures, retries, and state persistence without external services."
@@ -24,7 +24,7 @@
2424
"resources": {
2525
"bullets": [
2626
{
27-
"text": "AWS Lambda Durable Execution",
27+
"text": "AWS Lambda durable execution",
2828
"link": "https://docs.aws.amazon.com/lambda/latest/dg/durable-functions.html"
2929
},
3030
{

lambda-durable-rest-api-sam-js/src/app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55

66
/**
7-
* Lambda Durable Function - Calls REST API using AWS Durable Execution SDK
7+
* AWS Lambda durable function - Calls REST API using AWS durable execution SDK
88
*/
99
import { withDurableExecution } from '@aws/durable-execution-sdk-js';
1010

0 commit comments

Comments
 (0)