https://prefect.io logo
#prefect-community
Retrieving a flow's scheduled start time from context
l

Liz McCutcheon

12/07/2022, 12:34 PM
Hi all, Is there a way of retrieving a flow's scheduled start time from context in Prefect2 ? As we want to use the scheduled time (not the actual run time) as input for some of its tasks. It was easy in Prefect 1 but can't work out how to do it in Prefect2 now that we've migrated. Thank you !
r

redsquare

12/07/2022, 12:58 PM
You can use the get_run_context() and use flow_run.expected_start_time and flow_run.start_time
upvote 2
l

Liz McCutcheon

12/07/2022, 1:00 PM
Excellent, thank you !
👍 1
2 Views