I'm setting an Order process using step function and I want to execute its states and wait for 1min when a status will change. Using lambda I created a http/s request from external api that returns an Order object.
"StartAt": "Process Order",
"States": {
"Process Order": {
"Type": "Task",
"Resource": "arn:aws:lambda:FUNCTIONTOREQUESThttpJSON",
"Next": "Is Received?"
},
"Is Received?":{
"Type" : "Choice",
"Choices": [
{
"Variable": "$.status",
"StringEquals": "Received",
"Next": "Received"
},
{
"Variable": "$.status",
"StringEquals": "Cancelled",
"Next": "Cancelled"
}
]
},
"Received":{
"Type": "Wait",
"Seconds": 60,
"Next": "Is For Approval or Cancelled?"
},
"Is For Approval or Cancelled?":{
"Type" : "Choice",
"Choices": [
{
"Variable": "$.status",
"StringEquals": "For Approval",
"Next": "nextState"
},
{
"Variable": "$.status",
"StringEquals": "Cancelled",
"Next": "nextState"
}
]
},
Let say, the current status = "Received" (json from Lambda function http request) if the status changed to "For Approval", it should go to the "For Approval" state. But I'm getting the same status value "Received" even though I already changed it to "For Approval" from the external API.