When using Prefect 1 or 0.15, how can I know for a...
# prefect-community
s
When using Prefect 1 or 0.15, how can I know for a task with
always_run
trigger and
skip_on_upstream_skip=False
, whether any of the upstream-tasks failed or were skipped? I need this information in the task-run method.
k
You can pass them as inputs into that task, I think that is the only way and they should come in as Python exceptions if they failed
s
OK thank you. I tried to set attributes of the task in the state-handler. That works, but I can’t figure out how to get the upstream-states within the state-handler.
k
You can’t without querying the GraphQL API for them. What are you trying to do?
s
Understood, thank you. I want a specific task to run always no matter what at the end of a series of tasks (not necessarily at the end of the flow) and write the status its upstream tasks to a database and sometimes also free some resources
k
I think you would have to do it in the body of the task as opposed to the state handler
👍 1