Hi, can I generate flow diagram in Prefect 2.0 fro...
# best-practices
m
Hi, can I generate flow diagram in Prefect 2.0 from code? In 1.0 i could use flow.visualize() to get pdf with diagram.
a
Good question. Our general recommendation, for now, is to run your code first in a development/sandbox environment, see the chart visualization and then move to your production Prefect environment e.g. Cloud 2.0
profiles make it easy - you can do:
Copy code
prefect profile use dev
prefect profile use prod
each profile may point to a different PREFECT_API_URL what I often do myself is run the flow first in my default profile which is a locally running Orion API server (PREFECT_API_URL='None' or localhost), then when I'm ready for a production run, I switch the profile to Cloud 2.0:
Copy code
prefect profile use cloud
to explain the reason for it: Prefect 2.0 no longer precompiles a DAG - it's generated at runtime dynamically
m
thank you, and how/where can I see the chart? Are you talking about "radar" in UI ?
a
exactly that
m
ok, thx!