|
1 | | -# Lambda Durable Function - REST API Call with Node.js |
| 1 | +# AWS Lambda durable function - REST API call with Node.js |
2 | 2 |
|
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. |
4 | 4 |
|
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 |
6 | 6 |
|
7 | 7 | 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. |
8 | 8 |
|
@@ -40,18 +40,7 @@ Important: this application uses various AWS services and there are costs associ |
40 | 40 |
|
41 | 41 | ## How it works |
42 | 42 |
|
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. |
55 | 44 |
|
56 | 45 | **Note**: This pattern requires Node.js 24.x runtime which has native support for durable execution. |
57 | 46 |
|
@@ -108,4 +97,14 @@ The execution is durable - if the API call fails, AWS Lambda will automatically |
108 | 97 | aws cloudformation list-stacks --query "StackSummaries[?contains(StackName,'<your-stack-name>')].StackStatus" |
109 | 98 | ``` |
110 | 99 |
|
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 | + |
0 commit comments