Plotting the Graph ⚠

Under development

You should not use the plotting feature in a production enviroment. We are still developing and testing it.


This feature requires the library pygraphviz.

Every transformer has two methods to plot the graph of the flow:

  • .to_dot(): which is used to export the transformer as graph using the dot format.

  • .to_image(): used to export the transformer as an image.


Assume the following graph:

def extract_request_id(request: Request) -> int: ...

def get_user_by_id(user_id: int) -> User: ...

def get_last_seen_items(user: User) -> list[Product]: ...

def get_last_ordered_items(user: User) -> list[Product]: ...

def get_user_network_data(users: User) -> UserNetwork: ...

def get_recommended_items(
    items: tuple[list[Product], list[Product], UserNetwork]
) -> list[Product]: ...

def group_by_department(items: list[Product]) -> DepartmentWithItems: ...

get_user_recommendations = (
    >> get_user_by_id
    >> (
    >> get_recommended_items
    >> group_by_department

We can call the method .to_image() of the get_user_recommendations transformer instance:

get_user_recommendations.to_image('get_user_recommendations.png', with_edge_labels=True)

The resulted plot is:

Graph for send_promotion

We can also call the .to_dot() method:

get_user_recommendations.to_dot('', with_edge_labels=True)

Then, we can use any dot visualizer tool to plot the graph. For example, we can use We need just to copy the content of file and paste it on editor.

Click here to see this graph on


We are already working on a dedicated solution to visualize and interact with Gloe graphs in real time during development.