Join Slack
Powered by
Hi. In Prefect V1 we used the following variable -...
# ask-community
v
Vadym Dytyniak
10/06/2022, 7:50 AM
Hi. In Prefect V1 we used the following variable -
prefect.context.scheduled_start_time
. Is it any alternative in Prefect 2? Thanks.
✅ 1
a
Anna Geller
10/06/2022, 7:52 AM
There is! You can grab that from the context as well, IIRC the syntax is: from prefect import get_run_context
v
Vadym Dytyniak
10/06/2022, 7:55 AM
This one, correct?
Vadym Dytyniak
10/06/2022, 7:55 AM
a
Anna Geller
10/06/2022, 7:57 AM
Afk, but yes I think so, you may log the context from a scheduled run though, a flow run from deployment should have more information in the context
v
Vadym Dytyniak
10/06/2022, 8:39 AM
Thanks!
3
Views
Open in Slack
Previous
Next