Parallel States Merge the output in Step Function


Is it possible to have following kind of Step Function graph, i.e. from 2 parallel state output, one combined state:

enter image description here

If yes, what would json for this looks like? If not, why?


A parallel task always outputs an array (containing one entry per branch).

You can tell AWS step functions to append the output into new (or existing) property in the original input with "ResultPath": "$.ParallelOut" in your parallel state definition, but this is not what you seem to be trying to achieve.

To merge the output of parallel task, you can leverage the "Type": "Pass" state to define transformations to apply to the JSON document.

For example, in the state machine below, I’m transforming a JSON array…

…into a few properties

Transform an array into properties with AWS Step Functions

Leave a Reply