alwaysAStudent
alwaysAStudent

Reputation: 2274

AWS Step Function - Re-execute step after wait

I have a use case where I have a AWS Step function where is each task is a Lambda. One of the lambda expects a particular version file to be present in an S3 location. The particular version of file is uploaded by an external service. The only way to know if version recently uploaded is the one we are interested in, is by looking for a data attribute inside the file.

If data attribute is missing, then I am not interested in that version and in that case I want to wait for an hour and re-execute the same lambda to check if newer version uploaded is the version we are interested in, until either we find the correct version or exhaust retries.

If at any point within retry limit I find the data attribute, the next task should be executed.

Any advice is much appreciated on how to tackle this.

Upvotes: 2

Views: 1063

Answers (1)

odenS0n
odenS0n

Reputation: 189

Use a choice state after your lambda. If the lambda output indicates the version wasn't found, then redirect to a wait state set for 1 hour which feeds back into the lambda. If the lambda output indicates the version was found, then continue with processing.

Hope this helps!

enter image description here

Upvotes: 4

Related Questions