Use-Case:
Image:
Code:
this.mapOverChildren = new Map(this, "Map Over Children", {
itemsPath: "$.data.children",
maxConcurrency: 1,
resultPath: "$.children",
});
this.mapOverChildren .iterator(new StepFunctionsStartExecution(this, 'Send Data to Step Function 2', {
stateMachine: stepFunction.Two,
integrationPattern: IntegrationPattern.REQUEST_RESPONSE,
resultPath: "$.stepFunctionTwoResponse"
});
At the momement, the resultPath
is just showing information about the step function execution. How do I get the data back from Step Function 2?
resultPath:
{
"ExecutionArn": "xxxxxxxxxxxx",
"SdkHttpMetadata": {
"AllHttpHeaders": {
"x-amzn-RequestId": [
"xxxxxxxxxxx"
],
"Content-Length": [
"000"
],
"Date": [
"Thu, 23 Feb 2023 11:24:14 GMT"
],
"Content-Type": [
"application/xxxxxxxxxxxxxxxxxxxxxxx"
]
},
"HttpHeaders": {
"Content-Length": "111",
"Content-Type": "application/xxxxxxxxxxxxxxxxxxxxxxx",
"Date": "Thu, 23 Feb 2023 11:24:14 GMT",
"x-amzn-RequestId": "xxxxxxxxxxxxxxxxxxxxxxx"
},
"HttpStatusCode": 200
},
"SdkResponseMetadata": {
"RequestId": "xxxxxxxxxxxxxxxxxxxxxxx"
},
"StartDate": 1677151454840
}
https://docs.aws.amazon.com/step-functions/latest/dg/connect-to-resource.html
REQUEST_RESPONSE
is the wrong integration pattern to use if you want to wait for the sub stepfunction to finish and use its result, use RUN_JOB
instead.