Can I get the retryAttempt of a task/pass it as an...
# flyte-support
g
Can I get the retryAttempt of a task/pass it as an input to a task?
Following up on the above question, I am thinking to let a task retry 3 times for example, but set 4 times. If the currentAttempt == 4/max_retry_attempts then just return a default value so that the task doesn't block the rest.
https://docs.flyte.org/en/latest/user_guide/concepts/main_concepts/tasks.html Initially was thinking to use a signal, but I see that if it times out then it will still be marked as failure, so letting the next retry attempt return some default value would be a way to keep the whole workflow from failing because of the timed out task
c
for regular python tasks we guarantee that there will be an environment variable called ​`FLYTE­_ATTEMPT­_NUMBER`​
Is that enough for your purposes?
g
Yes, thank you!