While reading through https://bref.sh's source code and working with AWS Lambda, I found it to be important for me to get as much understanding of the process as I could. For instance, deploying a php cli function that never calls Bref's lambda() helper leads to a never-ending execution.
Timeline https://blog.deleu.dev/static/0e8e7bf63ca58aab920eb45cfe3d4fbd/4597d/lambda.png If we consider an API Lambda Function, it's usually executed by Api Gateway (APIGW) or Application Load Balancer.
Here, the code will make an HTTP call to the Lambda Runtime API asking if there's any work to be done.
This response is sent back to the Lambda Runtime API via an HTTP Request that contains a unique identifier; this is how the Runtime knows to which request this response belongs to.