[{"data":1,"prerenderedAt":78},["ShallowReactive",2],{"pattern-lambda-durable-hitl-python-sam":3},{"id":4,"title":5,"architectureURL":6,"cleanup":7,"contributors":10,"deploy":12,"description":16,"extension":17,"framework":18,"gitHub":19,"highlight":6,"introBox":25,"language":33,"level":34,"meta":35,"patternArch":36,"resources":54,"s3URL":6,"services":6,"stem":68,"testing":69,"videoId":6,"__hash__":77},"patterns\u002Fpatterns\u002Flambda-durable-hitl-python-sam.json","AWS Lambda durable functions with human-in-the-Loop",null,{"text":8},[9],"Delete the stack: sam delete",[11],"content\u002Fcontributors\u002Fmian-tariq.json",{"text":13},[14,15],"sam build","sam deploy --guided","Demonstrates Lambda durable functions with human approval workflow using Python, DynamoDB, and SNS","json","AWS SAM",{"template":20},{"repoURL":21,"templateURL":22,"projectFolder":23,"templateFile":24},"https:\u002F\u002Fgithub.com\u002Faws-samples\u002Fserverless-patterns\u002Ftree\u002Fmain\u002Flambda-durable-hitl-python-sam","serverless-patterns\u002Flambda-durable-hitl-python-sam","lambda-durable-hitl-python-sam","template.yaml",{"headline":26,"text":27},"How it works",[28,29,30,31,32],"This pattern demonstrates how to pause Lambda execution, wait for human approval, and resume using the Lambda durable functions SDK.","The Workflow Lambda creates an approval request in DynamoDB and polls for decisions using durable waits (no compute charges during waits).","An SNS notification is sent to approvers, who can submit their decision via the Approval API Lambda function.","The Workflow Lambda detects the decision during polling and resumes execution with the approval result.","The pattern includes timeout handling, status tracking, and a complete audit trail of all approval decisions.","Python","300",{},{"icon1":37,"icon2":42,"icon3":45,"line1":49,"line2":52},{"x":38,"y":39,"service":40,"label":41},20,50,"lambda","AWS Lambda",{"x":39,"y":39,"service":43,"label":44},"dynamodb","Amazon DynamoDB",{"x":46,"y":39,"service":47,"label":48},80,"sns","Amazon SNS",{"from":50,"to":51},"icon1","icon2",{"from":51,"to":53},"icon3",{"bullets":55},[56,59,62,65],{"text":57,"link":58},"Lambda Durable Functions Documentation","https:\u002F\u002Fdocs.aws.amazon.com\u002Flambda\u002Flatest\u002Fdg\u002Fdurable-functions.html",{"text":60,"link":61},"AWS SAM Documentation","https:\u002F\u002Fdocs.aws.amazon.com\u002Fserverless-application-model\u002F",{"text":63,"link":64},"DynamoDB Best Practices","https:\u002F\u002Fdocs.aws.amazon.com\u002Famazondynamodb\u002Flatest\u002Fdeveloperguide\u002Fbest-practices.html",{"text":66,"link":67},"Amazon SNS Documentation","https:\u002F\u002Fdocs.aws.amazon.com\u002Fsns\u002F","patterns\u002Flambda-durable-hitl-python-sam",{"text":70},[71,72,73,74,75,76],"See the README in the GitHub repo for detailed testing instructions.","Test the approval workflow using AWS CLI:","1. Publish Lambda version: aws lambda publish-version --function-name \u003CWorkflowFunction>","2. Invoke workflow: aws lambda invoke --function-name \u003CWorkflowFunction>:\u003Cversion> --invocation-type Event --payload '{...}' response.json","3. List approvals: aws dynamodb scan --table-name \u003CApprovalsTable>","4. Submit decision: aws lambda invoke --function-name \u003CApprovalApiFunction> --payload '{\"action\":\"decide\",...}' response.json","F-VlkqTOJfe1054lGxK1jImfzaX-3Uq0eiQtAQWnOHY",1778846886004]