I have an AWS Step Function that consists of a "Map" (looping over an Array in the input), and then a number of tasks carried out in sequence with all the results. However, in the last step I'd also like to be able to access some of the original input data, that was not used in the intermediate steps. How should I best do this?
What I have tried so far:
Passing all input data through the map tasks. This however fails quickly, because there is a limit on how large results can be passed between functions, and with hundreds of iteration the original input is multiplied hundreds of times.
Using
Parallelstate, and add an empty state in one branch of the parallel execution that simply passes the input on, while all of the iteration happens in the other. This feels like a hack, because my step structure now poorly reflects the actual logic of the code.
What would be the “right” way to do this?
Iterate
over Fiz
+--------+ +-------------+ +------------+
{ | +---+ | | | | |
Foo: "Bar", --> -------+ | +---+ Y +----+ Z |
Fiz: [...], | +-+ | | | | |
} +-----+ +-------------+ +------------+
In box Z above, I want to have access to both 'Foo', and the output of Y