- Mais recentes
- Mais votos
- Mais comentários
When you added .waitForTaskToken to your Lambda task, did you also add logic elsewhere to receive the task token (in the Lambda function or in something downstream that you passed the token to) and to call back to Step Functions to close the loop? If not, then I believe you are just seeing the expected behavior here. With the callback pattern / .waitForTaskToken, step functions will call the target specified in your task then pause that part of the workflow until you call back or there's a timeout. https://docs.aws.amazon.com/step-functions/latest/dg/connect-to-resource.html#connect-wait-token
This seems the most likely case, however you stated that it "times-out on Choice" which would not align. I wonder if it just seems to look that way because you can see that the Lambda function was called but don't see the Choice state having executed.
As a side, it seems that you are calling Lambda functions that are then calling API-Gateway. It's possible you need to have these proxy Lambda functions, but if not, note that you can invoke API-Gateway directly from Step Functions. https://docs.aws.amazon.com/step-functions/latest/dg/connect-api-gateway.html
Have you configured logging on your step function? Refer to this if you haven't - https://docs.aws.amazon.com/step-functions/latest/dg/cw-logs.html
Logs should provide you a better idea of why the Step Function is getting timed-out?
Also I looked at your step function. I don't see a token in the callback to the lambda getting passed
Take a look at the example on this https://docs.aws.amazon.com/step-functions/latest/dg/connect-lambda.html
{
"StartAt":"GetManualReview",
"States":{
"GetManualReview":{
"Type":"Task",
"Resource":"arn:aws:states:::lambda:invoke.waitForTaskToken",
"Parameters":{
"FunctionName":"get-model-review-decision",
"Payload":{
"model.$":"$.new_model",
"token.$":"$$.Task.Token" --> This is missing in your step function
},
"Qualifier":"prod-v1"
},
"End":true
}
}
}
This has more information on the role of the token for callback functions
I did configure logging and it simply said that the function timed-out. I think the issue is related to the taskToken. Thank you for reaching out and helping!
Conteúdo relevante
- AWS OFICIALAtualizada há 2 anos
thanks for the response! I think the main problem was that I was calling the waitForTaskToken in both my first lambda function and did not recieve it. In this case I simply deleted the waitForTaskToken on line 7 and that seemed to fix it, I don't think I need the task token until the send email function is called.