Mermaid.ink Timeout Error When Using Short Node Name in langgraph Diagram #617

Closed
opened 2026-02-20 17:40:59 -05:00 by yindo · 6 comments
Owner

Originally created by @akash97715 on GitHub (May 12, 2025).

Checked other resources

  • I added a very descriptive title to this issue.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangChain rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).
  • I posted a self-contained, minimal, reproducible example. A maintainer can copy it and run it AS IS.

Example Code

graph_image = Image(graph.get_graph().draw_mermaid_png())

Error Message and Stack Trace (if applicable)

TimeoutError: The read operation timed out

requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='mermaid.ink', port=443):
Read timed out. (read timeout=10)

Description

I m trying to use langgrqph get graph mermaid api. Suggest me best way step by step to resolve this issue

System Info

Langgraph latest

Originally created by @akash97715 on GitHub (May 12, 2025). ### Checked other resources - [x] I added a very descriptive title to this issue. - [x] I used the GitHub search to find a similar question and didn't find it. - [x] I am sure that this is a bug in LangChain rather than my code. - [x] The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package). - [x] I posted a self-contained, minimal, reproducible example. A maintainer can copy it and run it AS IS. ### Example Code graph_image = Image(graph.get_graph().draw_mermaid_png()) ### Error Message and Stack Trace (if applicable) TimeoutError: The read operation timed out requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='mermaid.ink', port=443): Read timed out. (read timeout=10) ### Description I m trying to use langgrqph get graph mermaid api. Suggest me best way step by step to resolve this issue ### System Info Langgraph latest
yindo closed this issue 2026-02-20 17:40:59 -05:00
Author
Owner

@hinthornw commented on GitHub (May 12, 2025):

If mermaid.ink is timing out, you can run locally with pyppeteer: https://langchain-ai.github.io/langgraph/how-tos/graph-api/?h=pyppe#png

@hinthornw commented on GitHub (May 12, 2025): If mermaid.ink is timing out, you can run locally with pyppeteer: https://langchain-ai.github.io/langgraph/how-tos/graph-api/?h=pyppe#png
Author
Owner

@akash97715 commented on GitHub (May 12, 2025):

Used pyppetter(failed)and graphviz(some c++ graphc depemdency). Only print_ascii() works. But i want png

@akash97715 commented on GitHub (May 12, 2025): Used pyppetter(failed)and graphviz(some c++ graphc depemdency). Only print_ascii() works. But i want png
Author
Owner

@gbaian10 commented on GitHub (May 12, 2025):

You can also consider outputting in Mermaid syntax and then use some online Mermaid tools to generate images.
For example: https://mermaid.live/

Or some Markdown renderers also support rendering Mermaid.

@gbaian10 commented on GitHub (May 12, 2025): You can also consider outputting in Mermaid syntax and then use some online Mermaid tools to generate images. For example: https://mermaid.live/ Or some Markdown renderers also support rendering Mermaid.
Author
Owner

@akash97715 commented on GitHub (May 12, 2025):

Got it, but i checked the implementation code for lamggrqph graph generate, it is doing the same thing internally. Basically generating the mermaid syntax snd calling the API, wondering why its failing!

@akash97715 commented on GitHub (May 12, 2025): Got it, but i checked the implementation code for lamggrqph graph generate, it is doing the same thing internally. Basically generating the mermaid syntax snd calling the API, wondering why its failing!
Author
Owner

@akash97715 commented on GitHub (May 12, 2025):

You can also consider outputting in Mermaid syntax and then use some online Mermaid tools to generate images. For example: https://mermaid.live/

Or some Markdown renderers also support rendering Mermaid.

Any example will be great help using markdown :-) do u have those markdown implementation wrapper on langgraph

@akash97715 commented on GitHub (May 12, 2025): > You can also consider outputting in Mermaid syntax and then use some online Mermaid tools to generate images. For example: https://mermaid.live/ > > Or some Markdown renderers also support rendering Mermaid. Any example will be great help using markdown :-) do u have those markdown implementation wrapper on langgraph
Author
Owner

@vbarda commented on GitHub (May 12, 2025):

this is a mermaid.ink API issue, not a langgraph issue - we will look into more options for rendering that don't rely on the 3rd party API, but in the meantime you can use the suggestions above w/ Pyppeteer / custom services

re: markdown the solution would be simply pasting generated mermaid syntax from graph.draw_mermaid() and pasting to a markdown renderer (same as w/ mermaid.live)

@vbarda commented on GitHub (May 12, 2025): this is a mermaid.ink API issue, not a langgraph issue - we will look into more options for rendering that don't rely on the 3rd party API, but in the meantime you can use the suggestions above w/ Pyppeteer / custom services re: markdown the solution would be simply pasting generated mermaid syntax from `graph.draw_mermaid()` and pasting to a markdown renderer (same as w/ mermaid.live)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraph#617