Search code examples
aws-lambdaaws-step-functions

Can a lambda in an AWS Step Function know the "execution name" of the step function that launched it?


I have this step function that can sometimes fail and I'd like to record this in a (dynamo) DB. What would be handy is if I could just create a new error handling step and that guy would just pick up the "execution name" from somewhere (didn't find it in the context) and record this as a failure.

Is that possible?


Solution

  • AWS Step Functions released recently a feature called context object.

    Using $$ notation inside the Parameters block you can access information regarding your execution, including execution name, arn, state machine name, arn and others.

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