https://prefect.io logo
Title
v

Vadym Dytyniak

03/16/2022, 11:26 AM
Hello. Is it possible using prefect.Client or graphql get upstream task_run_ids by task_run_id?
a

Anna Geller

03/16/2022, 12:46 PM
can you describe what you try to do? šŸ™‚ why do you think you need to use GraphQL for that?
v

Vadym Dytyniak

03/16/2022, 12:49 PM
When some task fails, we would like to have utility that will allow to collect checkpointed inputs that were passed to this task.
a

Anna Geller

03/16/2022, 12:52 PM
may I ask why? what is the end goal do you try to achieve? do you want to apply your own restart logic of some sort?
v

Vadym Dytyniak

03/16/2022, 12:55 PM
no, during debugging users would like to understand why this task failed and see inputs, run the same task locally and debug
a

Anna Geller

03/16/2022, 1:05 PM
For such debugging, perhaps a custom state handler that retrieves and prints (or sends alert via Slack?) the exception of a failed task run may be more helpful than a GraphQL query? Personally, I think for local debugging you can just use a debugger of your IDE that allows you to step into the next step, and at each step, you should see the variables/inputs. And also, when running your flows locally and debugging, such a GraphQL query wouldn't help since it would only be populated when doing a backend run, not when running flow locally. But if you still want to go that route you described with GraphQL queries, check out this PR that added Restarts in the UI repo: https://github.com/PrefectHQ/ui/pull/285/files My understanding of the process in this PR: ā€¢ it queries for Failed task runs (something also what you try to do), ā€¢ it queries for downstream tasks of failed task runs (for you it seems you want to go the opposite direction to fetch upstream task runs, but maybe the syntax already helps), ā€¢ then it restarts the task runs in the right order (respecting all the dependencies) and sets new task run states after completion (also something similar to what you try to do with rerunning specific task runs).
v

Vadym Dytyniak

03/16/2022, 1:09 PM
Thanks!
šŸ‘ 1