[{"data":1,"prerenderedAt":68},["ShallowReactive",2],{"pattern-lambda-sfn":3},{"id":4,"title":5,"architectureURL":6,"cleanup":7,"contributors":12,"deploy":14,"description":17,"extension":18,"framework":19,"gitHub":20,"highlight":6,"introBox":30,"language":35,"level":36,"meta":37,"patternArch":38,"resources":51,"s3URL":6,"services":60,"stem":61,"testing":62,"videoId":34,"__hash__":67},"patterns\u002Fpatterns\u002Flambda-sfn.json","AWS Lambda to AWS Step Functions",null,{"headline":8,"text":9},"Cleanup",[10,11],"1. Delete the stack: \u003Ccode>sam delete --stack-name STACK_NAME\u003C\u002Fcode>.","2. Confirm the stack has been deleted: \u003Ccode>aws cloudformation list-stacks --query \"StackSummaries[?contains(StackName,'STACK_NAME')].StackStatus\"\u003C\u002Fcode>",[13],"content\u002Fcontributors\u002Fbenjamin-smith.json",{"text":15},[16],"sam deploy --guided","Invoke an AWS Step Functions workflow from AWS Lambda, with logging enabled","json","AWS SAM",{"template":21,"payloads":26},{"projectFolder":22,"repoURL":23,"templateURL":24,"templateFile":25},"lambda-sfn","https:\u002F\u002Fgithub.com\u002Faws-samples\u002Fserverless-patterns\u002Ftree\u002Fmain\u002Flambda-sfn","serverless-patterns\u002Flambda-sfn","template.yaml",[27],{"headline":28,"payloadURL":29},"Sample Lambda payload","lambda-sfn\u002Fevents\u002FinputFile.txt",{"headline":31,"text":32,"test":34},"How it works",[33],"The SAM template deploys a Lambda function, a Step Functions Express workflow, a Log group and the IAM resources required to run the application. A Lambda function uses the AWS SDK to asyncronously invoke the Express workflow, passing the event body as a string. The Express Workflow results are logged in Amazon CloudWatch Logs. The Lambda function returns the Express Workflow execution ARN and startDate.","","Node.js","300",{},{"icon1":39,"icon2":44,"line1":48},{"x":40,"y":41,"service":42,"label":43},20,50,"lambda","AWS Lambda",{"x":45,"y":41,"service":46,"label":47},80,"sfn","Step Functions",{"from":49,"to":50,"label":34},"icon1","icon2",{"headline":52,"bullets":53},"Additional resources",[54,57],{"text":55,"link":56},"Tutorial: Using AWS Lambda with Amazon S3","https:\u002F\u002Fdocs.aws.amazon.com\u002Flambda\u002Flatest\u002Fdg\u002Fwith-s3-example.html",{"text":58,"link":59},"Blog Series: Building scalable serverless applications with Amazon S3 and AWS Lambda.","https:\u002F\u002Faws.amazon.com\u002Fblogs\u002Fcompute\u002Fbuilding-scalable-serverless-applications-with-amazon-s3-and-aws-lambda\u002F",{"from":42,"to":46},"patterns\u002Flambda-sfn",{"headline":63,"text":64},"Testing",[65,66],"Run the following Lambda CLI invoke command to invoke the function. Note, you must edit the {LambdaProxyArn} placeholder with the ARN of the deployed Lambda function. This is provided in the stack outputs.","\u003Ccode>aws lambda invoke --function-name {LambdaProxyArn} --invocation-type Event --payload '{ \"IsHelloWorldExample\": \"Hello\" }' response.json --cli-binary-format raw-in-base64-out\u003C\u002Fcode>","niodN2GfqU6QdEqly1vSCvBTBgjRaBM9dWrbmZDrsZo",1778846886602]