In a state machine with 3 steps, is it possible for step 3 to use the output of step 1? In my specific scenario I have:
Task -> Map State -> Task
where I'm specifically interested in using the Map State's input for its first iteration as the input for Step 3. I could handle the entire input to the map state as well, but so far I'm not seeing how to achieve either of these.
"ResultPath":"$.mapOutput" will prefix mapOutput to output of the map. and combined input and output will be send as input to following task.
This is input to Step 3:
{
"Comment": "Insert your JSON here",
"inputForMap": [
"iter 1",
"iter2"
],
"mapOutput": [
"iter 1",
"iter2"
]
}
Here is entire definition
{
"StartAt":"Dummy Step 1 Output",
"States":{
"Dummy Step 1 Output":{
"Type":"Pass",
"Result":[
"iter 1",
"iter2"
],
"ResultPath":"$.inputForMap",
"Next":"loop on map"
},
"loop on map":{
"Type":"Map",
"ResultPath":"$.mapOutput",
"Next":"Step three",
"Iterator":{
"StartAt":"Step 2 - Looping on map",
"States":{
"Step 2 - Looping on map":{
"Type":"Pass",
"End":true
}
}
},
"ItemsPath":"$.inputForMap",
"MaxConcurrency":1
},
"Step three":{
"Type":"Pass",
"Next":"End of Step Function"
},
"End of Step Function":{
"Type":"Pass",
"End":true
}
}
}

Step three Input:

I found out, all I needed to do was set ResultPath: null on Step 2, and it would pass the input straight through
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With