S3 object and lambda function in step machine with the asynchronous express workflows


My state machine starts with a MAP state. Inside the Map state, there are 2 tasks, one after one (task#1 invokes lambda A, task#2 invokes lambda B). The lambda A will process the files conversion, upload those files into S3, and return a S3 object key. The lambda B will grab the S3 object key from task#1, get the object from S3, and then interact with the third party API.

My question is that before the lambda B is invoked, is there a way to notify the state machine that the files have been saved in S3 and ready to be read? Could we implement the S3-EventBridge in the asynchronous express workflows?

1 Answer
Accepted Answer

Why do you need to notify the state machine about it? Lambda A writes the file and only returns when the file is on S3. Lambda B will not be invoked until Lambda A finishes (assuming they are in sequence and not in a Parallel state).

profile pictureAWS
answered 2 years ago
  • My bad, forget to mention that I am using python boto3 SDK for the lambda. When the uploading through upload_file() is finished, it returns nothing. So I am not sure that it means the files uploading are done or just S3 accepts the API call without an exception.

  • Should be done when it returns.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions