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?
Services that you can configure to invoke Step Functions include: AWS Lambda, using the StartExecution call. Amazon API Gateway.
Step Functions is a serverless orchestration service that lets you easily coordinate multiple Lambda functions into flexible workflows that are easy to debug and easy to change. Step Functions will keep your Lambda functions free of additional logic by triggering and tracking each step of your application for you.
IAM Policy for the Main Workflow Role Recently, AWS Step function added a functionality to call one step function from another step function. It works like calling any other service ( AWS Glue, AWS Lambda, AWS Sagemaker , AWS Batch ). It does support both Sync and aysnc.
Based on the documentation, I was using Parameters
and $$
to pass the step function context object into my lambda function. To test and see if it was working, I thought I could go to the step function console, start a new execution and see the context object being passed into the step function on the "Step Input" tab. To my dismay, it wasn't displayed there. I added some diagnostic logging to the lambda function serializing the input to JSON and logging out to CloudWatch. Cloudwatch logs showed that the context object was being passed in.
Anyway, thought I would post this here to maybe help someone avoid the time I spent trying to figure this one out. It gets passed in, just doesn't show up in the step function console.
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
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