-
Notifications
You must be signed in to change notification settings - Fork 1k
New Serverless Pattern - Add Lambda Durable Functions - Human Approval Pattern #2874
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
New Serverless Pattern - Add Lambda Durable Functions - Human Approval Pattern #2874
Conversation
bfreiberg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please double check the correct feature name
| @@ -0,0 +1,267 @@ | |||
| # Human-in-the-Loop Approval Workflow with Lambda Durable Functions | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # Human-in-the-Loop Approval Workflow with Lambda Durable Functions | |
| # Human-in-the-Loop Approval Workflow with AWS Lambda durable functions |
| @@ -0,0 +1,267 @@ | |||
| # Human-in-the-Loop Approval Workflow with Lambda Durable Functions | |||
|
|
|||
| This pattern demonstrates a human-in-the-loop approval workflow using AWS Lambda Durable Functions. The workflow pauses execution for up to 24 hours while waiting for human approval via email, automatically handling timeouts and resuming when decisions are received. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| This pattern demonstrates a human-in-the-loop approval workflow using AWS Lambda Durable Functions. The workflow pauses execution for up to 24 hours while waiting for human approval via email, automatically handling timeouts and resuming when decisions are received. | |
| This pattern demonstrates a human-in-the-loop approval workflow using AWS Lambda durable functions. The workflow pauses execution for up to 24 hours while waiting for human approval via email, automatically handling timeouts and resuming when decisions are received. |
|
|
||
| This pattern demonstrates a human-in-the-loop approval workflow using AWS Lambda Durable Functions. The workflow pauses execution for up to 24 hours while waiting for human approval via email, automatically handling timeouts and resuming when decisions are received. | ||
|
|
||
| **Important:** Lambda Durable Functions are currently available in the **us-east-2 (Ohio)** region only. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will change in the near future, reword to something like "check regional availability". Also please note the name is Lambda durable functions (lowercase)
|
|
||
|  | ||
|
|
||
| The pattern uses Lambda Durable Functions to implement a cost-effective approval workflow that can wait up to 24 hours without incurring compute charges during the wait period. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| The pattern uses Lambda Durable Functions to implement a cost-effective approval workflow that can wait up to 24 hours without incurring compute charges during the wait period. | |
| The pattern uses Lambda durable functions to implement a cost-effective approval workflow that can wait up to 24 hours without incurring compute charges during the wait period. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please correct the name throughout
|
|
||
| ### Workflow Steps | ||
|
|
||
| 1. **User submits approval request** via API Gateway |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 1. **User submits approval request** via API Gateway | |
| 1. **User submits approval request** via Amazon API Gateway |
| --follow | ||
| ``` | ||
|
|
||
| ### DynamoDB Table |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this necessary?
| @@ -0,0 +1,62 @@ | |||
| { | |||
| "title": "Human-in-the-Loop Approval Workflow with Lambda Durable Functions", | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| "title": "Human-in-the-Loop Approval Workflow with Lambda Durable Functions", | |
| "title": "Human-in-the-Loop Approval Workflow with Lambda durable functions", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correct additional mentions below
| "name": "Abhishek Agawane", | ||
| "image": "https://drive.google.com/file/d/1E-5koDaKEaMUtOctX32I9TLwfh3kgpAq/view?usp=drivesdk", | ||
| "bio": "Abhishek Agawane is a Security Consultant at Amazon Web Services with more than 8 years of industry experience. He helps organizations architect resilient, secure, and efficient cloud environments, guiding them through complex challenges and large-scale infrastructure transformations. He has helped numerous organizations enhance their cloud operations through targeted optimizations, robust architectures, and best-practice implementations.", | ||
| "linkedin": "https://www.linkedin.com/in/agawabhi/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| "linkedin": "https://www.linkedin.com/in/agawabhi/" | |
| "linkedin": "agawabhi" |
|
|
||
| ### Click Approve or Reject | ||
|
|
||
| Click one of the links in the email. You'll see a confirmation page with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reword this to full sentences instead of a bullet pointed list
| ```yaml | ||
| DurableConfig: | ||
| ExecutionTimeout: 86400 # 24 hours in seconds | ||
| ``` | ||
|
|
||
| And in `src/lambda_function.py`: | ||
|
|
||
| ```python | ||
| config=CallbackConfig(timeout=Duration.from_hours(24)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a short explanation why it needs to be changed in two places
Issue #, if available:
#2875
Description of changes:
This PR adds a new serverless pattern: Lambda Durable Functions - Human-in-the-Loop Approval Pattern
This pattern demonstrates a cost-effective human approval workflow using AWS Lambda Durable Functions. The workflow pauses execution for up to 24 hours while waiting for human approval via email, without incurring compute charges during the wait period.
Testing:
Pattern has been fully tested and deployed in us-east-2 region with successful validation of:
send_durable_execution_callback_successAPIBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.