Add Lambda Durable Functions with Human-in-the-Loop pattern#2954
Add Lambda Durable Functions with Human-in-the-Loop pattern#29544D54 wants to merge 6 commits intoaws-samples:mainfrom
Conversation
This pattern demonstrates AWS Lambda Durable Functions with human approval workflow using Python 3.13, DynamoDB, and SNS. Key features include: - Durable execution with checkpointed steps - Polling-based approval workflow (no compute charges during waits) - Automatic timeout handling - Complete audit trail in DynamoDB - SNS notifications for approvers - AWS CLI testing examples The pattern showcases how Lambda functions can pause execution, wait for human decisions, and resume based on approval/rejection.
This pattern demonstrates AWS Lambda Durable Functions with human approval workflow using Python 3.13, DynamoDB, and SNS. Key features include: - Durable execution with checkpointed steps - Polling-based approval workflow (no compute charges during waits) - Automatic timeout handling - Complete audit trail in DynamoDB - SNS notifications for approvers - AWS CLI testing examples The pattern showcases how Lambda functions can pause execution, wait for human decisions, and resume based on approval/rejection.
This pattern demonstrates AWS Lambda Durable Functions with human approval workflow using Python 3.13, DynamoDB, and SNS. Author: Mian Tariq
|
same as other PR, can send the callback token directly back to the lambda service with these APIs i think? send_durable_execution_callback_failure |
|
And please make sure to use the correct capitalization: It's Lambda durable functions not Lambda Durable Functions |
- Changed from polling DynamoDB to callback pattern using Lambda APIs - Approval API now calls send_durable_execution_callback_success/failure APIs - Workflow Lambda pauses at callback.result() and resumes when API is called - Updated capitalization to 'Lambda durable functions' throughout all files - Tested end-to-end: workflow pauses, approval triggers callback, workflow resumes
Thanks! |
| - Effect: Allow | ||
| Action: | ||
| - lambda:CheckpointDurableExecution | ||
| - lambda:GetDurableExecutionState | ||
| Resource: '*' |
There was a problem hiding this comment.
Both Lambda execution roles contain wildcard (*) resource permissions for durable execution operations and callback APIs, which violates the principle of least privilege.
| - Effect: Allow | |
| Action: | |
| - lambda:CheckpointDurableExecution | |
| - lambda:GetDurableExecutionState | |
| Resource: '*' | |
| - Effect: Allow | |
| Action: | |
| - lambda:CheckpointDurableExecution | |
| - lambda:GetDurableExecutionState | |
| Resource: !GetAtt WorkflowFunction.Arn |
| - Effect: Allow | ||
| Action: | ||
| - lambda:SendDurableExecutionCallbackSuccess | ||
| - lambda:SendDurableExecutionCallbackFailure | ||
| Resource: '*' |
There was a problem hiding this comment.
Both Lambda execution roles contain wildcard (*) resource permissions for durable execution operations and callback APIs, which violates the principle of least privilege.
| - Effect: Allow | |
| Action: | |
| - lambda:SendDurableExecutionCallbackSuccess | |
| - lambda:SendDurableExecutionCallbackFailure | |
| Resource: '*' | |
| - Effect: Allow | |
| Action: | |
| - lambda:SendDurableExecutionCallbackSuccess | |
| - lambda:SendDurableExecutionCallbackFailure | |
| Resource: !GetAtt WorkflowFunction.Arn |
There was a problem hiding this comment.
Please follow the pattern structure: https://github.com/aws-samples/serverless-patterns/tree/main/_pattern-model
Especially form/format and order of the Readme.md.
Besides the above:
-
Architecture, Components, Execution Flow -> one Architecture diagram + one small explanation of the flow (see other references as example)
-
Project structure -> can be removed
-
Folder purposes -> can be removed
-
Key Files -> can be removed
-
Important Notes -> can be removed (if you wish, add it very briefly to the pattern description, see template Readme.md)
-
Running Unit Tests / property based tests -> can be removed (unit tests itself are not mandatory for serverless patterns)
-
Use Cases -> can be removed (if you wish, add it very briefly to the pattern description, see template Readme.md OR reference the official docs examples page)
-
Security Considerations -> can be removed
-
Cost Considerations -> see template Readme.md
-
Limitations -> can be removed OR briefly add to pattern description
-
Additional resources -> can be removed. Useful links can be added to the description and text
-
License -> please see template Readme.me
This pattern demonstrates AWS Lambda Durable Functions with human approval workflow using Python 3.13, DynamoDB, and SNS. Key features include:
The pattern showcases how Lambda functions can pause execution, wait for human decisions, and resume based on approval/rejection.
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.