0

new to backend development.

I have a service that executes a step function which is essentially a countdown timer step function that triggers a lambda.

This lambda takes a url from the step function to hit my service's endpoint.

In the event that my endpoint does not successfully complete the necessary work (through any number of potential failures), how can I communicate back to the lambda to attempt to hit my endpoint again.

  • Do you want to retry within the same Lambda function execution, or do you wish to execute the whole Lambda function again? – John Rotenstein Oct 17 '19 at 00:40
  • I would love to know either use case, but specifically I would like to run the whole lambda again. I.E. The lambda attempts to hit a credit card refund endpoint within my service. The credit card service dependencies are down. The refund fails but I need to attempt to hit this refund at a later time when the dependencies are up. So somehow I need to hit that lambda again from my service to try to send the information necessary to refund the credit card payment. Do I need to call the step function again? Is there a way to hit the lambda directly? What are the best practices? – Samier Mahagna Oct 17 '19 at 03:28
  • If "at a later time" is any period longer than 15 minutes, you should just save the state and get out of the function. Maybe try writing the refund info as a DynamoDB item that gets processed for retries on a 10 minute cycle? Obviously delete items that complete successfully to keep the DB from gathering up a bunch of basically worthless failed refund data. – andrewec Oct 17 '19 at 03:36

0 Answers0