I've got a workflow that looks like this [get url ...
# ask-the-community
t
I've got a workflow that looks like this [get url from API] -> [download url] -> [validate download] I'm dealing with situations where the third step
validate download
fails. This usually can be resolved by retrying the download. Is there any way to have a workflow retrigger itself in flyte? Basically if I see an error on
validate download
can i just restart the workflow?
g
Can you do it at the task level and throw a FlyteRecoverableException? https://docs.flyte.org/projects/flytekit/en/latest/design/authoring.html#exception-handling
k
is this what you want
Copy code
url = get_url
while True:
  try:
    download(url)
    validate(url)
    return True
  except:
    pass
t
Thanks Greg -
FlyteRecoverableException
looks like what I need. I can throw that, and then set
@task(retries=10)
so that it retries. Ketan - that solution would work fine within a task, but my download and validate fns are flyte tasks themselves. Would the
while true: try
structure work in a workflow? I haven't tried that.
k
hmm it doesnt today
but there is some work in progress 🙂
152 Views