Skip to content

Commit cd83615

Browse files
authored
Create ‎lambda-durable-hitl-python-sam.json
added ‎lambda-durable-hitl-python-sam.json
1 parent 0715a8b commit cd83615

1 file changed

Lines changed: 101 additions & 0 deletions

File tree

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
{
2+
"title": "Lambda durable functions with Human-in-the-Loop",
3+
"description": "Demonstrates Lambda durable functions with human approval workflow using Python 3.13, DynamoDB, and SNS",
4+
"language": "Python",
5+
"level": "300",
6+
"framework": "AWS SAM",
7+
"introBox": {
8+
"headline": "How it works",
9+
"text": [
10+
"This pattern demonstrates how to pause Lambda execution, wait for human approval, and resume using the Lambda durable functions SDK.",
11+
"The Workflow Lambda creates an approval request in DynamoDB and polls for decisions using durable waits (no compute charges during waits).",
12+
"An SNS notification is sent to approvers, who can submit their decision via the Approval API Lambda function.",
13+
"The Workflow Lambda detects the decision during polling and resumes execution with the approval result.",
14+
"The pattern includes timeout handling, status tracking, and a complete audit trail of all approval decisions."
15+
]
16+
},
17+
"gitHub": {
18+
"template": {
19+
"repoURL": "https://github.com/aws-samples/serverless-patterns/tree/main/lambda-durable-hitl-python-sam",
20+
"templateURL": "serverless-patterns/lambda-durable-hitl-python-sam",
21+
"projectFolder": "lambda-durable-hitl-python-sam",
22+
"templateFile": "template.yaml"
23+
}
24+
},
25+
"resources": {
26+
"bullets": [
27+
{
28+
"text": "Lambda Durable Functions Documentation",
29+
"link": "https://docs.aws.amazon.com/lambda/latest/dg/durable-functions.html"
30+
},
31+
{
32+
"text": "AWS SAM Documentation",
33+
"link": "https://docs.aws.amazon.com/serverless-application-model/"
34+
},
35+
{
36+
"text": "DynamoDB Best Practices",
37+
"link": "https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/best-practices.html"
38+
},
39+
{
40+
"text": "Amazon SNS Documentation",
41+
"link": "https://docs.aws.amazon.com/sns/"
42+
}
43+
]
44+
},
45+
"deploy": {
46+
"text": [
47+
"sam build",
48+
"sam deploy --guided"
49+
]
50+
},
51+
"testing": {
52+
"text": [
53+
"See the README in the GitHub repo for detailed testing instructions.",
54+
"Test the approval workflow using AWS CLI:",
55+
"1. Publish Lambda version: aws lambda publish-version --function-name <WorkflowFunction>",
56+
"2. Invoke workflow: aws lambda invoke --function-name <WorkflowFunction>:<version> --invocation-type Event --payload '{...}' response.json",
57+
"3. List approvals: aws dynamodb scan --table-name <ApprovalsTable>",
58+
"4. Submit decision: aws lambda invoke --function-name <ApprovalApiFunction> --payload '{\"action\":\"decide\",...}' response.json"
59+
]
60+
},
61+
"cleanup": {
62+
"text": [
63+
"Delete the stack: sam delete"
64+
]
65+
},
66+
"authors": [
67+
{
68+
"name": "Mian Tariq",
69+
"bio": "Cloud Solutions Architect",
70+
"linkedin": "mian-tariq"
71+
}
72+
],
73+
"patternArch": {
74+
"icon1": {
75+
"x": 20,
76+
"y": 50,
77+
"service": "lambda",
78+
"label": "AWS Lambda"
79+
},
80+
"icon2": {
81+
"x": 50,
82+
"y": 50,
83+
"service": "dynamodb",
84+
"label": "Amazon DynamoDB"
85+
},
86+
"icon3": {
87+
"x": 80,
88+
"y": 50,
89+
"service": "sns",
90+
"label": "Amazon SNS"
91+
},
92+
"line1": {
93+
"from": "icon1",
94+
"to": "icon2"
95+
},
96+
"line2": {
97+
"from": "icon2",
98+
"to": "icon3"
99+
}
100+
}
101+
}

0 commit comments

Comments
 (0)