How to visualize flow in prefect 2.0?

on this page Flow Visualization | Prefect Docs, there is an example give for prefect 1.0 to visualize a flow. it simply calls Flow.visualize() method.

however, I can’t find this method in prefect 2.1.1. what method should be used to visualize a flow?



Great question! For now, we recommend managing that by separating environments:

  • running first locally or in a development workspaces
  • investigating whether everything looks good, checking the Radar view
  • finally, moving to a production workspace and running there

Due to the dynamicism, there is no precompiled DAG view because 2.0 doesn’t precompile the DAG - all the magic happens at runtime and the view is generated on the fly dynamically

Came here with the same question. Was looking for something like

Would be nice to have something even if it is just a graphviz plot.

Take an example from the tutorial (second one here) First steps - Prefect 2.0

import requests
from prefect import flow, task

def call_api(url):
    response = requests.get(url)
    return response.json()

def parse_fact(response):
    fact = response["fact"]
    return fact

def api_flow(url):
    fact_json = call_api(url)
    fact_text = parse_fact(fact_json)
    return fact_text


Or even something in the UI to show the sequence of tasks rans

1 Like

Mind explaining this?

Think I got it

1 Like