2

I have lambda which returns bunch of records from a database. I iterate through each of the record and invoke another lambda. After all the rows are complete, I would like to call another lambda which does some validation and sends out an email.

I am able to achieve this flow using Iterate pattern (https://docs.aws.amazon.com/step-functions/latest/dg/tutorial-create-iterate-pattern-section.html)

The issue is the call to lambda for each of the row is synchronous i.e the loop wait for the lambda to complete before invoking for the next row. This is not acceptable for our requirement as we want the step function to complete in few seconds.

I would like to know if there is way to make the call to lambda in loop asynchronous and that the final step can wait for all lambda instance to complete and continue with further processing.

1 Answer 1

1

It sounds to me like you're looking for the parallel state: https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-parallel-state.html

This would allow you to pass in an array of rows and have the lambdas all be invoked in parallel. The responses would then be recombined, very much like promise.all() in node.

Sign up to request clarification or add additional context in comments.

1 Comment

This seems to be for staic parallel activities. Looks like everyone is waiting for this dynamic number of parallel actiivties which step function yet to support. Here is the discussion forums.aws.amazon.com/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.