https://prefect.io logo
Title
l

Leon Kozlowski

09/14/2022, 9:24 PM
Can flow run context be fetched within a task in 2.0?
1
z

Zanie

09/14/2022, 9:28 PM
Technically, yes. with
prefect.context.FlowRunContext.get()
. However, we make no guarantees that it will be available as we do not recreate the flow run context when task runs are executed remotely.
The
TaskRunContext
is intended to contain everything you could need from within the task run. We haven’t necessarily filled it out because we aren’t sure what people need. What kind of additional data are you looking for?
l

Leon Kozlowski

09/14/2022, 9:30 PM
I’m interesting in the expected flow run start time in some of my tasks
(it might be in there too, I haven’t checked, just working through some 0.15.12 code I’m migrating)
It doesn’t look like scheduled start time is available