I have the following aws step function step defined
"Step": {
"Type": "Task",
"Resource": "arn:aws:states:::states:startExecution.sync",
"Parameters": {
"Name.$": "$.executionName",
"StateMachineArn": "${arn}",
"Input.$": "$"
}
...
I came across this documentation which illustrates how to associate workflow executions
I tried to apply this in the step above, but I keep getting an error:
InvalidDefinition: Invalid State Machine Definition: 'SCHEMA_VALIDATION_FAILED: The value for the field 'Input.$' must be a valid JSONPath or a valid intrinsic function call at ...
"Step": {
"Type": "Task",
"Resource": "arn:aws:states:::states:startExecution.sync",
"Parameters": {
"Name.$": "$.executionName",
"StateMachineArn": "${arn}",
"Input.$": "States.JsonMerge($, {'AWS_STEP_FUNCTIONS_STARTED_BY_EXECUTION_ID': $$.Execution.Id}, false)"
}
...
not sure what I am doing wrong here
2
Answers
Not sure if the fist
$
is meant to be previous input from a step / input that you provide upon executing the sfn, but either way.. You can construct your own json within yourInput
field like so:As mentioned by @fedondev – you have to stringify and escape the object literal you are passing in second arg to JsonMerge. So your
Input
should look like: