is there an easy way to look up the current flow I...
# prefect-community
p
is there an easy way to look up the current flow ID from within a flow?
j
Hi @Philip MacMenamin you should be able to get the flow’s ID from context:
Copy code
...inside task...
from prefect import context
print(context.get("flow_id"))
p
thanks Josh - sorry - I meant I need to look up the run id
j
context.get("flow_run_id")
should do the trick
✔️ 1
List of available context variables https://docs.prefect.io/api/latest/utilities/context.html 🙂
p
yup, it does.
And... yes, that answers my next question. For some reason I couldn't find the appropriate docs
c
@Marvin archive “How to access flow and flow run ID from within a Flow?”