I'm working on AWS Step functions. I've read the documentation on InputPath, OutputPath, and ResultPath. My problem is that I want to combine values from the input to a Lambda Task with a partial output from the task.
The input to the task is similar to below. I want to continue passing these values on to subsequent tasks.
{
"previous_task_result": 100,
"next_task_input": "asdf"
}
What I would like, is to have the output of my Lambda Task look like this:
{
"previous_task_result": 100,
"next_task_input": "asdf",
"current_task_result": {
"val1": "ghjk",
"val2": [0,2,13,100]
}
}
The specific problem is that the raw output of the Lambda Task looks like this. I only care about the Payload node. The rest of the output is boilerplate I would rather not pass through the Step Function.
{
"resourceType": "lambda",
"resource": "invoke",
"output": {
"ExecutedVersion": "$LATEST",
"Payload": {
"val1": "ghjk",
"val2": [0,2,13,100]
},
"SdkHttpMetadata": {
"HttpHeaders": {
"Connection": "keep-alive",
"Content-Length": "42",
"Content-Type": "application/json",
"Date": "Tue, 25 Feb 2020 14:36:29 GMT",
"X-Amz-Executed-Version": "$LATEST",
"x-amzn-Remapped-Content-Length": "0"
},
"HttpStatusCode": 200
},
"SdkResponseMetadata": {
"RequestId": "redacted"
},
"StatusCode": 200
}
}
I understand how to use ResultPath and OutputPath to combine the input with the output, or assign the output to a specific node, but what I can't find is a way to merge just the Payload node from the result with the existing input.