Api gateway get output results from step function?

后端 未结 4 1983
别那么骄傲
别那么骄傲 2020-12-14 19:07

I followed tutorial on creating and invoking step functions

I\'m getting output in my GET request of api as

 {
  \"executionArn\": \"arn:aws:states:         


        
4条回答
  •  隐瞒了意图╮
    2020-12-14 19:29

    First of all the step functions executes asynchronously and API Gateway is only capable of invoking the step function (Starting a flow) only.

    If you are waiting for the results of a step function invocation from a web application, you can use AWS IOT WebSockets for this. The steps are as follows.

    • Setup AWS IOT topic with WebSockets.
    • Configure the API Gateway and Step functions invocation.
    • From the Web Frontend subscribe to the IOT Topic as a WebSocket listener.
    • At the last step (And in error steps) in the Step Functions workflow use AWS SDK to trigger the IOT Topic which will broadcast the results to the Web App running in the browser using WebSockets.

    For more details on WebSockets with AWS IOT refer the medium article Receiving AWS IoT messages in your browser using websockets.

提交回复
热议问题