I am trying to create a API service where any client can pass me his HTTP request and time in seconds after which he would like his HTTP request to be executed. I can think of two approaches here to make it happen:
- Create a lambda with nodeJS and use setTimeout to wait
- Create a step function to wait for x number of seconds would call my lambda to execute HTTP request
What I am trying to understand is what are the pros and cons of each. setTimeout looks easy to implement and with no obvious flaws. Is there any reason I should go for step functions?