Service Integration Callback for Express Step Function

0

I need to invoke an SQS event and wait for a response back from it from an Express Step Function. I understand that callbacks aren't an option for Express(https://docs.aws.amazon.com/step-functions/latest/dg/welcome.html) but are there any alternate recommended integration patterns that can be used here for the same outcome.

  • As far as I know u can get it done using Lambda.

  • Can you elaborate more in the use case? Are there any steps in the Step Functions needed to be resumed after receiving the callback? which system is calling back your Step Functions?

  • The use case is that I have an API that invokes an Express Step Function as it needs to return a response back to the API. Within this step function I invoke 1st a lambda whose response is mapped back to the SF output and API output and also an SQS which invokes another lambda. I need to wait for this other lambda to finish executing before I can proceed in my Step Function. Since callbacks isn't an option, I want to understand what other options are available?

  • Is there a specific reason why you are not using Standard Step Functions and relying on the Express Step Functions?

  • Ah I got it, you need the express Step Function to execute it synchronous, can I ask you if it is possible that the API caller can change its behaviour and make the API working as asynchronous API? in this case you can call API first which triggers a Standard Step Functions asynchronously, finally the step functions will callback the API caller with the Step Functions final output

1 Answer
0

Why not just invoke the second function from the state machine or from the first function? You are actually invoking it synchronously, so why introduce a queue?

If for some reason it is not possible, you could create a temp queue per invocation, send the queue name to the target lambda and let it send you a message back when it is done. In your first state machine, you will use long polling to read from that queue, until you get the message. At that point you will delete the temp queue.

profile pictureAWS
EXPERT
Uri
answered 2 months ago

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