UPDATE : as of May 23, 2009, this answer is deprecated since AWS introduced a way to access the current step in the step function, see Accepted Answer.
It looks like you're right, the current step is not expanded through the context variable.
Thus, information that allows you to determine at what stage the state machine is located must be transmitted from the previous step (i.e. from the previous lambda). This seems like the most correct option.
Or, as a workaround , you can try inserting pass states before calling lambda functions to pass in an identifier that can help you identify the current stage.
Suppose you have two steps in your destination computer:
"Step1Test": { "Type": "Task", "Resource": "arn:aws:lambda:us-east-1:xxxxxxxxxx:function:step1test", "Next": "Step2Test" }, "Step2Test": { "Type": "Task", "Resource": "arn:aws:lambda:us-east-1:xxxxxxxxxx:function:step2test", "End": true }
Here's how you can provide your lambda functions with the current step identifier passed through event.stepId
"Step1TestEnter": { "Type": "Pass", "Next": "Step1Test", "Result": "Step1Test", "ResultPath": "$.stepId" }, "Step1Test": { "Type": "Task", "Resource": "arn:aws:lambda:us-east-1:xxxxxxxxxx:function:step1test", "Next": "Step2TestEnter" }, "Step2TestEnter": { "Type": "Pass", "Next": "Step2Test", "Result": "Step2Test", "ResultPath": "$.stepId" }, "Step2Test": { "Type": "Task", "Resource": "arn:aws:lambda:us-east-1:xxxxxxxxxx:function:step2test", "End": true }