Hi Prefect, I'm trying to work out how to re run a...
# ask-community
b
Hi Prefect, I'm trying to work out how to re run a task in the UI. I have a flow that is very straight forward and the third task failed with the other two passing. Is there a way to re run this individual task and not just re run the entire flow? 🙏
b
You can change your flow/task to have some retries: https://docs.prefect.io/core/tutorial/04-handling-failure.html or you can pass in a parameter to the flow, called “scope” or something like that that would only run certain tasks.. I don’t know if there are other ways
👍 1
j
Hi @Ben Muller - From the UI you do need to re-run the flow run if you want to re-run a task run - task runs can't be run independently. That said, you can make sure only the one task in that flow is re-run. If your other tasks are finished and are not downstream dependencies of your upstream task, you can use the restart button. If you want to be sure you only run that one task, regardless of upstream/downstream dependencies etc, I suggest setting the state of the task run you want to re-run as pending, make sure the other task runs are in a finished state and set the state of your flow run as scheduled.
b
This is a great solution, thanks @Jenny 👏
can I ask, if task 2 -> task 3 passes some data. Do I have to use a Result handler ( like s3 ) in order for that data to be persisted during the re run?
j
Hi Ben - it depends on the scenario/what you have set up. I'm going to point you to the docs on caching because anything I write will basically be a re-hash of what they say anyway!