Specifying Execution Name for Nested Step Functions
Hi. I'm using nested Step Function executions using the Run Job (sync) integration. The default child Execution Name generated by AWS is a generic UUID. I'd like to specify my own (more meaningful) execution name, by passing it as an input attribute to the parent Step Function.
I tried to use a "Name": "$.executionName" parameter in the integration task, but I got an Invalid Name error when starting the child Step Function execution. I passed an alphanumeric/underscore input value for "executionName", which should be legal as a Step Function execution name.
I suspect Step Functions treats the "Name" parameter as a literal value and doesn't expand the reference, and tries to create an execution with the literal name "$.executionName". This raises the question, how else can I specify dynamic execution names for nested Step Functions? If the parameter is a literal string, it'll only work once for a single execution, which doesn't make much sense.
PS. I'm using AWS CDK and the StepFunctionsStartExecution construct.
I got the answer from https://twitter.com/notadamwong/status/1327475962540298241
You can use "Name.$" instead of "Name" to expand the reference to another input field.
I was confused by the AWS CDK StepFunctionsStartExecution construct's name property, which expands to "Name" behind the scenes. You have to create a custom construct in order to add a "Name.$" field.
Another tip from https://twitter.com/notadamwong/status/1327665864288583682
In AWS CDK you can use JsonPath.stringAt('$.executionName') as the name property, to automatically add the ".$" suffix to Name.
Relevant questions
How do I use Step Functions to create EMR clusters with different specifications?
Accepted Answerasked 2 years agoAWS Glue retry a job after an execution error
Accepted Answerasked a month agoInvalid security token error when executing nested step function on Step Functions Local
asked 16 hours agoWrite containerOverwrites from Lambda to Container
asked 5 months agoAWS Step Function Output for container services
asked 5 days agoRe-invoke or re execute Step function execution with same name?
asked 5 years agoRetrieve or store AWS Step function Execution history older than 90 days.
asked 2 years agoSpecifying Execution Name for Nested Step Functions
asked 2 years agoStep function as Scheduler
Accepted Answerasked 3 years agoStep Function to Send Email on Error/Success
asked 4 months ago