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?
Step Functions is based on state machines and tasks. A state machine is a workflow. A task is a state in a workflow that represents a single unit of work that another AWS service performs. Each step in a workflow is a state.
$ to the end, as you do when selecting state input with a path. Then, to access context object data instead of the input, prepend the path with $$. . This tells AWS Step Functions to use the path to select a node in the context object.
Amazon API Gateway now integrates with AWS Step Functions, allowing you to call Step Functions with APIs that you create to simplify and customize interfaces to your applications.
executionArn. The Amazon Resource Name (ARN) that identifies the execution. Type: String. Length Constraints: Minimum length of 1. Maximum length of 256.
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
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With