Using the Output JSON data returned from a nested Step Function

不羁的心 提交于 2020-05-26 03:50:17

问题


Im creating a POC with nested Step Functions (SF) and have hit the following issue.

  • I have SF A that has a sync task that starts the execution of SF B (using the recently announced syntax) & waits for it to complete.
  • SF B returns a valid JSON output
  • In SF A, I can see (from the output of the task that calls SF B) the correct fields returned. e.g Status, ExecutionArn as well as the Output.
  • I then want to execute a Choice Task in SF A that uses a field returned from SF B. However the json in the Output field returned from SF B is escaped json, so the jsonPath isn't able to extract a field from the output data from the nested json.

Is there something im missing or a recommended approach to this scenario? I could "process" the escaped json string in a lambda or something but using it in the Choice task... but that kinda defeats the point of the nested SF workflow somewhat.

Any help appreciated.


回答1:


I ran into the same issue. I used "OutputPath": "$.Output" at first and that returned the escaped json. I removed that and added "ResultPath": "$.Output", This works, it returns the output as json including the escaped version. Its ok for now until AWS addresses this.




回答2:


Not sure it's new since you asked the question but the answer is in the link you provided: Use "arn:aws:states:::states:startExecution.sync:2" in the task resource field instead of "arn:aws:states:::states:startExecution.sync"



来源:https://stackoverflow.com/questions/57704695/using-the-output-json-data-returned-from-a-nested-step-function

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!