Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pass multiple InputPaths to a StepFunctions Task

While invoking a state's task, is it possible to specify multiple InputPaths, or 'pick' more than one JSON nodes to be passed to the task's input ?

Example: If this is the execution input: { "id":"identifier", "nestedObjectA": { "doubleNestedObjectA": { "valueA": "value" } }, "nestedObjectB" : { "valueB": "value" } } is it possible to pass the following as input to one task: { "id":"identifier", "nestedObjectB" : { "valueB": "value" } }

and the following to other ? { "id":"identifier", "nestedObjectA": { "doubleNestedObjectA": { "valueA": "value" } } }

like image 326
mathpal Avatar asked May 12 '18 08:05

mathpal


People also ask

How do you pass input parameters to step functions?

Step Functions paths use JsonPath syntax. To specify that a parameter use a path to reference a JSON node in the input, end the parameter name with . $ . For example, if you have text in your state input in a node named message , you could pass that to a parameter by referencing the input JSON with a path.

What is ResultPath in step functions?

Use ResultPath to combine a task result with task input, or to select one of these. The path you provide to ResultPath controls what information passes to the output. ResultPath is limited to using reference paths, which limit scope so that it can identify only a single node in JSON.

Can step functions run in parallel?

A Parallel state causes AWS Step Functions to execute each branch, starting with the state named in that branch's StartAt field, as concurrently as possible, and wait until all branches terminate (reach a terminal state) before processing the Parallel state's Next field.


1 Answers

This was not initially possible using JsonPath, but can now be easily done using parameters in stepfunctions.

like image 83
mathpal Avatar answered Oct 09 '22 02:10

mathpal