1
votes

Sorry if the title is not good enough, I am trying to achieve the following:

  • API Gateway get Request 'A' and triggers Lambda Function B
  • Lambda Function B writes to queue C
  • Lambda Function D is listening on queue C (and gets triggered and process data and writes to queue E)
  • Lambda Function F is listening on queue E (gets triggered and send response to the Request 'A'.

My question is how to maintain track of the request that was originated and how to properly respond to the API Gateway instance that was triggered.

2

2 Answers

2
votes

The chaining of Lambda processing could be achieved by AWS Step Functions.

Step functions implement a state machine for synchronization among Lambda calls.

You can achieve the same with a synchronous Lambda invocation, but you have to pay double (waiting time of the caller and processing time of the callie).

The benefit of Step functions is, you don't pay for waiting.

1
votes

To my knowledge, you cannot do that. After Lambda Function B writes to Queue C, it is done. Invocation of Lambda Function D is event-driven and not on-demand and you cannot wire up multiple individual processes in the original request A as it is done by that time.