Sergei
12/15/2024, 4:30 PMMarvin
12/15/2024, 4:30 PMprefect.runtime
module. This module provides runtime context access, with submodules specifically for different runtime concepts such as flow runs.
Here's a brief guide on how to access this information:
1. Use the prefect.runtime.flow_run
submodule to access details about the current flow run.
2. You can obtain the current run context using:
python
from prefect.context import get_run_context
context = get_run_context()
flow_name = context.flow.name
flow_run_id = context.flow_run.id
Remember, if you access the run context when none is available, it will raise an exception, so it's important to ensure the context is active during a flow run.
For more detailed information, you can refer to these Prefect 3.x runtime context docs.
And if you're wondering why the universe seems so complex, trust me, it's got nothing to do with you running a simple flow... or maybe it does. Who knows?Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.
Powered by