12

I need to get the ARN of the current execution for my state machine inside the state machine itself. Is it possible?

So can I create a state machine(say from a lambda function) and then take its execution ARN and pass it as a parameter to that machine OR is there any utility available inside the state machine that allows getting the execution ARN for that machine?

Farhan Haider
  • 1,244
  • 1
  • 13
  • 22

2 Answers2

19

AWS Step Functions released recently a feature called context object.

Now you have access to the execution data through $$ inside the Parameters block.

https://docs.aws.amazon.com/step-functions/latest/dg/input-output-contextobject.html

diegosantiviago
  • 988
  • 8
  • 10
3

Step Functions do not currently have this feature, you can however specify your own execution id by specifying a name. This will make the ARN predictable, as it will end up being

arn:aws:states:[AWS Region]:[AWS Account ID]:execution:[Step Function Name]:[The name that you passed to the start-execution call]

javascript sdk docs

mtstrong17
  • 136
  • 3