问题
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