Search code examples
aws-lambdaaws-step-functions

Can a lambda in an AWS Step Function know the name of the step it is in?


For a lambda executed within a step function, I kind of expected that I could get the name of the current step from the lambda context, but it doesn't seem to be that simple.

Is there any way to get the name of the current step in a lambda that is executed within a Step Function?


Solution

  • AWS Step Functions released Context Object where you can access information about your execution.

    You can use it to send the execution arn to your lambda.

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